Playwright/E2E: Upgraded Playwright to 1.41 and fixed tests (#26008)

* upgrade Playwright and fix tests

* fix lint
Этот коммит содержится в:
Saturnino Abril
2024-01-23 20:56:23 +08:00
коммит произвёл GitHub
родитель 797fe9b917
Коммит 79e961e239
10 изменённых файлов: 562 добавлений и 455 удалений

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

@@ -5,6 +5,7 @@ import os from 'node:os';
import {expect} from '@playwright/test';
import {test} from './test_fixture';
import {callsPluginId} from './constant';
import {getAdminClient} from './server/init';
@@ -33,3 +34,10 @@ export async function shouldRunInLinux() {
const platform = os.platform();
await expect(platform, 'Run in Linux or Playwright docker image only').toBe('linux');
}
export async function skipIfNoLicense() {
const {adminClient} = await getAdminClient();
const license = await adminClient.getClientLicenseOld();
test.skip(license.IsLicensed === 'false', 'Skipping test - server not licensed');
}

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

@@ -3,7 +3,7 @@ import {AxeResults} from 'axe-core';
import AxeBuilder from '@axe-core/playwright';
import {TestBrowser} from './browser_context';
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldRunInLinux} from './flag';
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldRunInLinux, skipIfNoLicense} from './flag';
import {initSetup, getAdminClient} from './server';
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
import {pages} from './ui/pages';
@@ -47,6 +47,7 @@ class PlaywrightExtended {
readonly shouldHaveCallsEnabled;
readonly shouldHaveFeatureFlag;
readonly shouldRunInLinux;
readonly skipIfNoLicense;
// ./server
readonly getAdminClient;
@@ -71,6 +72,7 @@ class PlaywrightExtended {
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
this.shouldRunInLinux = shouldRunInLinux;
this.skipIfNoLicense = skipIfNoLicense;
// ./server
this.initSetup = initSetup;

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

@@ -7,9 +7,11 @@ type NotificationSettingsSection = 'keysWithHighlight' | 'keysWithNotification';
export default class NotificationsSettings {
readonly container: Locator;
readonly keysWithHighlightDesc: Locator;
constructor(container: Locator) {
this.container = container;
this.keysWithHighlightDesc = container.locator('#keysWithHighlightDesc');
}
async toBeVisible() {