mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-18 18:18:23 -05:00
E2E/Playwright: Fix unclosed browser context around in Playwright (#35258)
* test: fix user details and attribute tests * test: fix unclosed browser contexts
This commit is contained in:
parent
68c1c072dd
commit
671e2b7640
1 changed files with 5 additions and 5 deletions
|
|
@ -14,11 +14,10 @@ import {resolvePlaywrightPath} from './util';
|
|||
|
||||
export class TestBrowser {
|
||||
readonly browser: Browser;
|
||||
context: BrowserContext | null;
|
||||
private contexts: BrowserContext[] = [];
|
||||
|
||||
constructor(browser: Browser) {
|
||||
this.browser = browser;
|
||||
this.context = null;
|
||||
}
|
||||
|
||||
async login(user: UserProfile) {
|
||||
|
|
@ -40,7 +39,7 @@ export class TestBrowser {
|
|||
const threadsPage = new pages.ThreadsPage(page);
|
||||
const contentReviewPage = new pages.ContentReviewPage(page);
|
||||
|
||||
this.context = context;
|
||||
this.contexts.push(context);
|
||||
|
||||
return {
|
||||
context,
|
||||
|
|
@ -55,9 +54,10 @@ export class TestBrowser {
|
|||
}
|
||||
|
||||
async close() {
|
||||
if (this.context) {
|
||||
await this.context.close();
|
||||
for (const context of this.contexts) {
|
||||
await context.close();
|
||||
}
|
||||
this.contexts = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue