Skip to content

Commit

Permalink
ustc-3866: remove wait and use selectFile
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarcotte committed Aug 22, 2023
1 parent a7a701a commit c76527f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/start-a-case-practitioner.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: E2E Cypress

on:
push:
schedule:
- cron: '*/10 * * * *'
push:
branches:
- 'ustc-3866-flaky-cypress-click-cicd'

jobs:
e2e_cypress:
Expand Down
28 changes: 19 additions & 9 deletions cypress/cypress-integration/support/pages/start-a-case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@ export const navigateTo = (username: string) => {
};

export const fillInAndSubmitForm = () => {
//wizard step 1
cy.get('input#stin-file').attachFile('../fixtures/w3-dummy.pdf');
cy.fixture('w3-dummy.pdf', null)
.then(Cypress.Buffer.from)
.then(pdfFile => {
const fileOptions = {
contents: pdfFile,
fileName: 'w3-dummy.pdf',
lastModified: Date.now(),
mimeType: 'application/pdf',
};

// wizard step 1
cy.get('input#stin-file').should('be.enabled').selectFile(fileOptions);
cy.get('button#submit-case').trigger('click');

// wizard step 2
cy.get('#petition-file').selectFile(fileOptions);
});

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);

cy.get('button#submit-case').trigger('click');
// cy.wait(500);

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500);

//step 2
cy.get('#petition-file').attachFile('../fixtures/w3-dummy.pdf');
// cy.wait(500);

cy.get('#irs-notice-radios').scrollIntoView();
cy.get('#irs-notice-radios label').first().click();
Expand Down

0 comments on commit c76527f

Please sign in to comment.