diff --git a/e2e/pom.xml b/e2e/pom.xml new file mode 100644 index 00000000..823284d2 --- /dev/null +++ b/e2e/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + org.example + Salinaka Ecommerce + 1.0-SNAPSHOT + + + 21 + 21 + UTF-8 + + + + + + org.seleniumhq.selenium + selenium-java + 4.22.0 + + + + + org.testng + testng + 7.10.2 + + + + + commons-io + commons-io + 2.16.1 + + + + + + + \ No newline at end of file diff --git a/e2e/src/main/java/org/example/HomePageNavigationBar.java b/e2e/src/main/java/org/example/HomePageNavigationBar.java new file mode 100644 index 00000000..0a8e38c0 --- /dev/null +++ b/e2e/src/main/java/org/example/HomePageNavigationBar.java @@ -0,0 +1,81 @@ +package org.example; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.chrome.ChromeDriver; +import org.testng.annotations.Test; + +import java.time.Duration; + +public class HomePageNavigationBar { + +@Test + public void validate_LogoButton() throws InterruptedException { + WebDriver driver = new ChromeDriver(); + driver.manage().window().maximize(); + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); + driver.get("https://salinaka-ecommerce.web.app/"); + + WebElement headerLogoButton = driver.findElement(By.cssSelector(".navigation .logo")); + headerLogoButton.click(); +} + +@Test + public void validate_HomeButton(){ + + WebDriver driver = new ChromeDriver(); + driver.manage().window().maximize(); + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); + driver.get("https://salinaka-ecommerce.web.app/"); + + WebElement homeButton = driver.findElement(By.cssSelector(".navigation-menu-active")); + homeButton.click(); + +} + +@Test + public void validate_ShopButton(){ + WebDriver driver = new ChromeDriver(); + driver.manage().window().maximize(); + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); + driver.navigate().to("https://salinaka-ecommerce.web.app/"); + + WebElement shopButton = driver.findElement(By.xpath("//li/a[@href='/shop']")); + shopButton.click(); +} + +@Test + public void validate_FeaturedButton(){ + + WebDriver driver = new ChromeDriver(); + driver.manage().window().maximize(); + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); + driver.navigate().to("https://salinaka-ecommerce.web.app/"); + + WebElement featuredButton = driver.findElement(By.xpath("//li/a[@href='/featured']")); + featuredButton.click(); + +} + +@Test + public void validate_RecommendedButton(){ + WebDriver driver = new ChromeDriver(); + driver.manage().window().maximize(); + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); + driver.navigate().to("https://salinaka-ecommerce.web.app/"); + + WebElement recommendedButton = driver.findElement(By.xpath("//li/a[@href='/recommended']")); + recommendedButton.click(); + + +} + +//app.launch(apkPath).login() +// appInst.enterText("cssSelect","password1234") +// appInst.tap(".login-button"); + // IDEAL STRUCTURE + + + +} \ No newline at end of file diff --git a/e2e/target/classes/org/example/HomePageNavigationBar.class b/e2e/target/classes/org/example/HomePageNavigationBar.class new file mode 100644 index 00000000..4bdfb838 Binary files /dev/null and b/e2e/target/classes/org/example/HomePageNavigationBar.class differ