Skip to content

Commit 7174e0b

Browse files
committed
chore(e2e): screenshot if failed in rolling-indexes test
1 parent d01d076 commit 7174e0b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

packages/compass-e2e-tests/tests/atlas-cloud/rolling-indexes.test.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { Compass } from '../../helpers/compass';
2-
import { cleanup, init, Selectors } from '../../helpers/compass';
2+
import {
3+
cleanup,
4+
init,
5+
screenshotIfFailed,
6+
Selectors,
7+
} from '../../helpers/compass';
38
import type { CompassBrowser } from '../../helpers/compass-browser';
49
import { createNumbersCollection } from '../../helpers/insert-data';
510
import {
@@ -11,16 +16,20 @@ describe('Rolling indexes', function () {
1116
let compass: Compass;
1217
let browser: CompassBrowser;
1318

14-
before(async function () {
19+
before(function () {
20+
if (!isTestingAtlasCloudSandbox()) {
21+
this.skip();
22+
}
23+
});
24+
25+
beforeEach(async function () {
1526
compass = await init(this.test?.fullTitle());
1627
browser = compass.browser;
1728
await browser.setupDefaultConnections();
1829
});
1930

20-
before(function () {
21-
if (!isTestingAtlasCloudSandbox()) {
22-
this.skip();
23-
}
31+
afterEach(async function () {
32+
await screenshotIfFailed(compass, this.currentTest);
2433
});
2534

2635
after(async function () {

0 commit comments

Comments
 (0)