This project aims to demonstrate my skills in Automation with Appium using Java as programming language. Therefore, it is for demonstration purposes. The MyDemoApp belongs to the author of Sauce Labs which is an American cloud-hosted, web and mobile application automated testing platform company.
It should be noted that not all the app functionalities were automated, the approach followed was to write test cases at a high level that offered the main functionalities of the application, in their case: add products to cart, buy products, login and drawing.
The test cases were translated into low level to detail step by step the execution of the test cases. These test cases are grouped by test scenarios, ID, positive/negative, the type of test case (functional) and whether it is automatable or not. Only functional test cases have been considered, therefore performance, usability and any non-functional test cases are out of scope.
The programming language, automation framework, and document object model have been chosen for maintainability purposes and will be described below. The execution of the test cases and the results are shown in later sections. Finally, Jenkins is integrated for continuous integration and continuous deployment.
ID | Test scenario | Test case | Positive / Negative | Type | Automatable |
---|---|---|---|---|---|
MDA-1 | Catalog | Buy a product | Yes | Functional | Yes |
MDA-2 | Remove an item | Yes | Functional | Yes | |
MDA-3 | Increase the cart | Yes | Functional | Yes | |
MDA-4 | Decrease the cart | Yes | Functional | Yes | |
MDA-5 | Add to cart many times | Yes | Functional | Yes | |
MDA-6 | Submit a review | Yes | Functional | Yes | |
MDA-7 | Sort products by | Yes | Functional | Yes | |
MDA-8 | Webview | Go to an external site within the app | Yes | Functional | Yes |
MDA-9 | Verify error message when providing an incorrect https url | No | Functional | Yes | |
MDA-10 | Drawing | Perform drawing action | Yes | Functional | Yes |
MDA-11 | Clear a drawing | No | Functional | Yes | |
MDA-12 | Save the drawing | Yes | Functional | Yes | |
MDA-13 | About | Verify the last build | Yes | Functional | Yes |
MDA-14 | Go to the sauce labs website external link | Yes | Functional | Yes | |
MDA-15 | Reset App State | Reset app state | Yes | Functional | Yes |
MDA-16 | Cancel the reset of the app state | Yes | Functional | Yes | |
MDA-17 | Login | Login with a valid account | Yes | Functional | Yes |
MDA-18 | Login with a locked out account | Yes | Functional | Yes | |
MDA-19 | Verify error message when username is not provided | No | Functional | Yes | |
MDA-20 | Verify error message when password is not provided | No | Functional | Yes | |
MDA-21 | Log out | Yes | Functional | Yes | |
MDA-22 | API calls | Verify list of devices in EU-DC | Yes | Functional | Yes |
MDA-23 | Verify list of devices in US-DC | Yes | Functional | Yes | |
MDA-24 | Verify list of devices in US-DC | Yes | Functional | Yes | |
MDA-25 | Verify 401 unauthorized error response | No | Functional | Yes | |
MDA-26 | Verify 404 not found error response | No | Functional | Yes |
ID | Test case | Test Data | Precondition | Steps | Expected Result |
---|---|---|---|---|---|
MDA-1 | Buy a product | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
1.01 | 1. Onesie 2. Backpack | Click on {Product} | User is redirected to the product page | ||
1.02 | 1. Black 2. Blue | Click on a {Color} | Color is chosen | ||
1.03 | 35 | Select {Quantity} as the number of products | Number of products has been chosen | ||
1.04 | Click on cart icon at the upper right | Cart page gets opened | |||
1.05 | Click on "Proceed to checkout" button | User is redirected to the checkout page | |||
1.06 | If neccesary, login | User is redirected to the checkout page | |||
1.07 | Full Name: Rebecca Winter Address Line 1: Mandorley 112 City: Truro State: Cornwall Zip Code: 89750 Country: United Kingdom | Fill the shipping details and click on "to payment" button | User is redirected to checkout page | ||
1.08 | Full Name: Rebecca Winter Card Number: 325812657568789 Expiration Date: 03/25 Security Code: 123 | Fill the checkout details and click on review order | User is redirected to the review page | ||
1.09 | Verify the name of the product, the color, the number of items and the total price | All the verifications get passed | |||
1.10 | Click on "Place Order" | User is redirected to the checkout complete page | |||
1.11 | Click on "Continue Shopping" button | Verify user is redirected to the catalog page | |||
MDA-2 | Remove an item | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
2.01 | 1. Bolt 2. Bike | Click on {Product} | User is redirected to the product page | ||
2.02 | 1. Black 2. Black | Click on a {Color} | Color is chosen | ||
2.03 | 24 | Select {Quantity} as the number of products | Number of products has been chosen | ||
2.04 | Click on cart icon at the upper right | Cart page gets opened | |||
2.05 | Click on "Remove Item" | User is redirected to the no items page | |||
MDA-3 | Increase the cart | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
3.01 | 1. allTheThings 2. Fleece | Click on {Product} | User is redirected to the product page | ||
3.02 | 1. Black 2. Black | Click on a {Color} | Color is chosen | ||
3.03 | 310 | Select {Quantity} as the number of products | Number of products has been chosen | ||
3.04 | Click on cart icon at the upper right | Cart page gets opened | |||
3.05 | Increase the number of items by {Quantity} for the product and verify the total price gets incremented | The total price gets incremented | |||
MDA-4 | Decrease the cart | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
4.01 | 1. allTheThings 2. Fleece | Click on {Product} | User is redirected to the product page | ||
4.02 | 1. Black 2. Black | Click on a {Color} | Color is chosen | ||
4.03 | 310 | Select {Quantity} as the number of products | Number of products has been chosen | ||
4.04 | Click on cart icon at the upper right | Cart page gets opened | |||
4.05 | Decrease the number of items by {Quantity} for the product and verify the total price gets incremented | The total price gets decreased | |||
MDA-5 | Add to cart many times | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
5.01 | 1. Sauce Labs Bolt T-Shirt2. Sauce Labs Bike Light | Click on {Product} | User is redirected to the product page | ||
5.02 | 23 | Select {Quantity} as the number of products | Number of products has been chosen | ||
5.03 | 33 | Click on Add To Cart {Times} number of times | The items are added to the cart | ||
5.04 | Click on cart icon at the upper right | Cart page gets opened | |||
5.05 | Increase or decrease the number of items in the product and check that the total price increases or decreases based on the total number of items multiplied by the individual item price | The total price is based on the total number of items multiplied by the price of each item | |||
MDA-6 | Submit a review | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
6.1 | 1. Sauce Labs Backpack2. Sauce Labs Bike Light3. Sauce Labs Bolt T-Shirt4. Sauce Labs Fleece Jacket5. Sauce Labs Onesie6. Test.allTheThings() T-Shirt | Click on {Product} | User is redirected to the product page | ||
6.2 | Click on Close Modal button | Close modal button gets closed | |||
6.3 | 2 stars3 stars4 stars5 stars2 stars4 stars | Click on {Star} below the image product in order to submit a review | Submitting modal gets opened | ||
MDA-7 | Sort products by | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
7.1 | Click on sorting icon at the top right | Sort by pop modal gets opened | |||
7.2 | 1. Name - Ascending 2. Name - Descending 3. Price - Ascending 4. Price - Descending | Click on sort by {Sorting} and verify the products get sorted by {Sorting} order | The products get sorted by selected order | ||
MDA-8 | Go to an external site within the app | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
8.1 | Click on hamburger icon at the top left | Menu gets opened | |||
8.2 | Click on "Webview" | User is redirected to the webview page | |||
8.3 | https://www.javimele.com | Enter {Domain} as the domain name | User is redirected to the website | ||
8.4 | Click on "Go to site" button | User is redirected to the webview page | |||
8.5 | Javier Melendez Zacarias | Scroll down in the website and verify the footer says {Footer} | User is redirected to the footer of the website | ||
MDA-9 | Verify error message when providing an incorrect https url | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
9.1 | Click on hamburger icon at the top left | Menu gets opened | |||
9.2 | Click on "Webview" | User is redirected to the webview page | |||
9.3 | Error | Enter {Domain} as the domain name | URL field gets filled | ||
9.4 | Green Blue |
Verify error message below the URL field | Error message says "Please provide a correct https url" | ||
9.5 | 1 20 |
Type {Test Data} as quantity | The desired quantity is selected | ||
9.6 | Click on cart icon and verity the subtotal | The subtotal is the multiplication of the quantity of items and the price of it | |||
MDA-10 | Perform drawing action | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
10.1 | Click on hamburger icon at the top left | Menu gets opened | |||
10.2 | Click on "Drawing" | User is redirected to the drawing page | |||
10.3 | Make a drawing | User made a drawing | |||
MDA-11 | Clear drawing | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
11.1 | Click on hamburger icon at the top left | Menu gets opened | |||
11.2 | Click on "Drawing" | User is redirected to the drawing page | |||
11.3 | Make a drawing | User made a drawing | |||
11.4 | Click on "Clear" | The drawing was cleaned | |||
MDA-12 | Save the drawing | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
12.1 | Click on hamburger icon at the top left | Menu gets opened | |||
12.2 | Click on "Drawing" | User is redirected to the drawing page | |||
12.3 | Make a drawing | User made a drawing | |||
12.4 | Click on "Save" | Save drawing modal gets opened | |||
12.5 | Click on "OK" on the recently opened modal | Modal gets closed | |||
12.6 | Verify the image got saved in the gallery | The image got saved in the gallery | |||
MDA-13 | Verify the last build | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
13.1 | Click on hamburger icon at the top left | Menu gets opened | |||
13.2 | Click on "About" | User is redirected to the about page | |||
13.3 | V.1.3.0-build 244 | Verify the last build is {Build} | The last build is as per test data | ||
MDA-14 | Go to the sauce labs website external link | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
14.1 | Click on hamburger icon at the top left | Menu gets opened | |||
14.2 | Click on "About" | User is redirected to the about page | |||
14.3 | Click on "Go to the Sauce Labs website." and verify the user is redirected to the Sauce Labs website | User is redirected to the Sauce Labs website | |||
MDA-15 | Reset app state | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
15.1 | Click on hamburger icon at the top left | Menu gets opened | |||
15.2 | Click on "Reset App State" | Modal gets opened | |||
15.3 | Click on "Reset App" option | App State modal gets opened | |||
15.4 | Click on "OK" button | App State modal gets closed | |||
MDA-16 | Cancel the reset of the app state | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
16.1 | Click on hamburger icon at the top left | Menu gets opened | |||
16.2 | Click on "Reset App State" | Modal gets opened | |||
16.3 | Click on "CANCEL" button | Modal gets closed | |||
MDA-17 | Login with a valid account | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
17.1 | Click on hamburger icon at the top left | Menu gets opened | |||
17.2 | Click on "Log In" | User is redirected to the login page | |||
17.3 | bob@example.com | Enter {Username} as username | Username field gets filled | ||
17.4 | 10203040 | Enter {Password} as password | Password gets filled | ||
17.5 | Click on "Login" button | User is redirected to the catalog page | |||
MDA-18 | Login with a locked out account | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
18.1 | Click on hamburger icon at the top left | Menu gets opened | |||
18.2 | Click on "Log In" | User is redirected to the login page | |||
18.3 | alice@example.com | Enter {Username} as username | Username field gets filled | ||
18.4 | 10203040 | Enter {Password} as password | Password gets filled | ||
18.5 | Click on "Login" button | Error message says "Sorry, this user has been locked out" | |||
MDA-19 | Verify error message when username is not provided | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
19.1 | Click on hamburger icon at the top left | Menu gets opened | |||
19.2 | Click on "Log In" | User is redirected to the login page | |||
19.4 | 10203040 | Enter {Password} as password | Password gets filled | ||
19.5 | Click on "Login" button | Error message below username says "Username is required" | |||
MDA-20 | Verify error message when password is not provided | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
20.1 | Click on hamburger icon at the top left | Menu gets opened | |||
20.2 | Click on "Log In" | User is redirected to the login page | |||
20.3 | bob@example.com | Enter {Username} as username | Username field gets filled | ||
20.4 | Click on "Login" button | Error message below password says "Password is required" | |||
MDA-21 | Log out | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
21.1 | Click on hamburger icon at the top left | Menu gets opened | |||
21.2 | Click on "Log Out" | Log Out modal gets opened | |||
21.3 | Click on "Log Out" in modal | Logged out modal gets opened | |||
MDA-22 | Verify list of devices in EU-DC | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
22.1 | Click on hamburger icon at the top left | Menu gets opened | |||
22.2 | Click on "Api Calls" | User is redirected to the Api Calls page | |||
22.3 | Click on "EU-DC" tab and verify the HTTP response is successful | HTTP response is successful | |||
MDA-23 | Verify list of devices in US-DC | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
23.1 | Click on hamburger icon at the top left | Menu gets opened | |||
23.2 | Click on "Api Calls" | User is redirected to the Api Calls page | |||
23.3 | Click on "US-DC" tab and verify the HTTP response is successful | HTTP response is successful | |||
MDA-24 | Verify 401 unauthorized error response | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
24.1 | Click on hamburger icon at the top left | Menu gets opened | |||
24.2 | Click on "Api Calls" | User is redirected to the Api Calls page | |||
24.3 | Click on "401" tab and verify the HTTP response is unauthorized | HTTP response is unathorized | |||
MDA-25 | Verify 404 not found error response | User should have accessed to MyDemoApp | Launch MyDemoApp | User is redirected to the catalog page | |
25.1 | Click on hamburger icon at the top left | Menu gets opened | |||
25.2 | Click on "Api Calls" | User is redirected to the Api Calls page | |||
25.3 | Click on "404" tab and verify the HTTP response is not found | HTTP response is not found |
Page Object Model, also known as POM, is a design pattern in Selenium that creates an object repository for storing all web elements. It helps reduce code duplication and improves test case maintenance. In Page Object Model, consider each web page of an application as a class file. Each class file will contain only corresponding web page elements. Using these elements, testers can perform operations on the website under test.
Java
Selenium
Eclipse
Page Object Model
Cucumber
Gerkhin
Behavior Driven Development