e2e/fix: enable skipped tests in playbooks (#23102)

Этот коммит содержится в:
Saturnino Abril
2023-04-27 14:25:16 +08:00
коммит произвёл GitHub
родитель fc50bd450e
Коммит 0147a1e781
10 изменённых файлов: 48 добавлений и 97 удалений

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

@@ -9,71 +9,45 @@
// Stage: @prod
// Group: @playbooks
import {onlyOn} from '@cypress/skip-test';
describe('channels > App Bar', {testIsolation: true}, () => {
let testTeam;
let testUser;
let testPlaybook;
let appBarEnabled;
before(() => {
cy.apiInitSetup().then(({team, user}) => {
testTeam = team;
testUser = user;
// # Login as testUser
cy.apiLogin(testUser);
// # Create a playbook
cy.apiCreateTestPlaybook({
teamId: testTeam.id,
title: 'Playbook',
userId: testUser.id,
}).then((playbook) => {
testPlaybook = playbook;
// # Start a playbook run
cy.apiRunPlaybook({
teamId: testTeam.id,
playbookId: testPlaybook.id,
playbookRunName: 'Playbook Run',
ownerUserId: testUser.id,
});
});
cy.apiGetConfig(true).then(({config}) => {
appBarEnabled = config.EnableAppBar === 'true';
});
});
});
beforeEach(() => {
// # Size the viewport to show the RHS without covering posts.
cy.viewport('macbook-13');
// # Login as testUser
cy.apiLogin(testUser);
cy.apiAdminLogin();
});
describe('App Bar disabled', () => {
it('should not show the Playbook App Bar icon', () => {
onlyOn(!appBarEnabled);
cy.apiUpdateConfig({ExperimentalSettings: {EnableAppBar: false}});
// # Login as testUser
cy.apiLogin(testUser);
// # Navigate directly to a non-playbook run channel
cy.visit(`/${testTeam.name}/channels/town-square`);
// * Verify App Bar icon is not showing
cy.get('#channel_view').within(() => {
cy.getPlaybooksAppBarIcon().should('not.exist');
});
cy.get('.app-bar').should('not.exist');
});
});
describe('App Bar enabled', () => {
it('should show the Playbook App Bar icon', () => {
onlyOn(appBarEnabled);
beforeEach(() => {
cy.apiUpdateConfig({ExperimentalSettings: {EnableAppBar: true}});
// # Login as testUser
cy.apiLogin(testUser);
});
it('should show the Playbook App Bar icon', () => {
// # Navigate directly to a non-playbook run channel
cy.visit(`/${testTeam.name}/channels/town-square`);
@@ -82,8 +56,6 @@ describe('channels > App Bar', {testIsolation: true}, () => {
});
it('should show "Playbooks" tooltip for Playbook App Bar icon', () => {
onlyOn(appBarEnabled);
// # Navigate directly to a non-playbook run channel
cy.visit(`/${testTeam.name}/channels/town-square`);

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

@@ -9,14 +9,11 @@
// Stage: @prod
// Group: @playbooks
import {onlyOn} from '@cypress/skip-test';
describe('channels > channel header', {testIsolation: true}, () => {
let testTeam;
let testUser;
let testPlaybook;
let testPlaybookRun;
let appBarEnabled;
before(() => {
cy.apiInitSetup().then(({team, user}) => {
@@ -44,24 +41,16 @@ describe('channels > channel header', {testIsolation: true}, () => {
testPlaybookRun = run;
});
});
cy.apiGetConfig(true).then(({config}) => {
appBarEnabled = config.EnableAppBar === 'true';
});
});
});
beforeEach(() => {
// # Size the viewport to show the RHS without covering posts.
cy.viewport('macbook-13');
// # Login as testUser
cy.apiLogin(testUser);
});
describe('App Bar enabled', () => {
it('webapp should hide the Playbook channel header button', () => {
onlyOn(appBarEnabled);
cy.apiAdminLogin();
cy.apiUpdateConfig({ExperimentalSettings: {EnableAppBar: true}});
// # Login as testUser
cy.apiLogin(testUser);
// # Navigate directly to a non-playbook run channel
cy.visit(`/${testTeam.name}/channels/town-square`);
@@ -74,9 +63,15 @@ describe('channels > channel header', {testIsolation: true}, () => {
});
describe('App Bar disabled', () => {
it('webapp should show the Playbook channel header button', () => {
onlyOn(!appBarEnabled);
beforeEach(() => {
cy.apiAdminLogin();
cy.apiUpdateConfig({ExperimentalSettings: {EnableAppBar: false}});
// # Login as testUser
cy.apiLogin(testUser);
});
it('webapp should show the Playbook channel header button', () => {
// # Navigate directly to a non-playbook run channel
cy.visit(`/${testTeam.name}/channels/town-square`);
@@ -87,8 +82,6 @@ describe('channels > channel header', {testIsolation: true}, () => {
});
it('tooltip text should show "Playbooks" for Playbook channel header button', () => {
onlyOn(!appBarEnabled);
// # Navigate directly to a non-playbook run channel
cy.visit(`/${testTeam.name}/channels/town-square`);
@@ -103,6 +96,11 @@ describe('channels > channel header', {testIsolation: true}, () => {
});
describe('description text', () => {
beforeEach(() => {
// # Login as testUser
cy.apiLogin(testUser);
});
it('should contain a link to the playbook', () => {
// # Navigate directly to a playbook run channel
cy.visit(`/${testTeam.name}/channels/playbook-run`);
@@ -112,6 +110,7 @@ describe('channels > channel header', {testIsolation: true}, () => {
expect(href).to.equals(`/playbooks/playbooks/${testPlaybook.id}`);
});
});
it('should contain a link to the overview page', () => {
// # Navigate directly to a playbook run channel
cy.visit(`/${testTeam.name}/channels/playbook-run`);

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

@@ -82,7 +82,7 @@ describe('channels > rhs > status update', {testIsolation: true}, () => {
});
});
it.skip('description link navigates to run overview', () => {
it('description link navigates to run overview', () => {
// # Run the `/playbook update` slash command.
cy.uiPostMessageQuickly('/playbook update');