diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3971a6b..0f91b5d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -20,17 +20,17 @@ jobs: steps: - name: checkout Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Java and Maven - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'adopt' cache: maven - name: Setup Juice Shop using docker compose - run: docker-compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml up -d + run: docker compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml up -d - name: Start Selenium Grid 4 run: docker compose -f ${{ github.workspace }}/docker-compose-v3-seleniumgrid.yml up --scale chrome=4 -d @@ -52,10 +52,10 @@ jobs: mvn org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test -Dheadless=true -DLT_USERNAME=$LMT_USER -DLT_ACCESS_KEY=$LMT_ACCESS - name: Stop docker compose for Juice Shop and Selenium grid - run: docker-compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml down --remove-orphans + run: docker compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml down --remove-orphans - name: Upload target folder - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: target path: | @@ -71,19 +71,19 @@ jobs: steps: - name: checkout Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Install Java and Maven - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'adopt' cache: maven - name: Setup Juice Shop using docker compose - run: docker-compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml up -d + run: docker compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml up -d - name: Start Selenium Grid 4 run: docker compose -f ${{ github.workspace }}/docker-compose-v3-seleniumgrid.yml up --scale chrome=4 -d @@ -95,21 +95,21 @@ jobs: uses: browser-actions/setup-firefox@latest - name: Cache SonarCloud packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - name: Download target folder - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: target @@ -125,7 +125,7 @@ jobs: -Dsonar.projectKey=$SONAR_KEY -Dheadless=true -DLT_USERNAME=$LMT_USER -DLT_ACCESS_KEY=$LMT_ACCESS - name: Stop docker compose for Juice Shop and Selenium grid - run: docker-compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml down --remove-orphans + run: docker compose -f ${{ github.workspace }}/docker-compose-v3-juiceshop.yml down --remove-orphans - name: Test Report uses: dorny/test-reporter@v1 diff --git a/.gitignore b/.gitignore index c669c35..36be1de 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ /test-output/ /logs/ /reports/ +/screenshots # Mac OSX .DS_Store diff --git a/pom.xml b/pom.xml index 961c8bf..7377978 100644 --- a/pom.xml +++ b/pom.xml @@ -13,19 +13,20 @@ UTF-8 - 4.21.0 + 4.24.0 7.10.2 - 5.8.0 + 5.9.2 2.16.1 2.23.1 2.23.1 20240303 - 4.21.0 - 1.18.32 - 2.2.2 + 4.23.1 + 1.18.34 + 2.3.1 + 1.5.4 3.5.0 3.13.0 - 3.2.5 + 3.5.0 17 UTF-8 test-suite/testng.xml @@ -109,6 +110,13 @@ ${lombok.version} provided + + + ru.yandex.qatools.ashot + ashot + ${ashot.version} + + diff --git a/src/main/java/io/github/mfaisalkhatri/drivers/DriverManager.java b/src/main/java/io/github/mfaisalkhatri/drivers/DriverManager.java index 9f5ac72..a75b0d2 100644 --- a/src/main/java/io/github/mfaisalkhatri/drivers/DriverManager.java +++ b/src/main/java/io/github/mfaisalkhatri/drivers/DriverManager.java @@ -100,6 +100,7 @@ private static void setupChromeDriver () { chromePrefs.put ("download.prompt_for_download", "false"); chromePrefs.put ("download.default_directory", String.valueOf (Paths.get (System.getProperty ("user.home"), "Downloads"))); + chromePrefs.put("profile.password_manager_leak_detection", false); final var options = new ChromeOptions (); options.addArguments (NO_SANDBOX); diff --git a/src/test/java/io/github/mfaisalkhatri/pages/saucedemo/MainPage.java b/src/test/java/io/github/mfaisalkhatri/pages/saucedemo/MainPage.java index 34ea421..f7ebb34 100644 --- a/src/test/java/io/github/mfaisalkhatri/pages/saucedemo/MainPage.java +++ b/src/test/java/io/github/mfaisalkhatri/pages/saucedemo/MainPage.java @@ -41,7 +41,7 @@ public void logoutFromWebSite () { } private WebElement logoutLink () { - return this.wait.until (ExpectedConditions.elementToBeClickable ((By.cssSelector ("#logout_sidebar_link")))); + return this.wait.until (ExpectedConditions.elementToBeClickable ((By.id ("logout_sidebar_link")))); } private WebElement menuBtn () { diff --git a/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/FullPageScreenshotTest.java b/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/FullPageScreenshotTest.java new file mode 100644 index 0000000..b91d019 --- /dev/null +++ b/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/FullPageScreenshotTest.java @@ -0,0 +1,82 @@ +package io.github.mfaisalkhatri.tests.screenshottests; + +import org.apache.commons.io.FileUtils; +import org.openqa.selenium.*; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.interactions.Actions; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterTest; +import org.testng.annotations.Test; +import ru.yandex.qatools.ashot.AShot; +import ru.yandex.qatools.ashot.Screenshot; +import ru.yandex.qatools.ashot.shooting.ShootingStrategies; + +import javax.imageio.ImageIO; +import java.io.File; +import java.io.IOException; +import java.time.Duration; + +public class FullPageScreenshotTest { + + WebDriver driver; + + @Test + public void testTakeFullPageScreenshotFirefox() { + + driver = new FirefoxDriver(); + + + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)); + driver.manage().window().maximize(); + + driver.get("https://ecommerce-playground.lambdatest.io/"); + + JavascriptExecutor js = (JavascriptExecutor) driver; + Actions actions = new Actions(driver); + + WebElement topTrendingItemList = driver.findElement(By.className("swiper-wrapper")); + js.executeScript("arguments[0].scrollIntoView(true);", topTrendingItemList); + actions.pause(2000).build().perform(); + + WebElement topProducts = driver.findElement(By.cssSelector("#entry_217978 > h3")); + js.executeScript("arguments[0].scrollIntoView(true);",topProducts); + actions.pause(2000).build().perform(); + + WebElement bottom = driver.findElement(By.className("article-thumb")); + js.executeScript("arguments[0].scrollIntoView(true);", bottom); + actions.pause(2000).build().perform(); + + File src = ((FirefoxDriver) driver).getFullPageScreenshotAs(OutputType.FILE); + try { + FileUtils.copyFile(src, new File("./screenshots/fulpagescreenshot.png")); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Test + public void testTakeScreenshotUsingAShot() throws IOException { + driver = new ChromeDriver(); + + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)); + + driver.get("https://ecommerce-playground.lambdatest.io/"); + + Object devicePixelRatio = ((JavascriptExecutor)driver).executeScript("return window.devicePixelRatio"); + float windowDPR = Float.parseFloat(devicePixelRatio.toString()); + + Screenshot screenshot = new AShot() + .shootingStrategy(ShootingStrategies.viewportPasting(ShootingStrategies.scaling(windowDPR),1000)) + .takeScreenshot(driver); + + ImageIO.write(screenshot.getImage(), "png", new File("./screenshots/AshotFullPageScreen.png")); + + } + + @AfterMethod + public void tearDown() { + driver.quit(); + } + +} diff --git a/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/ScreenshotWithSeleniumTest.java b/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/ScreenshotWithSeleniumTest.java new file mode 100644 index 0000000..289847c --- /dev/null +++ b/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/ScreenshotWithSeleniumTest.java @@ -0,0 +1,63 @@ +package io.github.mfaisalkhatri.tests.screenshottests; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.bidi.browsingcontext.BrowsingContext; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.remote.RemoteWebElement; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Base64; + +public class ScreenshotWithSeleniumTest { + private WebDriver driver; + + @BeforeTest + public void setup() { + ChromeOptions options = new ChromeOptions(); + options.setCapability("webSocketUrl", true); + driver = new ChromeDriver(options); + } + + @Test + public void testTakeScreenshot() throws IOException { + BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle()); + + driver.get("https://ecommerce-playground.lambdatest.io/"); + + String screenshot = browsingContext.captureScreenshot(); + byte[] imgByteArray = Base64.getDecoder().decode(screenshot); + FileOutputStream imgOutFile = new FileOutputStream("./screenshots/screenshot_homepage.png"); + imgOutFile.write(imgByteArray); + imgOutFile.close(); + + } + + @Test + public void testTakeElementScreenshot() throws IOException { + BrowsingContext browsingContext = new BrowsingContext(driver,driver.getWindowHandle()); + driver.get("https://ecommerce-playground.lambdatest.io/index.php?route=account/register"); + + WebElement firstName = driver.findElement(By.id("input-firstname")); + String screenshot = browsingContext.captureElementScreenshot(((RemoteWebElement) firstName).getId()); + + byte[] imgByteArray = Base64.getDecoder().decode(screenshot); + FileOutputStream imgOutFile = new FileOutputStream("./screenshots/screenshot_webelement.png"); + imgOutFile.write(imgByteArray); + imgOutFile.close(); + + } + + + @AfterTest + public void tearDown() { + driver.quit(); + } +} \ No newline at end of file diff --git a/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/ViewableScreenshotExample.java b/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/ViewableScreenshotExample.java new file mode 100644 index 0000000..6a63d3d --- /dev/null +++ b/src/test/java/io/github/mfaisalkhatri/tests/screenshottests/ViewableScreenshotExample.java @@ -0,0 +1,55 @@ +package io.github.mfaisalkhatri.tests.screenshottests; + +import org.apache.commons.io.FileUtils; +import org.openqa.selenium.*; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.interactions.Actions; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.time.Duration; + +public class ViewableScreenshotExample { + + WebDriver driver; + + @BeforeTest + public void setup() { + + driver = new ChromeDriver(); + + driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30)); + driver.manage().window().maximize(); + } + + @Test + public void testTakeViewableScreenshot() { + + driver.get("https://ecommerce-playground.lambdatest.io/"); + + WebElement blogMenu = driver.findElement(By.cssSelector("div.entry-section div.entry-widget ul > li:nth-child(3) > a > div > span")); + blogMenu.click(); + + WebElement firstArticleImage = driver.findElement(By.className("article-thumb")); + Actions actions = new Actions(driver); + actions.scrollToElement(firstArticleImage).build().perform(); + + WebElement secondArticleImage = driver.findElement(By.cssSelector(".swiper-wrapper div[aria-label='2 / 10']")); + actions.scrollToElement(secondArticleImage).build().perform(); + + File src = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); + try { + FileUtils.copyFile(src, new File("./screenshots/blogpage.png")); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @AfterTest + public void tearDown() { + driver.quit(); + } +} \ No newline at end of file diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/BrowserTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/BrowserTests.java index 57b4d10..9c3693e 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/BrowserTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/BrowserTests.java @@ -28,7 +28,7 @@ */ public class BrowserTests extends BaseSuiteSetup { - private static final String websiteLink = "http://the-internet.herokuapp.com/"; + private static final String websiteLink = "https://the-internet.herokuapp.com/"; @Test public void browserNavigationTests () { diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/CheckboxTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/CheckboxTests.java index fa1925c..06a35af 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/CheckboxTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/CheckboxTests.java @@ -30,7 +30,7 @@ public class CheckboxTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Checkboxes"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DataTableTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DataTableTests.java index fd26482..14bd5f1 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DataTableTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DataTableTests.java @@ -13,7 +13,7 @@ public class DataTableTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Sortable Data Tables"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DigestAuthTest.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DigestAuthTest.java index e237fa3..0d79394 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DigestAuthTest.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DigestAuthTest.java @@ -13,7 +13,7 @@ public class DigestAuthTest extends BaseSuiteSetup { @BeforeClass public void testSetup() { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Basic Auth"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DragAndDropTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DragAndDropTests.java index 5994d37..cab3230 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DragAndDropTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DragAndDropTests.java @@ -33,7 +33,7 @@ public class DragAndDropTests extends BaseSuiteSetup { @BeforeClass public void setupTests () { - final String website = "http://the-internet.herokuapp.com/"; + final String website = "https://the-internet.herokuapp.com/"; getDriver().get(website); final MainPage mainPage = new MainPage(); mainPage.clickLink("Drag and Drop"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DropdownTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DropdownTests.java index 9383aea..65b3b67 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DropdownTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/DropdownTests.java @@ -32,7 +32,7 @@ public class DropdownTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Dropdown"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FileUploadDownloadTest.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FileUploadDownloadTest.java index f74ce5d..1dcc282 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FileUploadDownloadTest.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FileUploadDownloadTest.java @@ -18,7 +18,7 @@ public class FileUploadDownloadTest extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); this.mainPage = new MainPage(); } diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FormAuthenticationTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FormAuthenticationTests.java index 762d604..6413e7c 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FormAuthenticationTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/FormAuthenticationTests.java @@ -14,22 +14,23 @@ */ package io.github.mfaisalkhatri.tests.theinternet; -import static io.github.mfaisalkhatri.drivers.DriverManager.getDriver; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - import io.github.mfaisalkhatri.pages.theinternet.FormAuthenticationPage; import io.github.mfaisalkhatri.pages.theinternet.MainPage; import io.github.mfaisalkhatri.pages.theinternet.SecurePage; import io.github.mfaisalkhatri.tests.base.BaseSuiteSetup; +import org.openqa.selenium.By; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import static io.github.mfaisalkhatri.drivers.DriverManager.getDriver; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + /** * Created By Faisal Khatri on 24-12-2021 */ @@ -42,7 +43,7 @@ public class FormAuthenticationTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver ().get (websiteLink); final MainPage mainPage = new MainPage (); mainPage.clickLink ("Form Authentication"); @@ -100,12 +101,14 @@ public void loginTests (final String userName, final String password, final bool public void loginWithCorrectCredentials () { this.securePage = this.formAuthenticationPage.login (USERNAME, PASSWORD); assertTrue (this.securePage.getFlashMessage () - .contains ("You logged into a secure area!")); + .contains("You logged into a secure area!")); assertEquals (this.securePage.getHeaderText (), "Secure Area"); assertEquals (this.securePage.getSubHeaderText (), "Welcome to the Secure Area. When you are done click logout below."); assertTrue (this.securePage.logoutBtn () .isDisplayed ()); + this.securePage.logoutBtn() + .click(); } @Test diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/HoverTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/HoverTests.java index 49cb012..7e4f642 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/HoverTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/HoverTests.java @@ -30,7 +30,7 @@ public class HoverTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Hovers"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/IFrameTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/IFrameTests.java index aff2af6..273eabd 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/IFrameTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/IFrameTests.java @@ -30,7 +30,7 @@ public class IFrameTests extends BaseSuiteSetup { @BeforeClass public void setupTests () { - final String website = "http://the-internet.herokuapp.com/"; + final String website = "https://the-internet.herokuapp.com/"; getDriver().get(website); final MainPage mainPage = new MainPage(); mainPage.clickLink("Frames"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/JSAlertTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/JSAlertTests.java index fda7b68..6354c0d 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/JSAlertTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/JSAlertTests.java @@ -32,7 +32,7 @@ public class JSAlertTests extends BaseSuiteSetup { @BeforeClass private void setupTest () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("JavaScript Alerts"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/KeyPressTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/KeyPressTests.java index 56ec483..22fd776 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/KeyPressTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/KeyPressTests.java @@ -33,7 +33,7 @@ public class KeyPressTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Key Presses"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/MultipleWindowTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/MultipleWindowTests.java index 61de7df..34bbcad 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/MultipleWindowTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/MultipleWindowTests.java @@ -18,7 +18,7 @@ public class MultipleWindowTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Multiple Windows"); diff --git a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/RightClickTests.java b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/RightClickTests.java index 061d73d..411b1c5 100644 --- a/src/test/java/io/github/mfaisalkhatri/tests/theinternet/RightClickTests.java +++ b/src/test/java/io/github/mfaisalkhatri/tests/theinternet/RightClickTests.java @@ -30,7 +30,7 @@ public class RightClickTests extends BaseSuiteSetup { @BeforeClass public void testSetup () { - final String websiteLink = "http://the-internet.herokuapp.com/"; + final String websiteLink = "https://the-internet.herokuapp.com/"; getDriver().get(websiteLink); final MainPage mainPage = new MainPage(); mainPage.clickLink("Context Menu"); diff --git a/test-suite/testng-screenshot-tests.xml b/test-suite/testng-screenshot-tests.xml new file mode 100644 index 0000000..378251e --- /dev/null +++ b/test-suite/testng-screenshot-tests.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file