Skip to content

Commit 4c0b70a

Browse files
test: wrap describe for afterAll
Signed-off-by: David Dal Busco <[email protected]>
1 parent 016cbe1 commit 4c0b70a

File tree

1 file changed

+43
-44
lines changed

1 file changed

+43
-44
lines changed

e2e/snapshots.spec.ts

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,30 @@ import {initTestSuite} from './utils/init.utils';
55
testWithII.describe.configure({mode: 'serial'});
66

77
const snapshotTests = ({satelliteKind}: {satelliteKind: 'website' | 'application'}) => {
8-
const getTestPages = initTestSuite({satelliteKind});
8+
testWithII.describe(`Satellite ${satelliteKind}`, () => {
9+
const getTestPages = initTestSuite({satelliteKind});
910

10-
const SNAPSHOT_TARGET = {target: 'satellite' as const};
11+
const SNAPSHOT_TARGET = {target: 'satellite' as const};
1112

12-
testWithII(`[${satelliteKind}] should create and restore a snapshot`, async () => {
13-
const {consolePage, cliPage} = getTestPages();
13+
testWithII('should create and restore a snapshot', async () => {
14+
const {consolePage, cliPage} = getTestPages();
1415

15-
await cliPage.createSnapshot(SNAPSHOT_TARGET);
16+
await cliPage.createSnapshot(SNAPSHOT_TARGET);
1617

17-
await cliPage.clearHosting();
18+
await cliPage.clearHosting();
1819

19-
const satellitePage = await consolePage.visitSatelliteSite({
20-
title: 'Internet Computer - Error: response verification error'
21-
});
22-
await satellitePage.assertScreenshot();
20+
const satellitePage = await consolePage.visitSatelliteSite({
21+
title: 'Internet Computer - Error: response verification error'
22+
});
23+
await satellitePage.assertScreenshot();
2324

24-
await cliPage.restoreSnapshot(SNAPSHOT_TARGET);
25+
await cliPage.restoreSnapshot(SNAPSHOT_TARGET);
2526

26-
await satellitePage.reload();
27-
await satellitePage.assertScreenshot();
28-
});
27+
await satellitePage.reload();
28+
await satellitePage.assertScreenshot();
29+
});
2930

30-
testWithII(
31-
`[${satelliteKind}] should create, download, delete, upload and restore a snapshot`,
32-
async () => {
31+
testWithII('should create, download, delete, upload and restore a snapshot', async () => {
3332
testWithII.setTimeout(120_000);
3433

3534
const {consolePage, cliPage} = getTestPages();
@@ -56,49 +55,49 @@ const snapshotTests = ({satelliteKind}: {satelliteKind: 'website' | 'application
5655

5756
await satellitePage.reload();
5857
await satellitePage.assertScreenshot();
59-
}
60-
);
58+
});
6159

62-
testWithII(
63-
`[${satelliteKind}] should create, download, delete, upload and restore a snapshot to another satellite`,
64-
async () => {
65-
testWithII.setTimeout(120_000);
60+
testWithII(
61+
'should create, download, delete, upload and restore a snapshot to another satellite',
62+
async () => {
63+
testWithII.setTimeout(120_000);
6664

67-
const {consolePage, cliPage} = getTestPages();
65+
const {consolePage, cliPage} = getTestPages();
6866

69-
await consolePage.getICP();
67+
await consolePage.getICP();
7068

71-
await consolePage.goto();
69+
await consolePage.goto();
7270

73-
await consolePage.createSatellite({kind: 'application'});
71+
await consolePage.createSatellite({kind: 'application'});
7472

75-
const satelliteId = await consolePage.copySatelliteID();
73+
const satelliteId = await consolePage.copySatelliteID();
7674

77-
await cliPage.toggleSatelliteId({satelliteId});
75+
await cliPage.toggleSatelliteId({satelliteId});
7876

79-
const {accessKey} = await cliPage.whoami();
77+
const {accessKey} = await cliPage.whoami();
8078

81-
await consolePage.addSatelliteAdminAccessKey({accessKey, satelliteId});
79+
await consolePage.addSatelliteAdminAccessKey({accessKey, satelliteId});
8280

83-
await cliPage.deployHosting({clear: true});
81+
await cliPage.deployHosting({clear: true});
8482

85-
await consolePage.goto({path: `/satellite/?s=${satelliteId}`});
83+
await consolePage.goto({path: `/satellite/?s=${satelliteId}`});
8684

87-
const satellitePage = await consolePage.visitSatelliteSite({
88-
title: 'Hello World'
89-
});
90-
await satellitePage.assertScreenshot();
85+
const satellitePage = await consolePage.visitSatelliteSite({
86+
title: 'Hello World'
87+
});
88+
await satellitePage.assertScreenshot();
9189

92-
const {snapshotFolder} = await cliPage.getSnapshotFsFolder();
90+
const {snapshotFolder} = await cliPage.getSnapshotFsFolder();
9391

94-
await cliPage.uploadSnapshot({...SNAPSHOT_TARGET, folder: snapshotFolder});
92+
await cliPage.uploadSnapshot({...SNAPSHOT_TARGET, folder: snapshotFolder});
9593

96-
await cliPage.restoreSnapshot(SNAPSHOT_TARGET);
94+
await cliPage.restoreSnapshot(SNAPSHOT_TARGET);
9795

98-
await satellitePage.reload();
99-
await satellitePage.assertScreenshot();
100-
}
101-
);
96+
await satellitePage.reload();
97+
await satellitePage.assertScreenshot();
98+
}
99+
);
100+
});
102101
};
103102

104103
snapshotTests({satelliteKind: 'application'});

0 commit comments

Comments
 (0)