diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f36be2..865f4e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: E2E Tests on: push: - branches: [ "main" ] + branches: [ "main", "test/**" ] workflow_dispatch: jobs: @@ -22,7 +22,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y chromium-browser chromium-chromedriver - sudo ln -s /usr/bin/chromium-browser /usr/bin/google-chrome # Verify the installation - name: Verify Chromium and ChromeDriver diff --git a/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs b/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs index a23068d..a27550e 100644 --- a/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs +++ b/tests/Berufsschule_HAM.E2ETests/Helper/AppHelper.cs @@ -56,6 +56,10 @@ public static class AppHelper options.AddArgument("--no-sandbox"); options.AddArgument("--disable-dev-shm-usage"); options.AddArgument("--window-size=1920,1080"); + if (File.Exists("/usr/bin/chromium-browser")) + { + options.BinaryLocation = "/usr/bin/chromium-browser"; + } return new ChromeDriver(options); } diff --git a/tests/Berufsschule_HAM.E2ETests/Helper/AssetsHelper.cs b/tests/Berufsschule_HAM.E2ETests/Helper/AssetsHelper.cs index 9062b26..c488b92 100644 --- a/tests/Berufsschule_HAM.E2ETests/Helper/AssetsHelper.cs +++ b/tests/Berufsschule_HAM.E2ETests/Helper/AssetsHelper.cs @@ -18,8 +18,9 @@ public static class AssetsHelper driver.FindElement(By.Id("createName")).SendKeys(AppHelper.GetRandomName()); AppHelper.AwaitVisible(driver, By.Id("createLocationSelect-ts-control")); driver.FindElement(By.Id("createLocationSelect-ts-control")).Click(); - AppHelper.Timeout(driver, 30).Until(ExpectedConditions.ElementExists(By.Id("createLocationSelect-opt-1"))); - driver.ExecuteJavaScript("document.getElementById(\"createLocationSelect-ts-control\").value=\"somewhere\""); + Thread.Sleep(1000); //AppHelper.Timeout(driver, 30).Until(ExpectedConditions.ElementExists(By.Id("createLocationSelect-opt-1"))); + AppHelper.ScrollIntoViewAndClick(driver, driver.FindElement(By.Id("createLocationSelect-opt-1"))); + //driver.ExecuteJavaScript("document.getElementById(\"createLocationSelect-ts-control\").value=\"somewhere\""); driver.ExecuteJavaScript("document.getElementById(\"createLocationSelect-opt-1\").click()"); driver.FindElement(By.Id("createUsersSelect-ts-control")).Click(); AppHelper.AwaitVisible(driver, By.Id("createUsersSelect-opt-1"));