Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(login): add command to fill login form
- Loading branch information
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
packages/cypress-commands/src/commands/fillAndSubmitLoginForm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const fillAndSubmitLoginForm = () => { | ||
const loginUrl = Cypress.env('dhis2_base_url') | ||
const username = Cypress.env('dhis2_username') | ||
const password = Cypress.env('dhis2_password') | ||
|
||
cy.get('#server').type(loginUrl) | ||
cy.get('#j_username').type(username) | ||
cy.get('#j_password').type(password) | ||
cy.get('{loginsubmit}', { prefix: 'dhis2-adapter' }).click() | ||
} | ||
|
||
Cypress.Commands.add('fillAndSubmitLoginForm', fillAndSubmitLoginForm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters