ThisThis repository contains an automated testing project for the Magento website hosted on https://magento.softwaretestingboard.com/. The project uses the Selenium WebDriver framework, the Maven build automation tool, and the ExtentReports library to perform automated tests on the website.
To get started with this project, you will need to clone this repository to your local machine:
git clone https://github.com/your-username/selenium-maven-magento-testing.git
Once you have cloned the repository, you can navigate to the project directory and run the tests using Maven:
cd selenium-maven-magento-testing
mvn test
The tests will run in your default browser and generate a report with the test results in HTML format. You can find the report in the test-output directory.
The project is organized into several directories:
src/test/java: contains all the directories having classes that implement the automated tests using the Page Object Model
src/test/java/MyPageObjects: contains all the page element objects used while automating test cases
src/test/java/extentReportBasic: contains the DemoExtentReport.java class that implements all the testcases and generates report generated by ExtentReports
The pom.xml file at the root of the project defines the project dependencies and build configuration for Maven, including the ExtentReports dependency.
This project uses the ExtentReports library to generate HTML reports of the test results. The reports include detailed information about the test cases, including screenshots and error messages.
This project uses the Page Object Model (POM) to organize the code and make it easier to maintain. Each web page in the Magento website is represented by a separate Java class, which contains the web elements and methods for interacting with the page.
For example, here is a sample LoginPage class that represents the login page in the Magento website:
public class LoginPage {
WebDriver ldriver;
public LoginPage(WebDriver rdriver) {
ldriver = rdriver;
PageFactory.initElements(rdriver, this);
}
@FindBy(id = "email")
WebElement emailInput;
@FindBy(id = "pass")
WebElement passInput;
@FindBy(id = "send2")
WebElement signInBtn;
public void setEmailId(String email) {
emailInput.sendKeys(email);
}
public void setPassword(String pass) {
passInput.sendKeys(pass);
}
public void clickSubmit() {
signInBtn.click();
}
}
This project includes the following test cases:
- Create account
- Sign out
- Sign in
- Add to cart
- Place order
- Check orders
- Add to wishlist
Each test case is implemented in DemoExtentReport.java class in the src/test/java/extentReportBasic directory, using the Page Object Model to interact with the web pages.
If you would like to contribute to this project, please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.