Skip to content

Commit f3a0158

Browse files
authored
chore(e2e): Wait for preferences to be saved before continuing on from browser.closeWelcomeModal() (#5918)
* wait for preferences to be saved when closing the welcome modal * we probably don't have to skip it on windows now * rather rely on the side-effect of setting a feature
1 parent 5f8b75b commit f3a0158

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/compass-e2e-tests/helpers/commands/close-welcome-modal.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ export async function closeWelcomeModal(
1717
await welcomeModalElement.waitForDisplayed({
1818
reverse: true,
1919
});
20+
21+
// By setting a feature after closing the welcome modal we know that
22+
// preferences will have been saved to disk and therefore showedNetworkOptIn
23+
// will have been set to true on disk before we continue. So even if a test
24+
// does something like location.reload() immediately it definitely won't show
25+
// the welcome modal a second time. It is kinda irrelevant which setting we use.
26+
await browser.setFeature('enableShell', true);
2027
}

packages/compass-e2e-tests/helpers/compass.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ export async function init(
10141014
if (compass.needsCloseWelcomeModal) {
10151015
await browser.closeWelcomeModal();
10161016
}
1017+
10171018
if (!opts.noWaitForConnectionScreen) {
10181019
await browser.waitForConnectionScreen();
10191020
}

packages/compass-e2e-tests/tests/auto-connect.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,6 @@ describe('Automatically connecting from the command line', function () {
190190
});
191191

192192
it('enters auto-connect mode again if the window is hard reloaded', async function () {
193-
if (process.platform === 'win32' && (process.env.ci || process.env.CI)) {
194-
return this.skip(); // Doesn't work on Windows, but only in CI
195-
}
196193
const compass = await init(this.test?.fullTitle(), {
197194
wrapBinary: positionalArgs([connectionStringSuccess]),
198195
noWaitForConnectionScreen: true,

0 commit comments

Comments
 (0)