Skip to content

Commit b4b0e89

Browse files
committed
Ensure commands run with correct origin URL
1 parent 820b50f commit b4b0e89

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

cypress/e2e/oidc_auth.cy.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@ describe('OIDC SSO (Keycloak) - primary realm', () => {
2222
});
2323

2424
// Log snippet of body after click (first 300 chars)
25-
cy.get('body').then(($body) => {
26-
cy.task('log', 'Body after click: ' + $body.text().slice(0, 300));
27-
});
25+
// cy.get('body').then(($body) => {
26+
// cy.task('log', 'Body after click: ' + $body.text().slice(0, 300));
27+
// });
2828

2929
// Log page title after click
30-
cy.get('title').then(($title) => {
31-
cy.task('log', 'Page title after click: ' + $title.text());
32-
});
30+
// cy.get('title').then(($title) => {
31+
// cy.task('log', 'Page title after click: ' + $title.text());
32+
// });
3333

3434
// Wait for navigation to Keycloak (skip strict /oidc/login check)
3535
cy.location('origin', { timeout: 30000 }).should('eq', KEYCLOAK_ORIGIN);
3636

3737
const username = Cypress.env('OIDC_USERNAME') || 'demo';
3838
const password = Cypress.env('OIDC_PASSWORD') || 'demo';
39-
cy.task('log', `Using OIDC credentials: ${username}/*****`);
39+
cy.origin(KEYCLOAK_ORIGIN, () => {
40+
cy.task('log', `Using OIDC credentials: ${username}/*****`);
41+
})
4042

4143
// Complete login inside Keycloak
4244
cy.origin(KEYCLOAK_ORIGIN, { args: { username, password } }, ({ username, password }) => {

0 commit comments

Comments
 (0)