E2E/Playwright: Update dependencies, screenshots, config and type (#23000)

* update dependencies

* update default server config and client type

* close browser context once test is done

* fix test when switching a product

* update screenshots and readme

* add cross-env and make headless mode as default

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Saturnino Abril
2023-04-19 12:04:25 +08:00
коммит произвёл GitHub
родитель 4ef3081f65
Коммит 6ca5824ea1
42 изменённых файлов: 575 добавлений и 514 удалений

Просмотреть файл

@@ -3,16 +3,18 @@
import {writeFile} from 'node:fs/promises';
import {request, Browser} from '@playwright/test';
import {request, Browser, BrowserContext} from '@playwright/test';
import {UserProfile} from '@mattermost/types/users';
import testConfig from '@e2e-test.config';
export class TestBrowser {
readonly browser: Browser;
context: BrowserContext | null;
constructor(browser: Browser) {
this.browser = browser;
this.context = null;
}
async login(user: UserProfile | null) {
@@ -27,8 +29,16 @@ export class TestBrowser {
const context = await this.browser.newContext(options);
const page = await context.newPage();
this.context = context;
return {context, page};
}
async close() {
if (this.context) {
await this.context.close();
}
}
}
export async function loginByAPI(loginId: string, password: string, token = '', ldapOnly = false) {