Automated test suite for an online bookstore using Selenium WebDriver and TestNG in Java.
This repository contains an automated test suite for a sample online bookstore application. The tests are written using Selenium WebDriver and TestNG in Java. The suite covers the following functionalities of the bookstore:
The tests target the following website:Legenda Bookstore.
Java
Maven
TestNG
Selenium WebDriver
QA-online-book-store
├── drivers
│ └── chromedrivers.exe
├── src
│ └── test
│ └── java
│ └── test
│ ├── scenarios
│ │ ├── ViewListOfBooksTest.java
│ │ ├── ViewBookDetailsTest.java
│ │ ├── AddBookToCartTest.java
│ │ ├── ViewCartTest.java
│ │ └── ProceedToCheckoutTest.java
│ ├── actions
│ │ ├── ViewListOfBooks.java
│ │ ├── ViewBookDetails.java
│ │ ├── AddBookToCart.java
│ │ ├── ViewCart.java
│ │ └── ProceedToCheckout.java
│ ├── utils
│ └── └── WebDriverManager
└── pom.xml
The test suite includes the following scenarios:
To set up and run the tests, follow these steps:
Clone the repository:
git clone https://github.com/C6-Aseelyaser/QA-online-book-store.git
cd QA-online-book-store
Install Maven: Ensure you have Maven installed on your system. If not, download and install it from Maven's official website.
Install ChromeDriver: Download and install ChromeDriver from ChromeDriver's official website. Ensure the ChromeDriver executable is in your system's PATH.
Update the WebDriver path: If necessary, update the path to the ChromeDriver executable in the test setup code:
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
Set up WebDriverManager (if used):
WebDriverManager.chromedriver().setup();
Navigate to the project directory:
cd QA-online-book-store
Run the tests:
Ctrl+Shift+F10
(or the equivalent shortcut in your IDE) to run the test.The project has the following dependencies:
All dependencies are specified in the pom.xml
file and will be downloaded automatically by Maven.
<dependencies>
<!-- Selenium Java Dependency -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.22.0</version>
</dependency>
<!-- TestNG Dependency -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.9.0</version>
<scope>test</scope>
</dependency>
<!-- WebDriverManager Dependency -->
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.9.2</version>
</dependency>
</dependencies>
Watch the demo below to see how the automated tests work: