Fix globalsearch test: wait for page load (#5883)

This commit is contained in:
Rishabh Saxena 2021-07-15 17:10:54 +05:30 committed by GitHub
parent d8e2488a9b
commit cb91221276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -13,17 +13,15 @@ describe("GlobalSearch", function() {
});
it("showsAndHidesUsingKeyboardShortcuts", () => {
// wait for the page to load
cy.get(commonlocators.canvas);
const isMac = Cypress.platform === "darwin";
if (isMac) {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);
cy.get("body").type("{cmd}{k}");
cy.get(commonlocators.globalSearchModal);
cy.get("body").type("{esc}");
cy.get(commonlocators.globalSearchModal).should("not.exist");
} else {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);
cy.get("body").type("{ctrl}{k}");
cy.get(commonlocators.globalSearchModal);
cy.get("body").type("{esc}");