From 7174e0b48966058cf236c7ecad0aa8603eab6281 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Fri, 1 Nov 2024 17:26:21 +0100 Subject: [PATCH] chore(e2e): screenshot if failed in rolling-indexes test --- .../tests/atlas-cloud/rolling-indexes.test.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/compass-e2e-tests/tests/atlas-cloud/rolling-indexes.test.ts b/packages/compass-e2e-tests/tests/atlas-cloud/rolling-indexes.test.ts index 4c2fa9aac5e..f09b7afcd85 100644 --- a/packages/compass-e2e-tests/tests/atlas-cloud/rolling-indexes.test.ts +++ b/packages/compass-e2e-tests/tests/atlas-cloud/rolling-indexes.test.ts @@ -1,5 +1,10 @@ import type { Compass } from '../../helpers/compass'; -import { cleanup, init, Selectors } from '../../helpers/compass'; +import { + cleanup, + init, + screenshotIfFailed, + Selectors, +} from '../../helpers/compass'; import type { CompassBrowser } from '../../helpers/compass-browser'; import { createNumbersCollection } from '../../helpers/insert-data'; import { @@ -11,16 +16,20 @@ describe('Rolling indexes', function () { let compass: Compass; let browser: CompassBrowser; - before(async function () { + before(function () { + if (!isTestingAtlasCloudSandbox()) { + this.skip(); + } + }); + + beforeEach(async function () { compass = await init(this.test?.fullTitle()); browser = compass.browser; await browser.setupDefaultConnections(); }); - before(function () { - if (!isTestingAtlasCloudSandbox()) { - this.skip(); - } + afterEach(async function () { + await screenshotIfFailed(compass, this.currentTest); }); after(async function () {