Skip to content

Commit 5ca2cb1

Browse files
committed
oidc fix
1 parent 755d18a commit 5ca2cb1

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

cypress.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ export default defineConfig({
4444
portOffset = freePort - 8080;
4545
wildfly
4646
.withNetworkMode("host")
47+
.withExtraHosts([{ host: require("os").hostname(), ipAddress: "127.0.0.1" }])
4748
.withCommand([
4849
"-c",
4950
configuration || "standalone-insecure.xml",
5051
`-Djboss.socket.binding.port-offset=${portOffset.toString()}`,
52+
"-Djboss.node.name=localhost",
5153
] as string[]);
5254
})
5355
.catch((error) => {
@@ -70,7 +72,7 @@ export default defineConfig({
7072
startedContainersManagementPorts.set(name as string, portOffset + 9990);
7173
return wildflyContainer
7274
.exec([
73-
`/bin/bash`,
75+
`/bin/sh`,
7476
`-c`,
7577
`$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=localhost:${managementPortWithOffset} --command="/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:${
7678
config.env.HAL_CONTAINER_PORT as string
@@ -79,7 +81,7 @@ export default defineConfig({
7981
.then((result) => {
8082
console.log(result.output);
8183
return wildflyContainer.exec([
82-
`/bin/bash`,
84+
`/bin/sh`,
8385
`-c`,
8486
`$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=localhost:${managementPortWithOffset} --command="reload"`,
8587
]);
@@ -88,7 +90,7 @@ export default defineConfig({
8890
console.log(result.output);
8991
wildflyContainer
9092
.exec([
91-
`/bin/bash`,
93+
`/bin/sh`,
9294
`-c`,
9395
`$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=localhost:${managementPortWithOffset} --command="read-attribute server-state"`,
9496
])

packages/testsuite/cypress/e2e/elytron-oidc-client/test-oidc-security-rbac.cy.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ describe("TESTS: Access secured by Elytron OIDC client with RBAC", () => {
102102

103103
function verifyNotLoggedIn(keycloak: string): void {
104104
cy.url().should("include", keycloak);
105-
cy.get("#username").should("exist");
106-
cy.get("#password").should("exist");
107-
cy.get("#kc-login").should("exist");
105+
cy.origin(keycloak, () => {
106+
// Wait for Keycloak login page to fully load
107+
cy.wait(1000);
108+
cy.get("#username").should("exist");
109+
cy.get("#password").should("exist");
110+
cy.get("#kc-login").should("exist");
111+
});
108112
}
109113
});

packages/testsuite/cypress/e2e/elytron-oidc-client/test-oidc-security.cy.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ describe("TESTS: Access secured by Elytron OIDC client", () => {
4848
}
4949

5050
function verifyNotLoggedIn(keycloak: string): void {
51-
cy.url().should(`include`, keycloak);
52-
cy.get("#username").should("exist");
53-
cy.get("#password").should("exist");
54-
cy.get("#kc-login").should("exist");
51+
cy.url().should("include", keycloak);
52+
cy.origin(keycloak, () => {
53+
// Wait for Keycloak login page to fully load
54+
cy.wait(1000);
55+
cy.get("#username").should("exist");
56+
cy.get("#password").should("exist");
57+
cy.get("#kc-login").should("exist");
58+
});
5559
}
5660
});

0 commit comments

Comments
 (0)