Merge branch 'master' into MM-50966-in-product-expansion

Этот коммит содержится в:
Conor Macpherson
2023-04-19 11:40:50 -04:00
коммит произвёл GitHub
родитель 42f457fec2 d1c9469d06
Коммит c4efd2647c
136 изменённых файлов: 3783 добавлений и 862 удалений

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

@@ -3,16 +3,18 @@
import {writeFile} from 'node:fs/promises';
import {request, Browser} from '@playwright/test';
import {request, Browser, BrowserContext} from '@playwright/test';
import {UserProfile} from '@mattermost/types/users';
import testConfig from '@e2e-test.config';
export class TestBrowser {
readonly browser: Browser;
context: BrowserContext | null;
constructor(browser: Browser) {
this.browser = browser;
this.context = null;
}
async login(user: UserProfile | null) {
@@ -27,8 +29,16 @@ export class TestBrowser {
const context = await this.browser.newContext(options);
const page = await context.newPage();
this.context = context;
return {context, page};
}
async close() {
if (this.context) {
await this.context.close();
}
}
}
export async function loginByAPI(loginId: string, password: string, token = '', ldapOnly = false) {

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

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// This is based on "packages/client/src/client4.ts". Modified for node client.
// This is based on "webapp/platform/client/src/client4.ts". Modified for node client.
// Update should be made in comparison with the base Client4.
import fs from 'node:fs';
@@ -134,7 +134,7 @@ export default class Client extends Client4 {
// *****************************************************************************
// Boards client
// based on https://github.com/mattermost/focalboard/blob/main/webapp/src/octoClient.ts
// based on "webapp/boards/src/octoClient.ts"
// *****************************************************************************
async patchUserConfig(userID: string, patch: UserConfigPatch): Promise<UserPreference[] | undefined> {

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

@@ -318,7 +318,6 @@ const defaultServerConfig: AdminConfig = {
LoginButtonColor: '#0000',
LoginButtonBorderColor: '#2389D7',
LoginButtonTextColor: '#2389D7',
EnableInactivityEmail: true,
},
RateLimitSettings: {
Enable: false,
@@ -532,6 +531,7 @@ const defaultServerConfig: AdminConfig = {
EnableRemoteClusterService: false,
EnableAppBar: false,
PatchPluginsReactDOM: false,
DisableRefetchingOnBrowserFocus: false,
},
AnalyticsSettings: {
MaxUsersForStatistics: 2500,
@@ -621,12 +621,6 @@ const defaultServerConfig: AdminConfig = {
'com.mattermost.nps': {
Enable: true,
},
focalboard: {
Enable: true,
},
playbooks: {
Enable: true,
},
},
EnableMarketplace: true,
EnableRemoteMarketplace: true,
@@ -670,13 +664,11 @@ const defaultServerConfig: AdminConfig = {
BoardsFeatureFlags: '',
BoardsDataRetention: false,
NormalizeLdapDNs: false,
EnableInactivityCheckJob: true,
UseCaseOnboarding: true,
GraphQL: false,
InsightsEnabled: true,
CommandPalette: false,
SendWelcomePost: true,
WorkTemplate: false,
WorkTemplate: true,
PostPriority: true,
WysiwygEditor: false,
PeopleProduct: false,
@@ -685,7 +677,9 @@ const defaultServerConfig: AdminConfig = {
ThreadsEverywhere: false,
GlobalDrafts: true,
OnboardingTourTips: true,
DeprecateCloudFree: false,
AppsSidebarCategory: false,
CloudReverseTrial: false,
},
ImportSettings: {
Directory: './import',

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

@@ -3,7 +3,9 @@
import path from 'node:path';
import {expect} from '@playwright/test';
import chalk from 'chalk';
import {ClientError} from '@mattermost/client/client4';
import {PreferenceType} from '@mattermost/types/preferences';
import testConfig from '@e2e-test.config';
@@ -77,10 +79,21 @@ export async function initSetup({
offTopicUrl: getUrl(team.name, 'off-topic'),
townSquareUrl: getUrl(team.name, 'town-square'),
};
} catch (err) {
} catch (error) {
// log an error for debugging
// eslint-disable-next-line no-console
console.log(err);
const err = error as ClientError;
if (err.message === 'Could not parse multipart form.') {
// eslint-disable-next-line no-console
console.log(chalk.yellow(`node version: ${process.version}\nNODE_OPTIONS: ${process.env.NODE_OPTIONS}`));
// eslint-disable-next-line no-console
console.log(
chalk.green(
`This failed due to the experimental fetch support in Node.js starting v18.0.0.\nYou may set environment variable: "export NODE_OPTIONS='--no-experimental-fetch'", then try again.'`
)
);
}
expect(err, 'Should not throw an error').toBeFalsy();
throw err;
}

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

@@ -18,6 +18,7 @@ export const test = base.extend<ExtendedFixtures>({
pw: async ({browser}, use) => {
const pw = new PlaywrightExtended(browser);
await use(pw);
await pw.testBrowser.close();
},
// eslint-disable-next-line no-empty-pattern
pages: async ({}, use) => {

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

@@ -16,7 +16,7 @@ export default class GlobalHeader {
async switchProduct(name: string) {
await this.productSwitchMenu.click();
await this.container.getByRole('link', {name: `${name}`}).click();
await this.container.getByRole('link', {name}).click();
}
async toBeVisible(name: string) {