E2E folder structure for mono-repo (#22525)
* move e2e to root folder, add playbooks to e2e/cypress * add e2e ci workflow, clean up dep and update playwright readme * fix elasticsearch tests * update default roles and enable app bar
58
.github/workflows/e2e-ci.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: mattermost-e2e
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- mono-repo*
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
jobs:
|
||||
cypress-check:
|
||||
runs-on: ubuntu-22.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: e2e/cypress
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
id: setup_node
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: npm
|
||||
cache-dependency-path: 'e2e/cypress/package-lock.json'
|
||||
- name: ci/cypress/npm-install
|
||||
run: |
|
||||
npm ci
|
||||
- name: ci/cypress/npm-check
|
||||
run: |
|
||||
npm run check
|
||||
playwright-check:
|
||||
runs-on: ubuntu-22.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: e2e/playwright
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
id: setup_node
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: npm
|
||||
cache-dependency-path: 'e2e/playwright/package-lock.json'
|
||||
- name: ci/get-webapp-node-modules
|
||||
working-directory: webapp
|
||||
# requires build of client and types
|
||||
run: |
|
||||
make node_modules
|
||||
- name: ci/playwright/npm-install
|
||||
run: |
|
||||
npm ci
|
||||
- name: ci/playwright/npm-check
|
||||
run: |
|
||||
npm run check
|
||||
21
.gitignore
vendored
@@ -22,6 +22,27 @@ config/config.json
|
||||
config/logging.json
|
||||
/plugins
|
||||
|
||||
# disable folders generated by Cypress
|
||||
e2e/cypress/node_modules
|
||||
e2e/cypress/tests/downloads
|
||||
e2e/cypress/tests/screenshots
|
||||
e2e/cypress/tests/videos
|
||||
e2e/cypress/tests/integration/benchmark/__benchmarks__
|
||||
e2e/cypress/tests/integration/performance/logs
|
||||
e2e/cypress/tests/fixtures/ldap_tmp
|
||||
e2e/cypress/tests/fixtures/mmctl
|
||||
e2e/cypress/results
|
||||
e2e/cypress/.eslintcache
|
||||
|
||||
# disable files/folders generated by Playwright
|
||||
e2e/playwright/node_modules
|
||||
e2e/playwright/playwright-report
|
||||
e2e/playwright/storage_state
|
||||
e2e/playwright/test-results
|
||||
e2e/playwright/tests/**/*-darwin.png
|
||||
e2e/playwright/tests/**/*-window.png
|
||||
e2e/playwright/.eslintcache
|
||||
|
||||
# Enterprise & products imports files
|
||||
imports/imports.go
|
||||
|
||||
|
||||
8
e2e/.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# env, cert, key, license
|
||||
.env*
|
||||
*.crt
|
||||
*.key
|
||||
*.license
|
||||
|
||||
# Plugin
|
||||
*.tar.gz
|
||||
1
e2e/cypress/.eslintignore
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
122
e2e/cypress/.eslintrc.json
Normal file
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"extends": [
|
||||
"plugin:mattermost/react",
|
||||
"plugin:cypress/recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/eslint-plugin",
|
||||
"mattermost",
|
||||
"import",
|
||||
"no-only-tests",
|
||||
"@typescript-eslint",
|
||||
"cypress"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"env": {
|
||||
"cypress/globals": true
|
||||
},
|
||||
"rules": {
|
||||
"header/header": [
|
||||
2,
|
||||
"line",
|
||||
" Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n See LICENSE.txt for license information.",
|
||||
2
|
||||
],
|
||||
"cypress/assertion-before-screenshot": "warn",
|
||||
"cypress/no-assigning-return-values": "error",
|
||||
"cypress/no-force": "warn",
|
||||
"cypress/no-async-tests": "error",
|
||||
"cypress/no-pause": "error",
|
||||
"cypress/no-unnecessary-waiting": 0,
|
||||
"func-names": 0,
|
||||
"import/no-unresolved": 0,
|
||||
"max-nested-callbacks": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"no-process-env": 0,
|
||||
"no-duplicate-imports": 0,
|
||||
"no-undefined": 0,
|
||||
"no-use-before-define": 0,
|
||||
"import/no-duplicates": 2,
|
||||
"mattermost/use-external-link": 2,
|
||||
"eol-last": ["error", "always"],
|
||||
"import/order": [
|
||||
0,
|
||||
{
|
||||
"newlines-between": "always-and-inside-groups",
|
||||
"groups": [
|
||||
"builtin",
|
||||
"external",
|
||||
[
|
||||
"internal",
|
||||
"parent"
|
||||
],
|
||||
"sibling",
|
||||
"index"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-only-tests/no-only-tests": ["error", {"focus": ["only", "skip"]}],
|
||||
"max-lines": ["warn", {"max": 800, "skipBlankLines": true, "skipComments": true}]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.ts"],
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"camelcase": 0,
|
||||
"no-shadow": 0,
|
||||
"import/no-unresolved": 0, // ts handles this better
|
||||
"@typescript-eslint/naming-convention": [
|
||||
2,
|
||||
{
|
||||
"selector": "function",
|
||||
"format": ["camelCase", "PascalCase"]
|
||||
},
|
||||
{
|
||||
"selector": "variable",
|
||||
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
|
||||
},
|
||||
{
|
||||
"selector": "parameter",
|
||||
"format": ["camelCase", "PascalCase"],
|
||||
"leadingUnderscore": "allow"
|
||||
},
|
||||
{
|
||||
"selector": "typeLike",
|
||||
"format": ["PascalCase"]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-non-null-assertion": 0,
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
2,
|
||||
{
|
||||
"vars": "all",
|
||||
"args": "after-used"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"@typescript-eslint/prefer-interface": 0,
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"@typescript-eslint/indent": [
|
||||
2,
|
||||
4,
|
||||
{
|
||||
"SwitchCase": 0
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-use-before-define": [
|
||||
2,
|
||||
{
|
||||
"classes": false,
|
||||
"functions": false,
|
||||
"variables": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "7.19.1",
|
||||
"@babel/eslint-plugin": "7.19.1",
|
||||
"@cypress/request": "2.88.11",
|
||||
"@cypress/skip-test": "2.6.1",
|
||||
"@mattermost/types": "7.4.0",
|
||||
"@testing-library/cypress": "9.0.0",
|
||||
"@types/async": "3.2.16",
|
||||
@@ -17,6 +20,8 @@
|
||||
"@types/recursive-readdir": "2.2.1",
|
||||
"@types/shelljs": "0.8.11",
|
||||
"@types/uuid": "9.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.55.0",
|
||||
"@typescript-eslint/parser": "5.55.0",
|
||||
"async": "3.2.4",
|
||||
"authenticator": "1.1.5",
|
||||
"aws-sdk": "2.1295.0",
|
||||
@@ -34,6 +39,14 @@
|
||||
"dayjs": "1.11.7",
|
||||
"deepmerge": "4.2.2",
|
||||
"dotenv": "16.0.3",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-import-resolver-webpack": "0.13.2",
|
||||
"eslint-plugin-cypress": "2.12.1",
|
||||
"eslint-plugin-header": "3.1.1",
|
||||
"eslint-plugin-import": "2.27.5",
|
||||
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#5b0c972eacf19286e4c66221b39113bf8728a99e",
|
||||
"eslint-plugin-no-only-tests": "3.1.0",
|
||||
"eslint-plugin-react": "7.32.2",
|
||||
"express": "4.18.2",
|
||||
"extract-zip": "2.0.1",
|
||||
"knex": "2.4.0",
|
||||
@@ -67,19 +80,19 @@
|
||||
"postinstall": "patch-package",
|
||||
"check-types": "tsc -b",
|
||||
"cypress:open": "cross-env TZ=Etc/UTC cypress open",
|
||||
"cypress:run": "cross-env TZ=Etc/UTC cypress run --browser chrome --config excludeSpecPattern='**/enterprise/**/*.{js,ts}'",
|
||||
"cypress:run:enterprise": "cross-env TZ=Etc/UTC cypress run --browser chrome --spec='tests/integration/enterprise/**/*_spec.{js,ts}'",
|
||||
"cypress:run:firefox": "cross-env TZ=Etc/UTC cypress run --browser firefox --config ignoreTestFiles='**/enterprise/**/*.{js,ts}'",
|
||||
"cypress:run:firefox:enterprise": "cross-env TZ=Etc/UTC cypress run --browser firefox --spec='tests/integration/enterprise/**/*_spec.{js,ts}'",
|
||||
"cypress:run:edge": "cross-env TZ=Etc/UTC cypress run --browser edge --config ignoreTestFiles='**/enterprise/**/*.{js,ts}'",
|
||||
"cypress:run:edge:enterprise": "cross-env TZ=Etc/UTC cypress run --browser edge --spec='tests/integration/enterprise/**/*_spec.{js,ts}'",
|
||||
"cypress:run:electron": "cross-env TZ=Etc/UTC cypress run --browser electron --config ignoreTestFiles='**/enterprise/**/*.{js,ts}'",
|
||||
"cypress:run:electron:enterprise": "cross-env TZ=Etc/UTC cypress run --browser electron --spec='tests/integration/enterprise/**/*_spec.{js,ts}'",
|
||||
"cypress:run": "cross-env TZ=Etc/UTC cypress run",
|
||||
"cypress:run:chrome": "cross-env TZ=Etc/UTC cypress run --browser chrome",
|
||||
"cypress:run:firefox": "cross-env TZ=Etc/UTC cypress run --browser firefox",
|
||||
"cypress:run:edge": "cross-env TZ=Etc/UTC cypress run --browser edge",
|
||||
"cypress:run:electron": "cross-env TZ=Etc/UTC cypress run --browser electron",
|
||||
"benchmarks:run-server": "cd mattermost && bin/mattermost",
|
||||
"start:webhook": "node webhook_serve.js",
|
||||
"test": "start-test start:webhook 3000 test:ci",
|
||||
"pretest": "npm run clean",
|
||||
"test": "cross-env TZ=Etc/UTC cypress run",
|
||||
"test:ci": "node run_tests.js",
|
||||
"uniq-meta": "grep -r \"^// $META:\" cypress | grep -ow '@\\w*' | sort | uniq"
|
||||
"uniq-meta": "grep -r \"^// $META:\" cypress | grep -ow '@\\w*' | sort | uniq",
|
||||
"check": "eslint --ext .js,.ts . --quiet --cache",
|
||||
"fix": "eslint --ext .js,.ts . --quiet --fix --cache"
|
||||
},
|
||||
"dependencies": {
|
||||
"patch-package": "6.5.1"
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 341 KiB |
|
Before Width: | Height: | Size: 769 KiB After Width: | Height: | Size: 769 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 356 B |
|
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 559 B |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
|
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 470 KiB After Width: | Height: | Size: 470 KiB |
|
Before Width: | Height: | Size: 611 KiB After Width: | Height: | Size: 611 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 956 B After Width: | Height: | Size: 956 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |