Fix E2E test cases and setup for GHA (#26944)
* Fix E2E test cases and setup for GHA * Fix more test cases, apply recommendations
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8da64a5c34
Коммит
c9cb3d5bb0
@@ -52,7 +52,7 @@ mme2e_wait_service_healthy () {
|
|||||||
SERVICE_NAME=${1?}
|
SERVICE_NAME=${1?}
|
||||||
RETRIES_LEFT=${2:-1}
|
RETRIES_LEFT=${2:-1}
|
||||||
RETRIES_INTERVAL=${3:-10}
|
RETRIES_INTERVAL=${3:-10}
|
||||||
mme2e_wait_command_success "${DC_COMMAND} ps ${SERVICE_NAME} | grep -q '\(healthy\)'" "Waiting for ${SERVICE_NAME} container to be healthy" "$RETRIES_LEFT" "$RETRIES_INTERVAL"
|
mme2e_wait_command_success "${DC_COMMAND} ps ${SERVICE_NAME} | grep -qE '\(healthy\)'" "Waiting for ${SERVICE_NAME} container to be healthy" "$RETRIES_LEFT" "$RETRIES_INTERVAL"
|
||||||
}
|
}
|
||||||
mme2e_wait_image () {
|
mme2e_wait_image () {
|
||||||
IMAGE_NAME=${1?}
|
IMAGE_NAME=${1?}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
---
|
---
|
||||||
version: "3.1"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
dashboard:
|
dashboard:
|
||||||
image: mattermostdevelopment/mirrored-node:18.17
|
image: mattermostdevelopment/mirrored-node:18.17
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ generate_docker_compose_file() {
|
|||||||
# Image hashes in this file are for amd64 systems
|
# Image hashes in this file are for amd64 systems
|
||||||
# NB: May include paths relative to the "server/build" directory, which contains the original compose file that this yaml is overriding
|
# NB: May include paths relative to the "server/build" directory, which contains the original compose file that this yaml is overriding
|
||||||
|
|
||||||
version: "2.4"
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: \${SERVER_IMAGE}
|
image: \${SERVER_IMAGE}
|
||||||
@@ -56,16 +55,10 @@ services:
|
|||||||
MM_SERVICESETTINGS_ALLOWCORSFROM: "*"
|
MM_SERVICESETTINGS_ALLOWCORSFROM: "*"
|
||||||
MM_SERVICESETTINGS_ENABLELOCALMODE: "true"
|
MM_SERVICESETTINGS_ENABLELOCALMODE: "true"
|
||||||
MM_SERVICESETTINGS_ENABLESECURITYFIXALERT: "false"
|
MM_SERVICESETTINGS_ENABLESECURITYFIXALERT: "false"
|
||||||
MM_PLUGINSETTINGS_ENABLED: "true"
|
|
||||||
MM_PLUGINSETTINGS_ENABLEUPLOADS: "true"
|
|
||||||
MM_PLUGINSETTINGS_AUTOMATICPREPACKAGEDPLUGINS: "true"
|
|
||||||
MM_TEAMSETTINGS_ENABLEOPENSERVER: "true"
|
|
||||||
MM_SQLSETTINGS_DATASOURCE: "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes"
|
MM_SQLSETTINGS_DATASOURCE: "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes"
|
||||||
MM_SQLSETTINGS_DRIVERNAME: "postgres"
|
MM_SQLSETTINGS_DRIVERNAME: "postgres"
|
||||||
MM_EMAILSETTINGS_SMTPSERVER: "localhost"
|
MM_EMAILSETTINGS_SMTPSERVER: "localhost"
|
||||||
MM_CLUSTERSETTINGS_READONLYCONFIG: "false"
|
MM_CLUSTERSETTINGS_READONLYCONFIG: "false"
|
||||||
MM_SERVICESETTINGS_ENABLEONBOARDINGFLOW: "false"
|
|
||||||
MM_FEATUREFLAGS_ONBOARDINGTOURTIPS: "false"
|
|
||||||
MM_SERVICEENVIRONMENT: "test"
|
MM_SERVICEENVIRONMENT: "test"
|
||||||
MM_FEATUREFLAGS_MOVETHREADSENABLED: "true"
|
MM_FEATUREFLAGS_MOVETHREADSENABLED: "true"
|
||||||
MM_LOGSETTINGS_ENABLEDIAGNOSTICS: "false"
|
MM_LOGSETTINGS_ENABLEDIAGNOSTICS: "false"
|
||||||
|
|||||||
@@ -3,6 +3,16 @@ set -e -u -o pipefail
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
. .e2erc
|
. .e2erc
|
||||||
|
|
||||||
|
mme2e_log "Configuring starting server parameters that may be changed at runtime"
|
||||||
|
for SETTING in \
|
||||||
|
TeamSettings.EnableOpenServer=true \
|
||||||
|
PluginSettings.Enable=true \
|
||||||
|
PluginSettings.EnableUploads=true \
|
||||||
|
PluginSettings.AutomaticPrepackagedPlugins=true
|
||||||
|
do
|
||||||
|
mme2e_log "Configuring parameter: $SETTING"
|
||||||
|
${MME2E_DC_SERVER} exec -T -- server mmctl --local config set $(tr = ' ' <<<$SETTING)
|
||||||
|
done
|
||||||
if [ -n "${MM_LICENSE:-}" ]; then
|
if [ -n "${MM_LICENSE:-}" ]; then
|
||||||
# We prefer uploading the license here, instead of setting the env var for the server
|
# We prefer uploading the license here, instead of setting the env var for the server
|
||||||
# This is to retain the flexibility of being able to remove it programmatically, if the tests require it
|
# This is to retain the flexibility of being able to remove it programmatically, if the tests require it
|
||||||
|
|||||||
@@ -19,4 +19,13 @@ if ! mme2e_wait_service_healthy server 60 10; then
|
|||||||
mme2e_log "Mattermost container not healthy, retry attempts exhausted. Giving up." >&2
|
mme2e_log "Mattermost container not healthy, retry attempts exhausted. Giving up." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
for MIGRATION in migration_advanced_permissions_phase_2; do
|
||||||
|
# Query explanation: if it doesn't find the migration in the table, there are 0 results and the command fails with a divide-by-zero error. Otherwise the command succeeds
|
||||||
|
MIGRATION_CHECK_COMMAND="${MME2E_DC_SERVER} exec -T -- postgres psql -U mmuser mattermost_test -c \"select 1 / (select count(*) from Systems where name = '${MIGRATION}' and value = 'true');\""
|
||||||
|
if ! mme2e_wait_command_success "$MIGRATION_CHECK_COMMAND >/dev/null 2>&1" "Waiting for migration to be completed: ${MIGRATION}" "30" "10"; then
|
||||||
|
mme2e_log "Migration ${MIGRATION} not completed, retry attempts exhausted. Giving up." >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
mme2e_log "${MIGRATION}: completed."
|
||||||
|
done
|
||||||
mme2e_log "Mattermost container is running and healthy"
|
mme2e_log "Mattermost container is running and healthy"
|
||||||
|
|||||||
@@ -73,12 +73,14 @@ function hoverOnChannelDescriptionAndVerifyBehavior() {
|
|||||||
const channelDescriptionText = `test description ${getRandomId()}`;
|
const channelDescriptionText = `test description ${getRandomId()}`;
|
||||||
|
|
||||||
// # Wait a little for channel to load
|
// # Wait a little for channel to load
|
||||||
cy.wait(TIMEOUTS.FIVE_SEC);
|
cy.wait(TIMEOUTS.ONE_SEC);
|
||||||
|
|
||||||
// # Scan within channel header description area
|
// # Scan within channel header description area
|
||||||
cy.get('#channelHeaderDescription').should('be.visible').within(() => {
|
cy.get('#channelHeaderDescription').should('be.visible').within(() => {
|
||||||
// * Verify that empty header text is visible and click it
|
// * Verify that empty header text is exists and click it.
|
||||||
cy.findByText('Add a channel header').should('be.visible').click();
|
// Note that it is invisible until the mouse hovers it, which is unfeasible in Cypress
|
||||||
|
// https://docs.cypress.io/api/commands/hover
|
||||||
|
cy.findByText('Add a channel header').click({force: true});
|
||||||
});
|
});
|
||||||
|
|
||||||
// # Scan inside the channel header modal
|
// # Scan inside the channel header modal
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {checkMetrics, toggleMetricsOn} from './helper';
|
|||||||
describe('Metrics > No license', () => {
|
describe('Metrics > No license', () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.shouldNotRunOnCloudEdition();
|
cy.shouldNotRunOnCloudEdition();
|
||||||
cy.apiAdminLogin();
|
cy.apiAdminLogin().wait(50);
|
||||||
cy.apiDeleteLicense();
|
cy.apiDeleteLicense();
|
||||||
toggleMetricsOn();
|
toggleMetricsOn();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ function verifyCanNavigate(testCase) {
|
|||||||
|
|
||||||
// * Verify that it redirects to the URL and matches with the header
|
// * Verify that it redirects to the URL and matches with the header
|
||||||
cy.url().should('include', testCase.url);
|
cy.url().should('include', testCase.url);
|
||||||
cy.get('.admin-console__header', {timeout: TIMEOUTS.ONE_MIN}).
|
cy.get(`${testCase.headerSelector || '.admin-console__header'}`, {timeout: TIMEOUTS.ONE_MIN}).
|
||||||
should('be.visible').
|
should('be.visible').
|
||||||
and(testCase.headerContains ? 'contain' : 'have.text', testCase.header);
|
and(testCase.headerContains ? 'contain' : 'have.text', testCase.header);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('Settings > Display > Theme > Custom Theme Colors', () => {
|
|||||||
cy.get('#customThemes').check().should('be.checked');
|
cy.get('#customThemes').check().should('be.checked');
|
||||||
|
|
||||||
// # Open Center Channel Styles section
|
// # Open Center Channel Styles section
|
||||||
cy.get('#centerChannelStyles').click({force: true});
|
cy.get('#centerChannelStyles').click({force: true}).wait(TIMEOUTS.ONE_HUNDRED_MILLIS);
|
||||||
|
|
||||||
// # Select custom code theme
|
// # Select custom code theme
|
||||||
cy.get('#codeThemeSelect').scrollIntoView().should('be.visible').select(theme.name);
|
cy.get('#codeThemeSelect').scrollIntoView().should('be.visible').select(theme.name);
|
||||||
|
|||||||
@@ -11,13 +11,19 @@
|
|||||||
// Group: @channels @signin_authentication
|
// Group: @channels @signin_authentication
|
||||||
|
|
||||||
describe('Login page with close server', () => {
|
describe('Login page with close server', () => {
|
||||||
|
const oldSettings = {};
|
||||||
before(() => {
|
before(() => {
|
||||||
// Disable other auth options
|
// Back up config, and disable other auth options
|
||||||
const newSettings = {
|
const newSettings = {
|
||||||
Office365Settings: {Enable: false},
|
Office365Settings: {Enable: false},
|
||||||
LdapSettings: {Enable: false},
|
LdapSettings: {Enable: false},
|
||||||
TeamSettings: {EnableOpenServer: false},
|
TeamSettings: {EnableOpenServer: false},
|
||||||
};
|
};
|
||||||
|
cy.apiGetConfig((config) => {
|
||||||
|
Object.entries(newSettings).forEach(([key]) => {
|
||||||
|
oldSettings[key] = config[key];
|
||||||
|
});
|
||||||
|
});
|
||||||
cy.apiUpdateConfig(newSettings);
|
cy.apiUpdateConfig(newSettings);
|
||||||
|
|
||||||
// # Create new team and users
|
// # Create new team and users
|
||||||
@@ -26,6 +32,10 @@ describe('Login page with close server', () => {
|
|||||||
cy.visit('/login');
|
cy.visit('/login');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
after(() => {
|
||||||
|
// Restore backed up settings
|
||||||
|
cy.apiAdminLogin().apiUpdateConfig(oldSettings);
|
||||||
|
});
|
||||||
it('MM-47222 Should verify access problem page can be reached', () => {
|
it('MM-47222 Should verify access problem page can be reached', () => {
|
||||||
cy.findByText('Don\'t have an account?').should('be.visible').click();
|
cy.findByText('Don\'t have an account?').should('be.visible').click();
|
||||||
cy.findByText('Contact your workspace admin').should('be.visible');
|
cy.findByText('Contact your workspace admin').should('be.visible');
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ describe('Team Settings', () => {
|
|||||||
|
|
||||||
// # Set 'sample.mattermost.com' as the only allowed email domain and save
|
// # Set 'sample.mattermost.com' as the only allowed email domain and save
|
||||||
cy.get('#allowedDomains').click().type(emailDomain).type(' ');
|
cy.get('#allowedDomains').click().type(emailDomain).type(' ');
|
||||||
cy.findByText('Save').should('be.visible').click();
|
cy.findByText('Save').should('be.visible');
|
||||||
|
|
||||||
// # Save and verify it took effect
|
// # Save and verify it took effect
|
||||||
cy.uiSave();
|
cy.uiSave();
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ describe('unread_with_bottom_start_toast', () => {
|
|||||||
|
|
||||||
// # Add enough messages
|
// # Add enough messages
|
||||||
for (let index = 0; index < 30; index++) {
|
for (let index = 0; index < 30; index++) {
|
||||||
cy.postMessageAs({sender: otherUser, message: `test message ${index}`, channelId: channel.id});
|
cy.postMessageAs({sender: otherUser, message: `test message ${index}`, channelId: channel.id}).wait(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
cy.postMessage('hello');
|
cy.postMessage('hello');
|
||||||
@@ -78,7 +78,7 @@ describe('unread_with_bottom_start_toast', () => {
|
|||||||
|
|
||||||
// # Add enough messages
|
// # Add enough messages
|
||||||
for (let index = 0; index < 30; index++) {
|
for (let index = 0; index < 30; index++) {
|
||||||
cy.postMessageAs({sender: otherUser, message: `test message ${index}`, channelId: channel.id});
|
cy.postMessageAs({sender: otherUser, message: `test message ${index}`, channelId: channel.id}).wait(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
cy.postMessage('hello');
|
cy.postMessage('hello');
|
||||||
@@ -111,7 +111,7 @@ describe('unread_with_bottom_start_toast', () => {
|
|||||||
|
|
||||||
// # Add enough messages
|
// # Add enough messages
|
||||||
for (let index = 0; index < 30; index++) {
|
for (let index = 0; index < 30; index++) {
|
||||||
cy.postMessageAs({sender: otherUser, message: `test message ${index}`, channelId: channel.id});
|
cy.postMessageAs({sender: otherUser, message: `test message ${index}`, channelId: channel.id}).wait(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
cy.wait(TIMEOUTS.ONE_SEC);
|
cy.wait(TIMEOUTS.ONE_SEC);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const adminConsoleNavigation = [
|
|||||||
url: 'admin_console/billing/subscription',
|
url: 'admin_console/billing/subscription',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: ['cloud_enterprise', 'e20'],
|
type: ['cloud_enterprise'],
|
||||||
header: 'Billing History',
|
header: 'Billing History',
|
||||||
sidebar: 'Billing History',
|
sidebar: 'Billing History',
|
||||||
url: 'admin_console/billing/billing_history',
|
url: 'admin_console/billing/billing_history',
|
||||||
@@ -49,6 +49,7 @@ export const adminConsoleNavigation = [
|
|||||||
{
|
{
|
||||||
type: ['team', 'e20', 'cloud_enterprise'],
|
type: ['team', 'e20', 'cloud_enterprise'],
|
||||||
header: 'Mattermost Users',
|
header: 'Mattermost Users',
|
||||||
|
headerSelector: '.admin-console__header #systemUsersTable-headerId',
|
||||||
sidebar: 'Users',
|
sidebar: 'Users',
|
||||||
url: 'admin_console/user_management/users',
|
url: 'admin_console/user_management/users',
|
||||||
},
|
},
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user