expect boards product by default in e2e (#22911)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
50aabf6b93
Коммит
5b5ee1160e
@@ -22,8 +22,6 @@ describe('New Channel modal with Boards enabled', () => {
|
|||||||
cy.apiLogin(sysadmin);
|
cy.apiLogin(sysadmin);
|
||||||
cy.visit(`/${testTeam.name}/channels/town-square`);
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.shouldHaveFeatureFlag('BoardsProduct', true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('MM-T5141 New Channel is created with an associated Board', () => {
|
it('MM-T5141 New Channel is created with an associated Board', () => {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import {expect} from '@playwright/test';
|
|||||||
import {UserProfile} from '@mattermost/types/users';
|
import {UserProfile} from '@mattermost/types/users';
|
||||||
|
|
||||||
import {Client, createRandomTeam, getAdminClient, getDefaultAdminUser, makeClient} from './support/server';
|
import {Client, createRandomTeam, getAdminClient, getDefaultAdminUser, makeClient} from './support/server';
|
||||||
import {boardsPluginId, callsPluginId} from './support/constant';
|
|
||||||
import {defaultTeam} from './support/util';
|
import {defaultTeam} from './support/util';
|
||||||
import testConfig from './test.config';
|
import testConfig from './test.config';
|
||||||
|
|
||||||
@@ -97,26 +96,15 @@ async function printClientInfo(client: Client) {
|
|||||||
- BuildHashEnterprise = ${config.BuildHashEnterprise}
|
- BuildHashEnterprise = ${config.BuildHashEnterprise}
|
||||||
- BuildEnterpriseReady = ${config.BuildEnterpriseReady}
|
- BuildEnterpriseReady = ${config.BuildEnterpriseReady}
|
||||||
- FeatureFlagAppsEnabled = ${config.FeatureFlagAppsEnabled}
|
- FeatureFlagAppsEnabled = ${config.FeatureFlagAppsEnabled}
|
||||||
- FeatureFlagBoardsProduct = ${config.FeatureFlagBoardsProduct}
|
|
||||||
- FeatureFlagCallsEnabled = ${config.FeatureFlagCallsEnabled}
|
- FeatureFlagCallsEnabled = ${config.FeatureFlagCallsEnabled}
|
||||||
- TelemetryId = ${config.TelemetryId}`);
|
- TelemetryId = ${config.TelemetryId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProductsAsPlugin() {
|
|
||||||
const productsAsPlugin = [callsPluginId];
|
|
||||||
|
|
||||||
if (!testConfig.boardsProductEnabled) {
|
|
||||||
productsAsPlugin.push(boardsPluginId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return productsAsPlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function ensurePluginsLoaded(client: Client) {
|
async function ensurePluginsLoaded(client: Client) {
|
||||||
const pluginStatus = await client.getPluginStatuses();
|
const pluginStatus = await client.getPluginStatuses();
|
||||||
const plugins = await client.getPlugins();
|
const plugins = await client.getPlugins();
|
||||||
|
|
||||||
getProductsAsPlugin().forEach(async (pluginId) => {
|
testConfig.ensurePluginsInstalled.forEach(async (pluginId) => {
|
||||||
const isInstalled = pluginStatus.some((plugin) => plugin.plugin_id === pluginId);
|
const isInstalled = pluginStatus.some((plugin) => plugin.plugin_id === pluginId);
|
||||||
if (!isInstalled) {
|
if (!isInstalled) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
export const appsPluginId = 'com.mattermost.apps';
|
||||||
export const boardsPluginId = 'focalboard';
|
export const boardsPluginId = 'focalboard';
|
||||||
export const boardsProductId = 'boards';
|
export const boardsProductId = 'boards';
|
||||||
export const callsPluginId = 'com.mattermost.calls';
|
export const callsPluginId = 'com.mattermost.calls';
|
||||||
|
|||||||
@@ -5,22 +5,10 @@ import os from 'node:os';
|
|||||||
|
|
||||||
import {expect, test} from '@playwright/test';
|
import {expect, test} from '@playwright/test';
|
||||||
|
|
||||||
import {boardsPluginId, callsPluginId} from './constant';
|
import {callsPluginId} from './constant';
|
||||||
import {getAdminClient} from './server/init';
|
import {getAdminClient} from './server/init';
|
||||||
import {isSmallScreen} from './util';
|
import {isSmallScreen} from './util';
|
||||||
|
|
||||||
export async function shouldHaveBoardsEnabled(enabled = true) {
|
|
||||||
const {adminClient} = await getAdminClient();
|
|
||||||
const config = await adminClient.getConfig();
|
|
||||||
|
|
||||||
const boardsEnabled =
|
|
||||||
(typeof config.FeatureFlags.BoardsProduct === 'boolean' && config.FeatureFlags.BoardsProduct) ||
|
|
||||||
config.PluginSettings.PluginStates[boardsPluginId].Enable;
|
|
||||||
|
|
||||||
const matched = boardsEnabled === enabled;
|
|
||||||
expect(matched, matched ? '' : `Boards expect "${enabled}" but actual "${boardsEnabled}"`).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function shouldHaveCallsEnabled(enabled = true) {
|
export async function shouldHaveCallsEnabled(enabled = true) {
|
||||||
const {adminClient} = await getAdminClient();
|
const {adminClient} = await getAdminClient();
|
||||||
const config = await adminClient.getConfig();
|
const config = await adminClient.getConfig();
|
||||||
|
|||||||
@@ -167,8 +167,9 @@ async function makeClient(userRequest?: UserRequest, useCache = true): Promise<C
|
|||||||
|
|
||||||
const userProfile = await client.login(userRequest.username, userRequest.password);
|
const userProfile = await client.login(userRequest.username, userRequest.password);
|
||||||
const user = {...userProfile, password: userRequest.password};
|
const user = {...userProfile, password: userRequest.password};
|
||||||
const config = await client.getClientConfigOld();
|
|
||||||
client.setUseBoardsProduct(config.FeatureFlagBoardsProduct === 'true');
|
// Manually do until boards as product is consistent in all the codebase.
|
||||||
|
client.setUseBoardsProduct(true);
|
||||||
|
|
||||||
if (useCache) {
|
if (useCache) {
|
||||||
clients[cacheKey] = {client, user};
|
clients[cacheKey] = {client, user};
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import merge from 'deepmerge';
|
|||||||
import {
|
import {
|
||||||
AdminConfig,
|
AdminConfig,
|
||||||
ExperimentalSettings,
|
ExperimentalSettings,
|
||||||
FeatureFlags,
|
|
||||||
PasswordSettings,
|
PasswordSettings,
|
||||||
ServiceSettings,
|
ServiceSettings,
|
||||||
TeamSettings,
|
TeamSettings,
|
||||||
@@ -23,7 +22,6 @@ export function getOnPremServerConfig(): AdminConfig {
|
|||||||
type TestAdminConfig = {
|
type TestAdminConfig = {
|
||||||
ClusterSettings: Partial<ClusterSettings>;
|
ClusterSettings: Partial<ClusterSettings>;
|
||||||
ExperimentalSettings: Partial<ExperimentalSettings>;
|
ExperimentalSettings: Partial<ExperimentalSettings>;
|
||||||
FeatureFlags: Partial<FeatureFlags>;
|
|
||||||
PasswordSettings: Partial<PasswordSettings>;
|
PasswordSettings: Partial<PasswordSettings>;
|
||||||
PluginSettings: Partial<PluginSettings>;
|
PluginSettings: Partial<PluginSettings>;
|
||||||
ServiceSettings: Partial<ServiceSettings>;
|
ServiceSettings: Partial<ServiceSettings>;
|
||||||
@@ -40,9 +38,6 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
|||||||
ExperimentalSettings: {
|
ExperimentalSettings: {
|
||||||
EnableAppBar: true,
|
EnableAppBar: true,
|
||||||
},
|
},
|
||||||
FeatureFlags: {
|
|
||||||
BoardsProduct: testConfig.boardsProductEnabled,
|
|
||||||
},
|
|
||||||
PasswordSettings: {
|
PasswordSettings: {
|
||||||
MinimumLength: 5,
|
MinimumLength: 5,
|
||||||
Lowercase: false,
|
Lowercase: false,
|
||||||
@@ -57,11 +52,6 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
|||||||
defaultenabled: true,
|
defaultenabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
PluginStates: {
|
|
||||||
focalboard: {
|
|
||||||
Enable: !testConfig.boardsProductEnabled,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
ServiceSettings: {
|
ServiceSettings: {
|
||||||
SiteURL: testConfig.baseURL,
|
SiteURL: testConfig.baseURL,
|
||||||
@@ -686,7 +676,6 @@ const defaultServerConfig: AdminConfig = {
|
|||||||
GraphQL: false,
|
GraphQL: false,
|
||||||
InsightsEnabled: true,
|
InsightsEnabled: true,
|
||||||
CommandPalette: false,
|
CommandPalette: false,
|
||||||
BoardsProduct: false,
|
|
||||||
SendWelcomePost: true,
|
SendWelcomePost: true,
|
||||||
WorkTemplate: false,
|
WorkTemplate: false,
|
||||||
PostPriority: true,
|
PostPriority: true,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import {test as base, Browser} from '@playwright/test';
|
import {test as base, Browser} from '@playwright/test';
|
||||||
|
|
||||||
import {TestBrowser} from './browser_context';
|
import {TestBrowser} from './browser_context';
|
||||||
import {
|
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldSkipInSmallScreen, shouldRunInLinux} from './flag';
|
||||||
shouldHaveBoardsEnabled,
|
|
||||||
shouldHaveCallsEnabled,
|
|
||||||
shouldHaveFeatureFlag,
|
|
||||||
shouldSkipInSmallScreen,
|
|
||||||
shouldRunInLinux,
|
|
||||||
} from './flag';
|
|
||||||
import {initSetup, getAdminClient} from './server';
|
import {initSetup, getAdminClient} from './server';
|
||||||
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
||||||
import {pages} from './ui/pages';
|
import {pages} from './ui/pages';
|
||||||
@@ -36,7 +30,6 @@ class PlaywrightExtended {
|
|||||||
readonly testBrowser: TestBrowser;
|
readonly testBrowser: TestBrowser;
|
||||||
|
|
||||||
// ./flag
|
// ./flag
|
||||||
readonly shouldHaveBoardsEnabled;
|
|
||||||
readonly shouldHaveCallsEnabled;
|
readonly shouldHaveCallsEnabled;
|
||||||
readonly shouldHaveFeatureFlag;
|
readonly shouldHaveFeatureFlag;
|
||||||
readonly shouldSkipInSmallScreen;
|
readonly shouldSkipInSmallScreen;
|
||||||
@@ -62,7 +55,6 @@ class PlaywrightExtended {
|
|||||||
this.testBrowser = new TestBrowser(browser);
|
this.testBrowser = new TestBrowser(browser);
|
||||||
|
|
||||||
// ./flag
|
// ./flag
|
||||||
this.shouldHaveBoardsEnabled = shouldHaveBoardsEnabled;
|
|
||||||
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
||||||
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
||||||
this.shouldSkipInSmallScreen = shouldSkipInSmallScreen;
|
this.shouldSkipInSmallScreen = shouldSkipInSmallScreen;
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
import {Page, ViewportSize} from '@playwright/test';
|
import {Page, ViewportSize} from '@playwright/test';
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
|
|
||||||
|
import {appsPluginId, callsPluginId} from '@e2e-support/constant';
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
export type TestArgs = {
|
export type TestArgs = {
|
||||||
@@ -17,7 +20,7 @@ export type TestConfig = {
|
|||||||
adminUsername: string;
|
adminUsername: string;
|
||||||
adminPassword: string;
|
adminPassword: string;
|
||||||
adminEmail: string;
|
adminEmail: string;
|
||||||
boardsProductEnabled: boolean;
|
ensurePluginsInstalled: string[];
|
||||||
resetBeforeTest: boolean;
|
resetBeforeTest: boolean;
|
||||||
haClusterEnabled: boolean;
|
haClusterEnabled: boolean;
|
||||||
haClusterNodeCount: number;
|
haClusterNodeCount: number;
|
||||||
@@ -41,7 +44,10 @@ const config: TestConfig = {
|
|||||||
adminUsername: process.env.PW_ADMIN_USERNAME || 'sysadmin',
|
adminUsername: process.env.PW_ADMIN_USERNAME || 'sysadmin',
|
||||||
adminPassword: process.env.PW_ADMIN_PASSWORD || 'Sys@dmin-sample1',
|
adminPassword: process.env.PW_ADMIN_PASSWORD || 'Sys@dmin-sample1',
|
||||||
adminEmail: process.env.PW_ADMIN_EMAIL || 'sysadmin@sample.mattermost.com',
|
adminEmail: process.env.PW_ADMIN_EMAIL || 'sysadmin@sample.mattermost.com',
|
||||||
boardsProductEnabled: parseBool(process.env.PW_BOARDS_PRODUCT_ENABLED, true),
|
ensurePluginsInstalled:
|
||||||
|
typeof process.env?.PW_ENSURE_PLUGINS_INSTALLED === 'string'
|
||||||
|
? process.env.PW_ENSURE_PLUGINS_INSTALLED.split(',')
|
||||||
|
: [appsPluginId, callsPluginId],
|
||||||
haClusterEnabled: parseBool(process.env.PW_HA_CLUSTER_ENABLED, false),
|
haClusterEnabled: parseBool(process.env.PW_HA_CLUSTER_ENABLED, false),
|
||||||
haClusterNodeCount: parseNumber(process.env.PW_HA_CLUSTER_NODE_COUNT, 2),
|
haClusterNodeCount: parseNumber(process.env.PW_HA_CLUSTER_NODE_COUNT, 2),
|
||||||
haClusterName: process.env.PW_HA_CLUSTER_NAME || 'mm_dev_cluster',
|
haClusterName: process.env.PW_HA_CLUSTER_NAME || 'mm_dev_cluster',
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
|||||||
shouldSkipInSmallScreen();
|
shouldSkipInSmallScreen();
|
||||||
|
|
||||||
test('MM-T4274 Create an Empty Board', async ({pw, pages}) => {
|
test('MM-T4274 Create an Empty Board', async ({pw, pages}) => {
|
||||||
await pw.shouldHaveBoardsEnabled();
|
|
||||||
|
|
||||||
// Create and sign in a new user
|
// Create and sign in a new user
|
||||||
const {user} = await pw.initSetup();
|
const {user} = await pw.initSetup();
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
|||||||
shouldSkipInSmallScreen();
|
shouldSkipInSmallScreen();
|
||||||
|
|
||||||
test('Board template', async ({pw, pages, browserName, viewport}, testInfo) => {
|
test('Board template', async ({pw, pages, browserName, viewport}, testInfo) => {
|
||||||
await pw.shouldHaveBoardsEnabled();
|
|
||||||
|
|
||||||
// Create and sign in a new user
|
// Create and sign in a new user
|
||||||
const {user} = await pw.initSetup();
|
const {user} = await pw.initSetup();
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
|||||||
shouldSkipInSmallScreen();
|
shouldSkipInSmallScreen();
|
||||||
|
|
||||||
test('View untitled board', async ({pw, pages, browserName, viewport}, testInfo) => {
|
test('View untitled board', async ({pw, pages, browserName, viewport}, testInfo) => {
|
||||||
await pw.shouldHaveBoardsEnabled();
|
|
||||||
|
|
||||||
// Create and sign in a new user
|
// Create and sign in a new user
|
||||||
const {user} = await pw.initSetup();
|
const {user} = await pw.initSetup();
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user