Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7922205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:52:33+00:00 2026-06-03T16:52:33+00:00

I’m currently working on building an automated functional/acceptance test suite for a project, but

  • 0

I’m currently working on building an automated functional/acceptance test suite for a project, but I don’t have a lot of experience writing these types of tests, so I wanted to get some input on properly structuring them. Specifically, I’m working with Arquillian’s Graphene extension.

For example, say I have 3 tests, A, B, and C.

TestA : Tests logging into an account in the application. So, if test is successful, the browser should be on the account’s home/info page.

TestB : Tests modifying an account’s password. This would require logging in to the account, then testing the password change functionality.

TestC : Tests modifying an account’s email. This would again require logging in to the account, then testing the email change functionality.

If TestA fails due to a problem with the login code, obviously TestB and TestC should fail, as well, since they require being logged in to an account.

Question: Should automated functional/acceptance tests each duplicate a process that is necessary to complete whatever the test is verifying? In this case, TestB and TestC need to login to the account before doing anything else. Should each test explicitly call something like:

/* ...initial test setup code here */
LoginPage.login(username, password);
assertTrue(onCorrectAccountPage);
AccountModification.changePassword(newPassword);

Or should I use some way of mocking an account into the session that can be used by Tests B and C so that they don’t fail even if TestA (the actual login test) does?

Since these are user-acceptance tests, my thought was that they should do exactly what the user would do and log in whenever necessary, but I’m not sure if this is unnecessary duplication that should be handled differently (i.e., treated like units of functionality, similar to a standard unit test) and I wanted to get feedback from someone with more experience in this area.

Thanks in advance. Hopefully my question isn’t too convoluted. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:52:34+00:00Added an answer on June 3, 2026 at 4:52 pm

    I personally have done it so that each test case replicates the users action as much as possible, but cutting out places where needs be. For example, TestA: logins in, goes to the correct website, goes to it’s admin system, finds a user, and deletes part of the users information (such as name), TestB: logins in, goes to the correct website, goes to it’s admin system, finds a user, and attempts to delete the users entirely via a button.

    TestA and TestB end up on the same page – the user detail page. So in test A, I can do it all properly, exactly how a user does it, but in test B, I go directly to the detail page for that user, as opposed to going through the correct navigation manually. Why?

    Saves time, why should I re-do the navigation in test B when test A already tests that anyway?

    Remember that tests should not be dependant on each other – if all three tests fail because you cannot login – that’s the whole point, you cannot login, so you cannot do any of the other actions.

    Think of it as a user would. Each test has their own piece of user-viewable functionality they are testing, but if you cannot login, a user cannot see any of that or do anything with the functionality anyway. If I cannot login, I cannot change my password, or my email – so logically the tests should fail in the same manner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.