mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-26 21:27:40 -05:00
* Switch Cypress to use shared ESLint config * Run --fix in Cypress * Manually fix remaining lint issues in Cypress * Switch Playwright to use shared ESLint config * Run --fix in Playwright * Manually fix remaining lint issues in Playwright * Install and cache web app deps during Cypress CI builds This also caches the types and client package. That isn't needed currently since it uses prepackaged versions of those, but I imagine we might change that at some point. * Run e2e-tests-check when ESLint plugin is updated * Change E2E test GHA caching to cache all of web app node_modules * Fix mismatch between cache save and restore * Try bumping cache keys * Copy step to install dependencies to server.run_cypress.sh I don't know how this must've worked before, but if this fixes the issue, it seems like neither Cypress nor Playwright actually use the cached depenendencies. * Try disabling caching entirely for Cypress tests * Try bypassing makefile? * Try also manually building dependencies in run_specs.sh I don't know why this appears to duplicate run_cypress.sh and run_playwright.sh, both of which are called run_test.sh which might not be used any more as best I can tell. * Try installing the web app dependencies in yet another place * Disable the extra steps in server.prepare.sh specifically for Cypress * Revert changes to update cache key and disable web app depenedency cache on Cypress builds
87 lines
2.8 KiB
TypeScript
87 lines
2.8 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {defineConfig, devices} from '@playwright/test';
|
|
|
|
import {duration, testConfig} from '@mattermost/playwright-lib';
|
|
|
|
const chromeUse = {
|
|
browserName: 'chromium' as const,
|
|
permissions: ['notifications', 'clipboard-read', 'clipboard-write'] as string[],
|
|
viewport: {width: 1280, height: 1024},
|
|
};
|
|
|
|
export default defineConfig({
|
|
globalSetup: './global_setup.ts',
|
|
forbidOnly: testConfig.isCI,
|
|
outputDir: './results/output',
|
|
retries: testConfig.isCI ? 1 : 0,
|
|
testDir: 'specs',
|
|
timeout: duration.one_min,
|
|
workers: testConfig.workers,
|
|
expect: {
|
|
timeout: duration.ten_sec,
|
|
toHaveScreenshot: {
|
|
threshold: 0.4,
|
|
maxDiffPixelRatio: 0.0001,
|
|
animations: 'disabled',
|
|
},
|
|
toMatchAriaSnapshot: {
|
|
pathTemplate: '{testDir}/{testFilePath}-snapshots-a11y/{arg}{ext}',
|
|
},
|
|
},
|
|
use: {
|
|
baseURL: testConfig.baseURL,
|
|
ignoreHTTPSErrors: true,
|
|
headless: testConfig.headless,
|
|
locale: 'en-US',
|
|
launchOptions: {
|
|
args: ['--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream'],
|
|
firefoxUserPrefs: {
|
|
'media.navigator.streams.fake': true,
|
|
'permissions.default.microphone': 1,
|
|
'permissions.default.camera': 1,
|
|
},
|
|
slowMo: testConfig.slowMo,
|
|
},
|
|
screenshot: 'only-on-failure',
|
|
timezoneId: new Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
trace: 'retain-on-failure',
|
|
video: 'retain-on-failure',
|
|
actionTimeout: duration.half_min,
|
|
},
|
|
projects: [
|
|
{name: 'setup', testMatch: /test_setup\.ts/},
|
|
{
|
|
name: 'ipad',
|
|
use: {
|
|
browserName: 'chromium',
|
|
...devices['iPad Pro 11'],
|
|
permissions: ['notifications', 'clipboard-read', 'clipboard-write'],
|
|
},
|
|
dependencies: ['setup'],
|
|
},
|
|
{
|
|
name: 'chrome',
|
|
use: chromeUse,
|
|
dependencies: ['setup'],
|
|
},
|
|
{
|
|
name: 'firefox',
|
|
use: {
|
|
browserName: 'firefox',
|
|
permissions: ['notifications'],
|
|
viewport: {width: 1280, height: 1024},
|
|
},
|
|
dependencies: ['setup'],
|
|
},
|
|
],
|
|
reporter: [
|
|
...(testConfig.isCI ? [['blob', {outputDir: './results/blob-report'}] as const] : []),
|
|
['html', {open: 'never', outputFolder: './results/reporter'}],
|
|
['json', {outputFile: './results/reporter/results.json'}],
|
|
['junit', {outputFile: './results/reporter/results.xml'}],
|
|
['list'],
|
|
],
|
|
});
|