Skip to content

Commit

Permalink
Added test case for bceid user update an application
Browse files Browse the repository at this point in the history
Added test case for bceid user update an application
  • Loading branch information
bcgov-brwang committed Nov 13, 2024
1 parent 1f04ec6 commit e2a684f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ module.exports = defineConfig({
baseUrl: 'https://onroutebc-test-frontend.apps.silver.devops.gov.bc.ca',
env: {
idir_username: '',
idir_password: ''
idir_password: '',
bceid_username: '',
bceid_password: '',
update_term_oversize_url: 'https://onroutebc-test-frontend.apps.silver.devops.gov.bc.ca/applications/581',
},
},
});
35 changes: 35 additions & 0 deletions tests/cypress/e2e/bceid-update-term-oversize.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
describe('Login Test for OnRouteBC', () => {
it('Should navigate to the login page, find the login button, and enter credentials', () => {
// Retrieve the environment variables
const username = Cypress.env('bceid_username');
const password = Cypress.env('bceid_password');
const update_term_oversize_url = Cypress.env('update_term_oversize_url');

// Step 1: Visit the base URL
cy.visit('/');

// Step 2: Find and click the login button by its idir
cy.get('#login-bceid').click();
cy.wait(5000);

// Step 3: Enter credentials
cy.get('#user').type(username);
cy.get('#password').type(password);
cy.wait(5000);

// Step 4: Submit the login form
cy.get('[name="btnSubmit"]').click();
cy.wait(5000);

cy.visit(update_term_oversize_url);
cy.wait(5000);

// update phone ext
cy.get('[name="permitData.contactDetails.phone1Extension"]').clear().type('0003');
cy.wait(5000);

// save updates
cy.get('[data-testid="save-application-button"]').click();
cy.wait(5000);
});
});

0 comments on commit e2a684f

Please sign in to comment.