Fix CorsExampleAdapterTest

---
Quarkus3 branch sync no. 14 (24.4.2023)
Resolved conflicts:
keycloak/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java - Modified
This commit is contained in:
Martin Bartoš 2023-04-21 10:22:29 +02:00 committed by Václav Muzikář
parent e3e1df2dd6
commit c1cced9f31
4 changed files with 48 additions and 8 deletions

View file

@ -101,11 +101,10 @@ jobs:
uses: ./.github/actions/integration-test-setup uses: ./.github/actions/integration-test-setup
- name: Run base tests - name: Run base tests
# Temporarily use app-server-wildfly instead of Undertow
run: | run: |
TESTS=`testsuite/integration-arquillian/tests/base/testsuites/base-suite.sh ${{ matrix.group }}` TESTS=`testsuite/integration-arquillian/tests/base/testsuites/base-suite.sh ${{ matrix.group }}`
echo "Tests: $TESTS" echo "Tests: $TESTS"
./mvnw test -Dsurefire.rerunFailingTestsCount=${{ env.SUREFIRE_RERUN_FAILING_COUNT }} -nsu -B -Pauth-server-quarkus,app-server-wildfly -Dtest=$TESTS -pl testsuite/integration-arquillian/tests/base | misc/log/trimmer.sh ./mvnw test -Dsurefire.rerunFailingTestsCount=${{ env.SUREFIRE_RERUN_FAILING_COUNT }} -nsu -B -Pauth-server-quarkus "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" -Dtest=$TESTS -pl testsuite/integration-arquillian/tests/base | misc/log/trimmer.sh
- name: Upload JVM Heapdumps - name: Upload JVM Heapdumps
if: always() if: always()

View file

@ -0,0 +1,34 @@
/*
* Copyright 2023 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.keycloak.testsuite.util;
import org.jboss.arquillian.drone.api.annotation.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* @author <a href="mailto:mabartos@redhat.com">Martin Bartos</a>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Qualifier
public @interface ChromeJavascriptBrowser {
}

View file

@ -32,10 +32,10 @@ import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
import org.keycloak.testsuite.adapter.page.AngularCorsProductTestApp; import org.keycloak.testsuite.adapter.page.AngularCorsProductTestApp;
import org.keycloak.testsuite.adapter.page.CorsDatabaseServiceTestApp; import org.keycloak.testsuite.adapter.page.CorsDatabaseServiceTestApp;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer; import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
import org.keycloak.testsuite.util.ChromeJavascriptBrowser;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants; import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
import org.keycloak.testsuite.auth.page.account.Account; import org.keycloak.testsuite.auth.page.account.Account;
import org.keycloak.testsuite.auth.page.login.OIDCLogin; import org.keycloak.testsuite.auth.page.login.OIDCLogin;
import org.keycloak.testsuite.util.JavascriptBrowser;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
@ -73,21 +73,21 @@ public class CorsExampleAdapterTest extends AbstractExampleAdapterTest {
@ArquillianResource @ArquillianResource
private Deployer deployer; private Deployer deployer;
// Javascript browser needed KEYCLOAK-4703 // Javascript browser needed, but not PhantomJS
@Drone @Drone
@JavascriptBrowser @ChromeJavascriptBrowser
protected WebDriver jsDriver; protected WebDriver jsDriver;
@Page @Page
@JavascriptBrowser @ChromeJavascriptBrowser
protected OIDCLogin jsDriverTestRealmLoginPage; protected OIDCLogin jsDriverTestRealmLoginPage;
@Page @Page
@JavascriptBrowser @ChromeJavascriptBrowser
private AngularCorsProductTestApp jsDriverAngularCorsProductPage; private AngularCorsProductTestApp jsDriverAngularCorsProductPage;
@Page @Page
@JavascriptBrowser @ChromeJavascriptBrowser
private Account jsDriverTestRealmAccount; private Account jsDriverTestRealmAccount;
@Deployment(name = AngularCorsProductTestApp.DEPLOYMENT_NAME, managed = false) @Deployment(name = AngularCorsProductTestApp.DEPLOYMENT_NAME, managed = false)

View file

@ -98,6 +98,13 @@
<property name="downloadBinaries">${webdriverDownloadBinaries}</property> <property name="downloadBinaries">${webdriverDownloadBinaries}</property>
</extension> </extension>
<extension qualifier="webdriver-chromejavascriptbrowser">
<property name="browser">chrome</property>
<property name="chromeBinary">${chromeBinary}</property>
<property name="chromeArguments">${js.chromeArguments}</property>
<property name="chromeDriverVersion">${chromeDriverVersion}</property>
</extension>
<extension qualifier="graphene-secondbrowser"> <extension qualifier="graphene-secondbrowser">
<property name="browser">${browser}</property> <property name="browser">${browser}</property>
<property name="firefoxBinary">${firefox_binary}</property> <property name="firefoxBinary">${firefox_binary}</property>