diff --git a/.github/workflows/e2eTests.yml b/.github/workflows/e2eTests.yml index 7fee9588794..9d8ee1e8a43 100644 --- a/.github/workflows/e2eTests.yml +++ b/.github/workflows/e2eTests.yml @@ -27,7 +27,7 @@ jobs: maven-version: 3.9.5 - name: Run tests continue-on-error: true - run: mvn -e test "-DsetThreadCount=1" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=local" "-DtargetOperatingSystem=MAC" "-DtargetBrowserName=SAFARI" "-DgenerateAllureReportArchive=true" "-Dtest=${GLOBAL_TESTING_SCOPE}" + run: mvn -e test "-DsetThreadCount=1" "-DretryMaximumNumberOfAttempts=3" "-DexecutionAddress=local" "-DtargetOperatingSystem=MAC" "-DtargetBrowserName=SAFARI" "-DgenerateAllureReportArchive=true" "-Dtest=${GLOBAL_TESTING_SCOPE}" - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: @@ -371,7 +371,7 @@ jobs: maven-version: 3.9.5 - name: Run tests continue-on-error: true - run: mvn -e test "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=ANDROID" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.platformVersion=13.0" "-DbrowserStack.deviceName=Google Pixel 7" "-DbrowserStack.appName=ApiDemos-debug.apk" "-DbrowserStack.appRelativeFilePath=src/test/resources/testDataFiles/apps/ApiDemos-debug.apk" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*ndroidBasic.*]" + run: mvn -e test "-DretryMaximumNumberOfAttempts=3" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=ANDROID" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.platformVersion=13.0" "-DbrowserStack.deviceName=Google Pixel 7" "-DbrowserStack.appName=ApiDemos-debug.apk" "-DbrowserStack.appRelativeFilePath=src/test/resources/testDataFiles/apps/ApiDemos-debug.apk" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*ndroidBasic.*]" - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/src/test/java/testPackage/BasicAuthenticationTests.java b/src/test/java/testPackage/BasicAuthenticationTests.java index 9b2bc2d7695..2256688e610 100644 --- a/src/test/java/testPackage/BasicAuthenticationTests.java +++ b/src/test/java/testPackage/BasicAuthenticationTests.java @@ -10,6 +10,7 @@ import org.openqa.selenium.devtools.DevTools; import org.openqa.selenium.devtools.HasDevTools; import org.openqa.selenium.remote.Augmenter; +import org.openqa.selenium.remote.Browser; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; @@ -24,14 +25,20 @@ public class BasicAuthenticationTests { @Test public void basicAuthentication_traditional(){ - driver.get().browser().navigateToURL("https://user:pass@authenticationtest.com/HTTPAuth/", "https://authenticationtest.com/loginSuccess/"); - driver.get().assertThat().element(By.tagName("h1")).text().equals("Login Success"); + if (SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.CHROME.browserName()) + || SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.EDGE.browserName())) { + driver.get().browser().navigateToURL("https://user:pass@authenticationtest.com/HTTPAuth/", "https://authenticationtest.com/loginSuccess/"); + driver.get().assertThat().element(By.tagName("h1")).text().equals("Login Success"); + } } @Test public void basicAuthentication_webdriverBiDi() { - driver.get().browser().navigateToURLWithBasicAuthentication("https://authenticationtest.com/HTTPAuth/", "user", "pass", "https://authenticationtest.com/loginSuccess/"); - driver.get().assertThat().element(By.tagName("h1")).text().equals("Login Success"); + if (SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.CHROME.browserName()) + || SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.EDGE.browserName())) { + driver.get().browser().navigateToURLWithBasicAuthentication("https://authenticationtest.com/HTTPAuth/", "user", "pass", "https://authenticationtest.com/loginSuccess/"); + driver.get().assertThat().element(By.tagName("h1")).text().equals("Login Success"); + } } //@Test @@ -69,11 +76,17 @@ public void testBasicAuth() throws MalformedURLException { @BeforeMethod public void beforeMethod(){ - driver.set(new SHAFT.GUI.WebDriver()); + if (SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.CHROME.browserName()) + || SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.EDGE.browserName())) { + driver.set(new SHAFT.GUI.WebDriver()); + } } @AfterMethod(alwaysRun = true) public void afterMethod(){ - driver.get().quit(); + if (SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.CHROME.browserName()) + || SHAFT.Properties.web.targetBrowserName().equalsIgnoreCase(Browser.EDGE.browserName())) { + driver.get().quit(); + } } } diff --git a/src/test/java/testPackage/mockedTests/MultipleBrowserInstancesTest.java b/src/test/java/testPackage/mockedTests/MultipleBrowserInstancesTest.java index 0f49f0c5ffd..c6b4350456f 100644 --- a/src/test/java/testPackage/mockedTests/MultipleBrowserInstancesTest.java +++ b/src/test/java/testPackage/mockedTests/MultipleBrowserInstancesTest.java @@ -12,7 +12,7 @@ public class MultipleBrowserInstancesTest { String testElement = "data:text/html,

"; By locator = SHAFT.GUI.Locator.hasTagName("input").build(); - @Test + @Test(enabled = false) public void multipleInstancesSwitching() { drivers.add(new SHAFT.GUI.WebDriver()); drivers.get(0).browser().navigateToURL(testElement)