Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 22 additions & 45 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,29 @@
<artifactId>selenium-java</artifactId>
<version>4.1.4</version>
</dependency>
<!-- extent reports -->
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>

</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
7 changes: 7 additions & 0 deletions src/main/java/apps/automationpractice/AddToCartPage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package apps.automationpractice;

import base.CommonAPI;

public class AddToCartPage extends CommonAPI {

}
52 changes: 52 additions & 0 deletions src/main/java/apps/automationpractice/HomePage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package apps.automationpractice;

import base.CommonAPI;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class HomePage extends CommonAPI {

@FindBy(css = "input[id='search_query_top']")
WebElement searchInputField;

@FindBy(css = "button[name='submit_search']")
WebElement searchButton;

@FindBy(css = "a[class='blockbestsellers']")
WebElement bestSellersButton;

@FindBy(css = "img[src='http://automationpractice.com/modules/themeconfigurator/img/banner-img4.jpg']")
WebElement sunglassesAndEyewear;

@FindBy(css = "img[src='http://automationpractice.com/modules/themeconfigurator/img/banner-img7.jpg']")
WebElement summerCollection;

@FindBy(css = "//div[@class='popup-link prestashop-link primary-link secondary-os-font-bold']/a[@href='https://www.prestashop.com/en/download']")
WebElement prestaShopDownloadButton;

public HomePage(WebDriver driver){
PageFactory.initElements(driver, this);
}
public void SearchElement(String inputValue){
type(searchInputField, inputValue);
}
public void clickSearchButton(){
click(searchButton);
}
public void clickBestSellers(){
click(bestSellersButton);
}
public PrestaShopPage clickSunglassesAndEyewear(){
click(sunglassesAndEyewear);
return new PrestaShopPage();
}

public void summerCollection() {
click(summerCollection);
}
public void prestaShopDownloadButton(){
click(prestaShopDownloadButton);
}
}
11 changes: 11 additions & 0 deletions src/main/java/apps/automationpractice/PrestaShopPage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package apps.automationpractice;

import base.CommonAPI;
import org.openqa.selenium.support.PageFactory;

public class PrestaShopPage extends CommonAPI {

public PrestaShopPage(){
PageFactory.initElements(driver, this);
}
}
Loading