Fix E2E test cases and setup for GHA (#26944)

* Fix E2E test cases and setup for GHA
* Fix more test cases, apply recommendations
Этот коммит содержится в:
Mario Vitale
2024-05-06 08:37:20 +02:00
коммит произвёл GitHub
родитель 8da64a5c34
Коммит c9cb3d5bb0
13 изменённых файлов: 45 добавлений и 22 удалений

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

@@ -73,12 +73,14 @@ function hoverOnChannelDescriptionAndVerifyBehavior() {
const channelDescriptionText = `test description ${getRandomId()}`;
// # Wait a little for channel to load
cy.wait(TIMEOUTS.FIVE_SEC);
cy.wait(TIMEOUTS.ONE_SEC);
// # Scan within channel header description area
cy.get('#channelHeaderDescription').should('be.visible').within(() => {
// * Verify that empty header text is visible and click it
cy.findByText('Add a channel header').should('be.visible').click();
// * Verify that empty header text is exists and click it.
// 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

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

@@ -15,7 +15,7 @@ import {checkMetrics, toggleMetricsOn} from './helper';
describe('Metrics > No license', () => {
before(() => {
cy.shouldNotRunOnCloudEdition();
cy.apiAdminLogin();
cy.apiAdminLogin().wait(50);
cy.apiDeleteLicense();
toggleMetricsOn();
});

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

@@ -51,7 +51,7 @@ function verifyCanNavigate(testCase) {
// * Verify that it redirects to the URL and matches with the header
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').
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');
// # 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
cy.get('#codeThemeSelect').scrollIntoView().should('be.visible').select(theme.name);

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

@@ -11,13 +11,19 @@
// Group: @channels @signin_authentication
describe('Login page with close server', () => {
const oldSettings = {};
before(() => {
// Disable other auth options
// Back up config, and disable other auth options
const newSettings = {
Office365Settings: {Enable: false},
LdapSettings: {Enable: false},
TeamSettings: {EnableOpenServer: false},
};
cy.apiGetConfig((config) => {
Object.entries(newSettings).forEach(([key]) => {
oldSettings[key] = config[key];
});
});
cy.apiUpdateConfig(newSettings);
// # Create new team and users
@@ -26,6 +32,10 @@ describe('Login page with close server', () => {
cy.visit('/login');
});
});
after(() => {
// Restore backed up settings
cy.apiAdminLogin().apiUpdateConfig(oldSettings);
});
it('MM-47222 Should verify access problem page can be reached', () => {
cy.findByText('Don\'t have an account?').should('be.visible').click();
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
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
cy.uiSave();

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

@@ -43,7 +43,7 @@ describe('unread_with_bottom_start_toast', () => {
// # Add enough messages
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');
@@ -78,7 +78,7 @@ describe('unread_with_bottom_start_toast', () => {
// # Add enough messages
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');
@@ -111,7 +111,7 @@ describe('unread_with_bottom_start_toast', () => {
// # Add enough messages
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);

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

@@ -15,7 +15,7 @@ export const adminConsoleNavigation = [
url: 'admin_console/billing/subscription',
},
{
type: ['cloud_enterprise', 'e20'],
type: ['cloud_enterprise'],
header: 'Billing History',
sidebar: 'Billing History',
url: 'admin_console/billing/billing_history',
@@ -49,6 +49,7 @@ export const adminConsoleNavigation = [
{
type: ['team', 'e20', 'cloud_enterprise'],
header: 'Mattermost Users',
headerSelector: '.admin-console__header #systemUsersTable-headerId',
sidebar: 'Users',
url: 'admin_console/user_management/users',
},