From b0acc2df06637a4ef47c8b114b5f3fa39b9cf6f9 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Mon, 1 Jul 2024 14:27:29 +0200 Subject: [PATCH] chore(e2e): update the test to reduce the flake (#5987) * chore(e2e): update the test to reduce the flake * chore(e2e): remove unused import * chore(e2e): fix typo --- packages/compass-e2e-tests/tests/shell.test.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/compass-e2e-tests/tests/shell.test.ts b/packages/compass-e2e-tests/tests/shell.test.ts index 85ca1183919..5561017d485 100644 --- a/packages/compass-e2e-tests/tests/shell.test.ts +++ b/packages/compass-e2e-tests/tests/shell.test.ts @@ -11,7 +11,6 @@ import { } from '../helpers/compass'; import type { Compass } from '../helpers/compass'; import * as Selectors from '../helpers/selectors'; -import { expect } from 'chai'; describe('Shell', function () { let compass: Compass; @@ -67,9 +66,8 @@ describe('Shell', function () { it('shows and hides shell based on settings', async function () { await browser.connectWithConnectionString(); - let shellSection = await browser.$(Selectors.ShellSection); - let isShellSectionExisting = await shellSection.isExisting(); - expect(isShellSectionExisting).to.be.equal(true); + // Will fail if shell is not on the screen eventually + await browser.$(Selectors.ShellSection).waitForExist(); await browser.openSettingsModal(); const settingsModal = await browser.$(Selectors.SettingsModal); @@ -82,8 +80,7 @@ describe('Shell', function () { // wait for the modal to go away await settingsModal.waitForDisplayed({ reverse: true }); - shellSection = await browser.$(Selectors.ShellSection); - isShellSectionExisting = await shellSection.isExisting(); - expect(isShellSectionExisting).to.be.equal(false); + // Will fail if shell eventually doesn't go away from the screen + await browser.$(Selectors.ShellSection).waitForExist({ reverse: true }); }); });