This project consists of two parts: Part One focuses on API automation testing for the Marvel Comics API, while Part Two emphasizes UI automation testing for the Marvel website. The goal is to ensure the quality and reliability of the Marvel API and its user interface.
Create a test case for the /characters
endpoint of the Marvel API that ensures every character record has all the required JSON properties:
{
"id": ...,
"name": ...,
"description": ...,
"modified": ...,
"resourceURI": ...,
"thumbnail": ...,
"comics": ...,
"stories": ...,
"events": ...,
"urls": ...
}
The testing framework iterates through all paginated results to validate the presence of these properties.
To run the API tests, you will need the following dependencies:
- RestAssured for API calls.
- JUnit for assertions.
Add the following to your pom.xml
:
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>5.4.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>7.3.2</version>
<scope>test</scope>
</dependency>
Store sensitive information such as your API key in a configuration.properties
file. Ensure this file is not shared publicly on GitHub.
Perform UI automation testing on the Marvel website to verify the following:
- Navigate to the Search page.
- Search for “Avengers” in the “COMICS” section.
- Verify that the number of results is 3583.
- Verify that the number of pages is 180.
To run the UI tests, you will need:
- Selenium for browser automation.
Add Selenium to your pom.xml
:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.22.0</version>
</dependency>
- Clone this repository.
- Navigate to the project directory.
- Ensure you have Maven installed on your machine.
- Run the following command to build and execute your tests:
mvn test
- For failed test cases, use:
mvn -Dtest=FailedRunner test
This testing framework aims to provide ongoing confidence in the quality of both the Marvel API and its user interface, ensuring that critical functionality remains intact as changes are made.
Current Date: Wednesday, January 15, 2025, 1 PM +03
Citations: [1] https://github.com/bitmakerlabs/react-marvel-api [2] https://www.raymondcamden.com/2018/11/04/using-azure-functions-and-the-marvel-api-to-visualize-character-history [3] https://github.com/michaelfsilva/marvel-api [4] https://developer.marvel.com/docs [5] https://www.postman.com/alex-postman-workspace/marvel-api-workspace/documentation/989e351/marvel-api [6] https://developer.marvel.com [7] https://www.postman.com/alex-postman-workspace/marvel-api-workspace/overview