Skip to content

Commit

Permalink
fix: get cypress tests to go through the GitLab OAuth screen (#3690)
Browse files Browse the repository at this point in the history
Fixes the cypress tests getting stuck at the login step.
  • Loading branch information
leafty authored Jun 21, 2024
1 parent 0e11898 commit 3850db7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cypress-tests/cypress/support/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ const renkuLogin = (credentials: { username: string; password: string }[]) => {
cy.wrap(credentials, { log: false }).each((credential: {password: string, username: string}) => {
cy.get("#username").type(credential.username);
cy.get("#password").type(credential.password, { log: false });
cy.get("#kc-login").click().should("not.exist");
cy.get("#kc-login").click()
})
cy.url().then((url) => {
const parsedUrl = new URL(url);
if (
parsedUrl.pathname.includes("gitlab") ||
parsedUrl.host.includes("gitlab")
) {
cy.get(".doorkeeper-authorize >>>> .btn-danger")
.should("be.visible")
.should("be.enabled")
.click();
cy.contains("button", "Authorize").should("be.visible").click();
}
});
};
Expand Down

0 comments on commit 3850db7

Please sign in to comment.