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.visit(`/${testTeam.name}/channels/town-square`);
|
||||
});
|
||||
|
||||
cy.shouldHaveFeatureFlag('BoardsProduct', true);
|
||||
});
|
||||
|
||||
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 {Client, createRandomTeam, getAdminClient, getDefaultAdminUser, makeClient} from './support/server';
|
||||
import {boardsPluginId, callsPluginId} from './support/constant';
|
||||
import {defaultTeam} from './support/util';
|
||||
import testConfig from './test.config';
|
||||
|
||||
@@ -97,26 +96,15 @@ async function printClientInfo(client: Client) {
|
||||
- BuildHashEnterprise = ${config.BuildHashEnterprise}
|
||||
- BuildEnterpriseReady = ${config.BuildEnterpriseReady}
|
||||
- FeatureFlagAppsEnabled = ${config.FeatureFlagAppsEnabled}
|
||||
- FeatureFlagBoardsProduct = ${config.FeatureFlagBoardsProduct}
|
||||
- FeatureFlagCallsEnabled = ${config.FeatureFlagCallsEnabled}
|
||||
- TelemetryId = ${config.TelemetryId}`);
|
||||
}
|
||||
|
||||
function getProductsAsPlugin() {
|
||||
const productsAsPlugin = [callsPluginId];
|
||||
|
||||
if (!testConfig.boardsProductEnabled) {
|
||||
productsAsPlugin.push(boardsPluginId);
|
||||
}
|
||||
|
||||
return productsAsPlugin;
|
||||
}
|
||||
|
||||
async function ensurePluginsLoaded(client: Client) {
|
||||
const pluginStatus = await client.getPluginStatuses();
|
||||
const plugins = await client.getPlugins();
|
||||
|
||||
getProductsAsPlugin().forEach(async (pluginId) => {
|
||||
testConfig.ensurePluginsInstalled.forEach(async (pluginId) => {
|
||||
const isInstalled = pluginStatus.some((plugin) => plugin.plugin_id === pluginId);
|
||||
if (!isInstalled) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
export const appsPluginId = 'com.mattermost.apps';
|
||||
export const boardsPluginId = 'focalboard';
|
||||
export const boardsProductId = 'boards';
|
||||
export const callsPluginId = 'com.mattermost.calls';
|
||||
|
||||
@@ -5,22 +5,10 @@ import os from 'node:os';
|
||||
|
||||
import {expect, test} from '@playwright/test';
|
||||
|
||||
import {boardsPluginId, callsPluginId} from './constant';
|
||||
import {callsPluginId} from './constant';
|
||||
import {getAdminClient} from './server/init';
|
||||
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) {
|
||||
const {adminClient} = await getAdminClient();
|
||||
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 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) {
|
||||
clients[cacheKey] = {client, user};
|
||||
|
||||
@@ -6,7 +6,6 @@ import merge from 'deepmerge';
|
||||
import {
|
||||
AdminConfig,
|
||||
ExperimentalSettings,
|
||||
FeatureFlags,
|
||||
PasswordSettings,
|
||||
ServiceSettings,
|
||||
TeamSettings,
|
||||
@@ -23,7 +22,6 @@ export function getOnPremServerConfig(): AdminConfig {
|
||||
type TestAdminConfig = {
|
||||
ClusterSettings: Partial<ClusterSettings>;
|
||||
ExperimentalSettings: Partial<ExperimentalSettings>;
|
||||
FeatureFlags: Partial<FeatureFlags>;
|
||||
PasswordSettings: Partial<PasswordSettings>;
|
||||
PluginSettings: Partial<PluginSettings>;
|
||||
ServiceSettings: Partial<ServiceSettings>;
|
||||
@@ -40,9 +38,6 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
||||
ExperimentalSettings: {
|
||||
EnableAppBar: true,
|
||||
},
|
||||
FeatureFlags: {
|
||||
BoardsProduct: testConfig.boardsProductEnabled,
|
||||
},
|
||||
PasswordSettings: {
|
||||
MinimumLength: 5,
|
||||
Lowercase: false,
|
||||
@@ -57,11 +52,6 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
||||
defaultenabled: true,
|
||||
},
|
||||
},
|
||||
PluginStates: {
|
||||
focalboard: {
|
||||
Enable: !testConfig.boardsProductEnabled,
|
||||
},
|
||||
},
|
||||
},
|
||||
ServiceSettings: {
|
||||
SiteURL: testConfig.baseURL,
|
||||
@@ -686,7 +676,6 @@ const defaultServerConfig: AdminConfig = {
|
||||
GraphQL: false,
|
||||
InsightsEnabled: true,
|
||||
CommandPalette: false,
|
||||
BoardsProduct: false,
|
||||
SendWelcomePost: true,
|
||||
WorkTemplate: false,
|
||||
PostPriority: true,
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import {test as base, Browser} from '@playwright/test';
|
||||
|
||||
import {TestBrowser} from './browser_context';
|
||||
import {
|
||||
shouldHaveBoardsEnabled,
|
||||
shouldHaveCallsEnabled,
|
||||
shouldHaveFeatureFlag,
|
||||
shouldSkipInSmallScreen,
|
||||
shouldRunInLinux,
|
||||
} from './flag';
|
||||
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldSkipInSmallScreen, shouldRunInLinux} from './flag';
|
||||
import {initSetup, getAdminClient} from './server';
|
||||
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
||||
import {pages} from './ui/pages';
|
||||
@@ -36,7 +30,6 @@ class PlaywrightExtended {
|
||||
readonly testBrowser: TestBrowser;
|
||||
|
||||
// ./flag
|
||||
readonly shouldHaveBoardsEnabled;
|
||||
readonly shouldHaveCallsEnabled;
|
||||
readonly shouldHaveFeatureFlag;
|
||||
readonly shouldSkipInSmallScreen;
|
||||
@@ -62,7 +55,6 @@ class PlaywrightExtended {
|
||||
this.testBrowser = new TestBrowser(browser);
|
||||
|
||||
// ./flag
|
||||
this.shouldHaveBoardsEnabled = shouldHaveBoardsEnabled;
|
||||
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
||||
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
||||
this.shouldSkipInSmallScreen = shouldSkipInSmallScreen;
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
import {Page, ViewportSize} from '@playwright/test';
|
||||
import * as dotenv from 'dotenv';
|
||||
|
||||
import {appsPluginId, callsPluginId} from '@e2e-support/constant';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
export type TestArgs = {
|
||||
@@ -17,7 +20,7 @@ export type TestConfig = {
|
||||
adminUsername: string;
|
||||
adminPassword: string;
|
||||
adminEmail: string;
|
||||
boardsProductEnabled: boolean;
|
||||
ensurePluginsInstalled: string[];
|
||||
resetBeforeTest: boolean;
|
||||
haClusterEnabled: boolean;
|
||||
haClusterNodeCount: number;
|
||||
@@ -41,7 +44,10 @@ const config: TestConfig = {
|
||||
adminUsername: process.env.PW_ADMIN_USERNAME || 'sysadmin',
|
||||
adminPassword: process.env.PW_ADMIN_PASSWORD || 'Sys@dmin-sample1',
|
||||
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),
|
||||
haClusterNodeCount: parseNumber(process.env.PW_HA_CLUSTER_NODE_COUNT, 2),
|
||||
haClusterName: process.env.PW_HA_CLUSTER_NAME || 'mm_dev_cluster',
|
||||
|
||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
||||
shouldSkipInSmallScreen();
|
||||
|
||||
test('MM-T4274 Create an Empty Board', async ({pw, pages}) => {
|
||||
await pw.shouldHaveBoardsEnabled();
|
||||
|
||||
// Create and sign in a new user
|
||||
const {user} = await pw.initSetup();
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
||||
shouldSkipInSmallScreen();
|
||||
|
||||
test('Board template', async ({pw, pages, browserName, viewport}, testInfo) => {
|
||||
await pw.shouldHaveBoardsEnabled();
|
||||
|
||||
// Create and sign in a new user
|
||||
const {user} = await pw.initSetup();
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ import {shouldSkipInSmallScreen} from '@e2e-support/flag';
|
||||
shouldSkipInSmallScreen();
|
||||
|
||||
test('View untitled board', async ({pw, pages, browserName, viewport}, testInfo) => {
|
||||
await pw.shouldHaveBoardsEnabled();
|
||||
|
||||
// Create and sign in a new user
|
||||
const {user} = await pw.initSetup();
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user