When getting started with any type of QA testing, it’s always helpful to have test cases. But what are QA test cases, and why are they important? Read on to learn how they work, and how to write test cases.
What Should A Test Case Contain?
Well written test cases should contain the following aspects:
- Title or ID (ie: “LOG-1”)
- An association with a section of the site/app (ie: “Login”)
- Notes on any setup needed (for example, “access to a staging build” or “admin credentials”)
- Steps to follow to perform the test
- Expected results
Why Are Test Cases Important?
Having a suite of test cases makes the whole Agile QA process more efficient. In fact, test cases can even show new colleagues how the app or site is supposed to work — right down to the smallest details.
Most importantly, having test cases that all team members can review ensures two crucial details:
- There are no gaps in test coverage. Let’s say that QA hasn’t been informed about a particular feature or requirement. By reviewing test cases, other team members can immediately determine if there’s missing test coverage.
- Everyone is on the same page. Sometimes there are misunderstandings about how a feature is supposed to work. Any misconceptions can be identified faster and more easily when a developer or product manager can review test cases.
For more on creating test cases without team collaboration, see our article How to Write Test Cases Without Requirements.
Test Cases For Manual Testing
Manual testing is essential for the quality of a mobile app or website. In the beginning of the software development life cycle, manual QA testers often interact with the product owner and project manager, and collaborate with developers. Accordingly, this teamwork ensures that the product is developed with the best possible user experience. The result of that communication is manifested in the test cases. This is part of why test cases are invaluable for Engineering.
Picture a team with one skilled QA engineer (we’ll call the tester Shawn Carter) and a 3-week sprint. Let’s say that the QA engineer has some notes about feature requirements, but no formal test cases. Week two of the sprint rolls around, and Shawn has a family emergency and needs to be out for the next month. In a perfect world, there will be a well-trained backup QA engineer, plus access to Shawn’s notebook. But what are the chances that the sprint is going to be tested completely and rigorously? Maybe better than if there were no notes and no backup. But this scenario would be challenging for even the best QA engineer.
Now imagine if the above scenario happened and Shawn Carter had well-defined test cases. These would include all of the necessary setup information, steps to follow, and expected results. You could breathe a sigh of relief knowing that the sprint could go on. Test cases can be the difference between smooth sailing and total disaster.
(Teams can also minimize concerns with a QA lead being out by doing collaborative QA job sharing.)
Test Cases for Automation
Typically, manual QA testers will be the ones writing the test cases. The automation tester then has the responsibility of translating the test cases into automated tests. This can be done with Appium, Selenium WebDriver, JUnit, QTP, JMeter, and/or a suite of other tools.
Remember how manual QA collaborated with product managers and developers earlier on? The benefits of all that research make writing automated tests faster, easier, and without a need for going back to square one. Clarifying questions may come up, but redundancy will be decreased big-time. The result? A functional automated test suite that lets manual testers focus on new features — instead of spending days doing regression testing.
For more, see our guide to the Top 5 Test Cases to Automate.
Sample Test Cases and Template for a Login Page
Let’s get to the good stuff! Here are some sample test cases, using a template for a login page or screen. These test cases aren’t exhaustive. But they’re good simple examples of what test cases look like.
(If you’re viewing on a mobile device, we recommend using landscape mode.)
ID | Requirement | Setup | Steps | Expected Result |
---|---|---|---|---|
LOG-1 | Login/Sign up menu button should function | Access to staging iOS/Android builds + cell service or internet connection | 1. Open app 2. Tap hamburger menu icon in top left 3. Tap "Login/Sign Up" button | User should be directed to login/sign up screen within 2 seconds. |
LOG-2 | When logged in, tapping "Logout" in left nav menu should log the user out | Access to staging iOS/Android builds, cell service or internet connection, and valid account credentials | 1. Open app 2. Tap hamburger menu icon in top left 3. Tap "Login/Sign Up" button 4. Log in using valid account credentials 5. Tap hamburger menu icon in top left 6. Tap "Logout" | User should be logged out, and directed to home screen within 2 seconds. |
LOG-3 | If user enters incorrect password, relevant error message should appear | Access to staging iOS/Android builds + cell service or internet connection | 1. Open app 2. Tap hamburger menu icon in top left 3. Tap "Login/Sign Up" button 4. Enter an email in "Email" field 5. Enter a password that is not valid 6. Tap "Login" button | Relevant error message should appear within 2 seconds, informing the user that the password was not valid. |
LOG-4 | When user enters valid email address and password and taps Login, they should be logged in and taken to Home screen | Access to staging iOS/Android builds, cell service or internet connection, and valid account credentials | 1. Open app 2. Tap hamburger menu icon in top left 3. Tap "Login/Sign Up" button 4. Log in using valid account credentials | User should be directed to home screen as a logged in user within 2 seconds. |
LOG-5 | Email address field should not be case sensitive | Access to staging iOS/Android builds, cell service or internet connection, and valid account credentials | 1. Open app 2. Tap hamburger menu icon in top left 3. Tap "Login/Sign Up" button 4. In the email field, enter a valid registered email address, but use capital letters for some of the characters (for example, teST@tesTING.cOM) 5. Enter valid password 6. Tap "Login" | User should be directed to home screen as a logged in user within 2 seconds. |
LOG-6 | Password field should be case sensitive | Access to staging iOS/Android builds + cell service or internet connection | 1. Open app 2. Tap hamburger menu icon in top left 3. Tap "Login/Sign Up" button 4. Enter an email in "Email" field 5. Enter a password that would be valid, but use capital letters for characters that should have been lowercase, and lowercase letters for characters that should have been caps 6. Tap "Login" | Relevant error message should appear within 2 seconds, informing the user that the password was not valid. |
What Are QA Test Cases?
In conclusion, test cases are a great way to make sure that the mobile app or website has the test coverage it needs. For instance, test cases increase efficiency, and can even help automated testing. And while it’s always best to have seasoned QA engineers do the testing, test cases also allow backup QA to jump in and help out in a pinch.
Need Test Cases?
Looking for QA testers to write test cases for your app or site (or to test it)? Check out our QA testing services.
[…] Writing test cases […]