Testsuite PoC - Add support for browsers with and without headless (#31611)
Signed-off-by: stianst <stianst@gmail.com>
This commit is contained in:
parent
c92c642fec
commit
140e953d3f
6 changed files with 53 additions and 11 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -956,9 +956,9 @@ jobs:
|
|||
uses: ./.github/actions/integration-test-setup
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd test-poc
|
||||
mvn clean install
|
||||
env:
|
||||
KC_TEST_BROWSER: chrome-headless
|
||||
run: mvn clean install -f test-poc
|
||||
|
||||
check:
|
||||
name: Status Check - Keycloak CI
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package org.keycloak.test.framework.webdriver;
|
||||
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
|
||||
public class ChromeHeadlessWebDriverSupplier extends AbstractWebDriverSupplier {
|
||||
|
||||
@Override
|
||||
public String getAlias() {
|
||||
return "chrome-headless";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebDriver getWebDriver() {
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
setGlobalOptions(options);
|
||||
options.addArguments(
|
||||
"--headless",
|
||||
"--disable-gpu",
|
||||
"--window-size=1920,1200",
|
||||
"--ignore-certificate-errors",
|
||||
"--disable-dev-shm-usage"
|
||||
);
|
||||
return new ChromeDriver(options);
|
||||
}
|
||||
}
|
|
@ -15,13 +15,6 @@ public class ChromeWebDriverSupplier extends AbstractWebDriverSupplier {
|
|||
public WebDriver getWebDriver() {
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
setGlobalOptions(options);
|
||||
options.addArguments(
|
||||
"--headless",
|
||||
"--disable-gpu",
|
||||
"--window-size=1920,1200",
|
||||
"--ignore-certificate-errors",
|
||||
"--disable-dev-shm-usage"
|
||||
);
|
||||
return new ChromeDriver(options);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package org.keycloak.test.framework.webdriver;
|
||||
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||
import org.openqa.selenium.firefox.FirefoxOptions;
|
||||
|
||||
public class FirefoxHeadlessWebDriverSupplier extends AbstractWebDriverSupplier {
|
||||
|
||||
@Override
|
||||
public String getAlias() {
|
||||
return "firefox-headless";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebDriver getWebDriver() {
|
||||
FirefoxOptions options = new FirefoxOptions();
|
||||
setGlobalOptions(options);
|
||||
options.addArguments("-headless");
|
||||
return new FirefoxDriver(options);
|
||||
}
|
||||
}
|
|
@ -15,7 +15,6 @@ public class FirefoxWebDriverSupplier extends AbstractWebDriverSupplier {
|
|||
public WebDriver getWebDriver() {
|
||||
FirefoxOptions options = new FirefoxOptions();
|
||||
setGlobalOptions(options);
|
||||
options.addArguments("-headless");
|
||||
return new FirefoxDriver(options);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,9 @@ org.keycloak.test.framework.realm.UserSupplier
|
|||
org.keycloak.test.framework.server.EmbeddedKeycloakTestServerSupplier
|
||||
org.keycloak.test.framework.server.DistributionKeycloakTestServerSupplier
|
||||
org.keycloak.test.framework.server.RemoteKeycloakTestServerSupplier
|
||||
org.keycloak.test.framework.webdriver.ChromeHeadlessWebDriverSupplier
|
||||
org.keycloak.test.framework.webdriver.ChromeWebDriverSupplier
|
||||
org.keycloak.test.framework.webdriver.FirefoxHeadlessWebDriverSupplier
|
||||
org.keycloak.test.framework.webdriver.FirefoxWebDriverSupplier
|
||||
org.keycloak.test.framework.database.DevMemDatabaseSupplier
|
||||
org.keycloak.test.framework.database.DevFileDatabaseSupplier
|
||||
|
|
Loading…
Reference in a new issue