How to Test Wishlists on Android (Complete Guide)
Testing wishlists on Android apps is crucial to ensure a seamless user experience. Wishlists allow users to save items for future purchases, and any issues with this feature can lead to frustration an
Introduction to Wishlist Testing
Testing wishlists on Android apps is crucial to ensure a seamless user experience. Wishlists allow users to save items for future purchases, and any issues with this feature can lead to frustration and lost sales. Common failures in wishlist implementations include items not being added or removed correctly, wishlists not being synced across devices, and errors when trying to purchase items from the wishlist.
What to Test
The following test cases cover various scenarios to ensure your wishlist feature is working correctly:
- Happy path scenarios:
+ Add an item to the wishlist and verify it appears in the list
+ Remove an item from the wishlist and verify it is no longer in the list
+ Add multiple items to the wishlist and verify they are all displayed correctly
+ Purchase an item from the wishlist and verify it is removed from the list
- Error scenarios:
+ Attempt to add an item to the wishlist when the user is not logged in
+ Attempt to remove an item from the wishlist when the user is not logged in
+ Add an item to the wishlist that is out of stock
+ Attempt to purchase an item from the wishlist that is out of stock
- Edge cases:
+ Add an item to the wishlist with a special character in the title
+ Add an item to the wishlist with a long description
+ Remove all items from the wishlist and verify the list is empty
- Accessibility considerations:
+ Verify that the wishlist feature is accessible using the screen reader
+ Verify that the wishlist feature is accessible using the keyboard only
+ Verify that the wishlist feature has proper color contrast and font sizes
Manual Testing Approach
To manually test the wishlist feature, follow these steps:
- Launch the app: Open the Android app on a physical device or emulator.
- Login to the app: Enter valid login credentials to access the app's features.
- Navigate to the wishlist: Find the wishlist feature in the app, usually in the user's profile or account section.
- Add an item to the wishlist: Select an item from the app's catalog and add it to the wishlist.
- Verify the item is in the wishlist: Check that the item appears in the wishlist and that all details are correct.
- Remove the item from the wishlist: Select the item in the wishlist and remove it.
- Verify the item is no longer in the wishlist: Check that the item is no longer in the wishlist.
- Repeat steps 4-7 for multiple items: Add and remove multiple items to ensure the wishlist feature works correctly for all items.
Automated Testing Approach
To automate testing of the wishlist feature on Android, you can use tools like Appium or Espresso. Here is an example of how to use Appium to automate the addition of an item to the wishlist:
// Import necessary libraries
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
// Set up the Appium driver
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://localhost:4723/wd/hub"), capabilities);
// Navigate to the item details page
driver.findElement(By.id("item_details_button")).click();
// Add the item to the wishlist
driver.findElement(By.id("add_to_wishlist_button")).click();
// Verify the item is in the wishlist
assert driver.findElement(By.id("wishlist_item")).isDisplayed();
You can also use Espresso to automate the testing of the wishlist feature. Here is an example of how to use Espresso to automate the removal of an item from the wishlist:
// Import necessary libraries
import androidx.test.espresso.Espresso;
import androidx.test.espresso.action.ViewActions;
import androidx.test.espresso.assertion.ViewAssertions;
import androidx.test.espresso.matcher.ViewMatchers;
// Navigate to the wishlist page
Espresso.onView(ViewMatchers.withId(R.id.wishlist_page)).perform(ViewActions.click());
// Remove the item from the wishlist
Espresso.onView(ViewMatchers.withId(R.id.remove_from_wishlist_button)).perform(ViewActions.click());
// Verify the item is no longer in the wishlist
Espresso.onView(ViewMatchers.withId(R.id.wishlist_item)).check(ViewAssertions.doesNotExist());
To integrate automated tests into your CI/CD pipeline, you can use tools like GitHub Actions or JUnit XML. For example, you can use the following GitHub Actions workflow to run your automated tests:
name: Android Tests
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build and run tests
run: |
./gradlew build
./gradlew test
You can also use the SUSA CLI tool to run your automated tests. Here is an example of how to use the SUSA CLI tool to run your automated tests:
pip install susatest-agent
susatest-agent run --app-path /path/to/your/app --test-path /path/to/your/tests
How SUSA Tests Wishlists Autonomously
SUSA tests wishlists autonomously using its 10 user personas, including:
- Curious: Tries to add and remove items from the wishlist to ensure the feature works correctly.
- Impatient: Tries to add and remove items from the wishlist quickly to ensure the feature responds correctly to rapid user input.
- Elderly: Uses the screen reader to ensure the wishlist feature is accessible to users with visual impairments.
- Adversarial: Tries to add and remove items from the wishlist with invalid input to ensure the feature handles errors correctly.
- Novice: Uses the wishlist feature for the first time to ensure it is intuitive and easy to use.
- Student: Uses the wishlist feature to research and compare items to ensure it provides useful information.
- Teenager: Uses the wishlist feature to share items with friends to ensure it integrates correctly with social media.
- Business: Uses the wishlist feature to track inventory and sales to ensure it provides useful analytics.
- Accessibility: Uses the wishlist feature with assistive technologies to ensure it is accessible to users with disabilities.
- Power user: Uses the wishlist feature extensively to ensure it scales correctly and performs well under heavy usage.
SUSA's autonomous testing can catch issues such as:
- Items not being added or removed correctly from the wishlist
- Wishlist not being synced across devices
- Errors when trying to purchase items from the wishlist
- Accessibility issues with the wishlist feature
- Security vulnerabilities in the wishlist feature
SUSA's testing also provides coverage analytics, including per-screen element coverage and untapped element lists, to help you identify areas of your app that need more testing.
Test Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free