mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Merge pull request #308 from LD-Reborn/test/chromiumtest
Test/chromiumtest
This commit is contained in:
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user