Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 12 additions & 26 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,32 +82,18 @@ Cypress.Commands.add(
).then((result) => {
cy.log(result.stdout);
cy.task('log', result.stdout);
if (result.stdout.includes('Ready')) {
cy.log(oauthurl);
cy.task('log', oauthurl);
cy.origin(
oauthurl,
{ args: { username, password } },
// eslint-disable-next-line @typescript-eslint/no-shadow
({ username, password }) => {
cy.get('#inputUsername').type(username);
cy.get('#inputPassword').type(password);
cy.get('button[type=submit]').click();
},
);
} else {
// Note required duplication in if above due to limitations of cy.origin
cy.task('log', ` Logging in as ${username}`);
cy.get('[data-test-id="login"]').should('be.visible');
cy.get('body').then(($body) => {
if ($body.text().includes(provider)) {
cy.contains(provider).should('be.visible').click();
}
});
cy.get('#inputUsername').type(username);
cy.get('#inputPassword').type(password);
cy.get('button[type=submit]').click();
}
cy.log(oauthurl);
cy.task('log', oauthurl);
cy.origin(
oauthurl,
{ args: { username, password } },
// eslint-disable-next-line @typescript-eslint/no-shadow
({ username, password }) => {
cy.get('#inputUsername').type(username);
cy.get('#inputPassword').type(password);
cy.get('button[type=submit]').click();
},
);
});
},
);
Expand Down