Merge pull request #308 from LD-Reborn/test/chromiumtest

Test/chromiumtest
This commit is contained in:
LD50
2025-11-16 16:53:09 +01:00
committed by GitHub
3 changed files with 8 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ name: E2E Tests
on: on:
push: push:
branches: [ "main" ] branches: [ "main", "test/**" ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -22,7 +22,6 @@ jobs:
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y chromium-browser chromium-chromedriver sudo apt-get install -y chromium-browser chromium-chromedriver
sudo ln -s /usr/bin/chromium-browser /usr/bin/google-chrome
# Verify the installation # Verify the installation
- name: Verify Chromium and ChromeDriver - name: Verify Chromium and ChromeDriver

View File

@@ -56,6 +56,10 @@ public static class AppHelper
options.AddArgument("--no-sandbox"); options.AddArgument("--no-sandbox");
options.AddArgument("--disable-dev-shm-usage"); options.AddArgument("--disable-dev-shm-usage");
options.AddArgument("--window-size=1920,1080"); options.AddArgument("--window-size=1920,1080");
if (File.Exists("/usr/bin/chromium-browser"))
{
options.BinaryLocation = "/usr/bin/chromium-browser";
}
return new ChromeDriver(options); return new ChromeDriver(options);
} }

View File

@@ -18,8 +18,9 @@ public static class AssetsHelper
driver.FindElement(By.Id("createName")).SendKeys(AppHelper.GetRandomName()); driver.FindElement(By.Id("createName")).SendKeys(AppHelper.GetRandomName());
AppHelper.AwaitVisible(driver, By.Id("createLocationSelect-ts-control")); AppHelper.AwaitVisible(driver, By.Id("createLocationSelect-ts-control"));
driver.FindElement(By.Id("createLocationSelect-ts-control")).Click(); driver.FindElement(By.Id("createLocationSelect-ts-control")).Click();
AppHelper.Timeout(driver, 30).Until(ExpectedConditions.ElementExists(By.Id("createLocationSelect-opt-1"))); Thread.Sleep(1000); //AppHelper.Timeout(driver, 30).Until(ExpectedConditions.ElementExists(By.Id("createLocationSelect-opt-1")));
driver.ExecuteJavaScript("document.getElementById(\"createLocationSelect-ts-control\").value=\"somewhere\""); 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.ExecuteJavaScript("document.getElementById(\"createLocationSelect-opt-1\").click()");
driver.FindElement(By.Id("createUsersSelect-ts-control")).Click(); driver.FindElement(By.Id("createUsersSelect-ts-control")).Click();
AppHelper.AwaitVisible(driver, By.Id("createUsersSelect-opt-1")); AppHelper.AwaitVisible(driver, By.Id("createUsersSelect-opt-1"));