* pipeline(playwright): prepare setup for playwright * feedback address * clean up readme * Fix docker-compose command and definition for dashboard * fix the dashboard * ignore dashboard when formatting --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Mario Vitale <mvitale1989@hotmail.com>
24 строки
923 B
TypeScript
24 строки
923 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import percySnapshot from '@percy/playwright';
|
|
|
|
import testConfig from '@e2e-test.config';
|
|
import {TestArgs} from '@e2e-types';
|
|
|
|
export default async function snapshotWithPercy(name: string, testArgs: TestArgs) {
|
|
if (testArgs.browserName === 'chromium' && testConfig.percyEnabled && testArgs.viewport) {
|
|
if (!testConfig.percyToken) {
|
|
// eslint-disable-next-line no-console
|
|
console.error('Error: Token is missing! Please set using: "export PERCY_TOKEN=<change_me>"');
|
|
}
|
|
|
|
const {page, viewport} = testArgs;
|
|
|
|
// Ignore since percy is using Playwright.Page
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore
|
|
await percySnapshot(page, name, {widths: [viewport.width], minHeight: viewport.height});
|
|
}
|
|
}
|