mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Give every Red Strings test its own resume token so tearing down an earlier browser connection cannot strand a later Firefox login before its assertion runs. Thanks to xet7 !
28 lines
812 B
JavaScript
28 lines
812 B
JavaScript
'use strict';
|
|
|
|
// Regression guard for the all-browser run: every Red Strings test opens a new
|
|
// page, so it must also receive a new resume token instead of reusing the one
|
|
// created once for the whole describe block.
|
|
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const source = fs.readFileSync(
|
|
path.join(__dirname, 'playwright/specs/27-red-strings.e2e.js'),
|
|
'utf8',
|
|
);
|
|
|
|
assert.match(
|
|
source,
|
|
/test\.beforeEach\(\(\) => \{\s*owner\.token = db\.addResumeToken\(owner\.id\);\s*\}\);/,
|
|
'every test must add its own resume token',
|
|
);
|
|
assert.doesNotMatch(
|
|
source,
|
|
/test\.beforeEach\(\(\) => \{\s*owner\.token = owner\.token;/,
|
|
'a fresh page must not keep reusing the describe-wide token',
|
|
);
|
|
|
|
console.log('redStringsSessionIsolation: 2 tests passed');
|