Skip to content

Commit

Permalink
Updated cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
simensma-fresh committed Oct 24, 2024
1 parent f7e4681 commit 2502f7c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions services/core-web/cypress/e2e/majorprojects.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,28 @@ describe("Major Projects", () => {

cy.intercept(
"GET",
/.*\/download-token\/332d6f13-cd09-4b55-93d7-52bd7e557fa4$/,
/.*download-token\/.*$/,
{
statusCode: 200,
body: {
token_guid: "ec851412-9c91-48cd-8917-dd58f0934b16"
},
}
);

).as('dlReq');

cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
// Click the Download file button in the dropdown
cy.contains("button", "Download file", { timeout: 3000 })
.find("div")
.click({ force: true });

cy.url().should('include', 'documents?token=ec851412-9c91-48cd-8917-dd58f0934b16')
});


// Click the Download file button in the dropdown
cy.contains("button", "Download file", { timeout: 3000 })
.find("div")
.click({ force: true });

cy.wait('@dlReq');

cy.get('@windowOpen').should('have.been.calledWith', `${Cypress.env("CYPRESS_DOC_MAN_URL")}/documents?token=ec851412-9c91-48cd-8917-dd58f0934b16`, '_blank')

});
});

0 comments on commit 2502f7c

Please sign in to comment.