Skip to content

Commit

Permalink
Merge pull request #81 from spadgett/fix-cypress-login
Browse files Browse the repository at this point in the history
OCPBUGS-51337: Fix Cypress tests
  • Loading branch information
openshift-merge-bot[bot] authored Feb 26, 2025
2 parents 7754690 + db90166 commit be254a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions integration-tests/support/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ declare global {
}

const KUBEADMIN_USERNAME = 'kubeadmin';
const loginUsername = Cypress.env('BRIDGE_KUBEADMIN_PASSWORD') ? 'user-dropdown' : 'username';

// This will add 'cy.login(...)'
// ex: cy.login('my-user', 'my-password')
Expand All @@ -27,7 +26,7 @@ Cypress.Commands.add('login', (username: string, password: string) => {
cy.get('#inputPassword').type(password || Cypress.env('BRIDGE_KUBEADMIN_PASSWORD'));
cy.get('button[type=submit]').click();

cy.get(`[data-test="${loginUsername}"]`).should('be.visible');
cy.get('[data-test="username"]').should('be.visible');
});
});

Expand All @@ -37,7 +36,7 @@ Cypress.Commands.add('logout', () => {
if (win.SERVER_FLAGS?.authDisabled) {
return;
}
cy.get('[data-test="user-dropdown"]').click();
cy.get('[data-test="username"]').click();
cy.get('[data-test="log-out"]').should('be.visible');
cy.get('[data-test="log-out"]').click({ force: true });
});
Expand Down

0 comments on commit be254a7

Please sign in to comment.