MM-62954 E2E/Playwright shared library (#30177)

* feat: Add package.json for Playwright library with dependencies

* feat: Add explicit exports for test.config in playwright-lib package

* feat: Add initialization setup for Mattermost E2E testing with admin and user client

* fix: Update package dependencies and resolve TypeScript build errors

* feat: Update package exports for test.config to support both CommonJS and ESM

* playwright shared library

* add README, fix pipeline

* keep file structures, move report up to playwright

* minimize API, use the prerelease versions of client and types

* bump version

* update package*.json

* resolve merge conflict

* update depedencies and merge conflicts

* update readme and fix ci

* remove unnecessary export and list all external packages

* fix import for Client4
Этот коммит содержится в:
Saturnino Abril
2025-04-01 08:52:56 +08:00
коммит произвёл GitHub
родитель ce9632cca3
Коммит a47269cfe2
163 изменённых файлов: 7203 добавлений и 5048 удалений

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

@@ -5,6 +5,7 @@ import path from 'node:path';
import {fileURLToPath} from 'node:url';
import js from '@eslint/js';
import {FlatCompat} from '@eslint/eslintrc';
import eslintPluginHeader from 'eslint-plugin-header';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -14,18 +15,23 @@ const compat = new FlatCompat({
allConfig: js.configs.all,
});
eslintPluginHeader.rules.header.meta.schema = false;
export default [
{
ignores: ['**/node_modules', '**/playwright-report', '**/test-results', '**/results'],
ignores: ['**/node_modules', '**/dist', '**/playwright-report', '**/test-results', '**/results'],
},
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended').map((config) => ({
...config,
files: ['**/*.ts', '**/*.s'],
})),
...compat
.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:import/recommended')
.map((config) => ({
...config,
files: ['**/*.ts', '**/*.js'],
})),
{
files: ['**/*.ts', '**/*.s'],
files: ['**/*.ts', '**/*.js'],
plugins: {
'@typescript-eslint': typescriptEslint,
header: eslintPluginHeader,
},
languageOptions: {
globals: {
@@ -35,11 +41,31 @@ export default [
ecmaVersion: 5,
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-console': 'error',
'header/header': [
'error',
'line',
' Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n See LICENSE.txt for license information.',
2,
],
'import/order': [
'error',
{
'newlines-between': 'always',
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
},
],
'import/no-unresolved': 'off',
},
},
];