* 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>
28 строки
752 B
TypeScript
28 строки
752 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {expect, Locator} from '@playwright/test';
|
|
|
|
export default class GlobalHeader {
|
|
readonly container: Locator;
|
|
|
|
readonly productSwitchMenu;
|
|
|
|
constructor(container: Locator) {
|
|
this.container = container;
|
|
|
|
this.productSwitchMenu = container.getByRole('button', {name: 'Product switch menu'});
|
|
}
|
|
|
|
async switchProduct(name: string) {
|
|
await this.productSwitchMenu.click();
|
|
await this.container.getByRole('link', {name}).click();
|
|
}
|
|
|
|
async toBeVisible(name: string) {
|
|
await expect(this.container.getByRole('heading', {name})).toBeVisible();
|
|
}
|
|
}
|
|
|
|
export {GlobalHeader};
|