MM-52487: fix more playbooks tests (#23475)
* fix playbooks/channels/rhs/template_spec.js * fix playbooks/channels/update_request_post_spec.js * fix playbooks/runs/rdp_rhs_runinfo_spec.js * fix playbooks/runs/rdp_rhs_statusupdates_spec.js * remove enableexperimentalfeatures flag in e2e tests * rdp_main_header_spec: simplify channel loaded assertion * playbooks rhs participants: fix infinite fetch loop * improved onboarding skipping * simplify participants fetching
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
36027ac1c4
Коммит
803d0c6e60
@@ -34,10 +34,6 @@ describe('channels > rhs > template', {testIsolation: true}, () => {
|
||||
// # Switch to playbooks DM channel
|
||||
cy.visit(`/${team1.name}/messages/@playbooks`);
|
||||
|
||||
// * Checking the bot badge as an indicator of page
|
||||
// * stability / rendering finished
|
||||
cy.findByText('BOT').should('be.visible');
|
||||
|
||||
// # Open playbooks RHS.
|
||||
cy.getPlaybooksAppBarIcon().should('be.visible').click();
|
||||
|
||||
@@ -58,10 +54,6 @@ describe('channels > rhs > template', {testIsolation: true}, () => {
|
||||
// # Switch to playbooks DM channel
|
||||
cy.visit(`/${team1.name}/messages/@playbooks`);
|
||||
|
||||
// * Checking the bot badge as an indicator of page
|
||||
// * stability / rendering finished
|
||||
cy.findByText('BOT').should('be.visible');
|
||||
|
||||
// # Open playbooks RHS.
|
||||
cy.getPlaybooksAppBarIcon().should('be.visible').click();
|
||||
|
||||
|
||||
@@ -19,6 +19,13 @@ describe('channels > update request post', {testIsolation: true}, () => {
|
||||
let testPlaybookRun2;
|
||||
|
||||
before(() => {
|
||||
cy.apiUpdateConfig({
|
||||
ServiceSettings: {
|
||||
ThreadAutoFollow: true,
|
||||
CollapsedThreads: 'default_on',
|
||||
},
|
||||
});
|
||||
|
||||
cy.apiInitSetup().then(({team, user}) => {
|
||||
testTeam = team;
|
||||
testParticipant = user;
|
||||
|
||||
@@ -40,34 +40,7 @@ describe('playbooks > feedback', {testIsolation: true}, () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('playbooks shows prompt in global header, with experimental feature flag', () => {
|
||||
// # Enable experimental feature flag
|
||||
cy.apiAdminLogin().then(() => {
|
||||
cy.apiEnsureFeatureFlag('enableexperimentalfeatures', true);
|
||||
|
||||
// # Login as testUser
|
||||
cy.apiLogin(testUser);
|
||||
});
|
||||
|
||||
// # Visit the playbooks product
|
||||
cy.visit('/playbooks');
|
||||
|
||||
// # Verify Give Feedback link is configured to open in a new tab.
|
||||
cy.findByText('Give feedback').invoke('attr', 'target').should('eq', '_blank');
|
||||
|
||||
// # Verify Give Feedback link href
|
||||
cy.findByText('Give feedback').invoke('attr', 'href').should('match', /playbooks-feedback/);
|
||||
});
|
||||
|
||||
it('playbooks shows prompt in global header, without experimental feature flag', () => {
|
||||
// # Disable experimental feature flag
|
||||
cy.apiAdminLogin().then(() => {
|
||||
cy.apiEnsureFeatureFlag('enableexperimentalfeatures', false);
|
||||
|
||||
// # Login as testUser
|
||||
cy.apiLogin(testUser);
|
||||
});
|
||||
|
||||
it('playbooks shows prompt in global header', () => {
|
||||
// # Visit the playbooks product
|
||||
cy.visit('/playbooks');
|
||||
|
||||
|
||||
@@ -618,13 +618,8 @@ describe('runs > run details page > header', {testIsolation: true}, () => {
|
||||
// # Navigate to the playbook run channel
|
||||
cy.visit(`/${testTeam.name}/channels/${playbookRunChannelName}`);
|
||||
|
||||
// * Verify the user was added to the channel
|
||||
cy.getFirstPostId().then((id) => {
|
||||
cy.get(`#postMessageText_${id}`).within(() => {
|
||||
cy.contains('You and');
|
||||
cy.contains('joined the channel');
|
||||
});
|
||||
});
|
||||
// # Verify channel loads
|
||||
cy.get('#channelHeaderTitle').should('be.visible').should('contain', playbookRunName);
|
||||
|
||||
// * assert telemetry data
|
||||
cy.expectTelemetryToContain([
|
||||
@@ -681,13 +676,8 @@ describe('runs > run details page > header', {testIsolation: true}, () => {
|
||||
// # Navigate to the playbook run channel
|
||||
cy.visit(`/${testTeam.name}/channels/${playbookRunChannelName}`);
|
||||
|
||||
// * Verify that the user was added to the channel
|
||||
cy.getFirstPostId().then((id) => {
|
||||
cy.get(`#postMessageText_${id}`).within(() => {
|
||||
cy.contains('You and');
|
||||
cy.contains('joined the channel');
|
||||
});
|
||||
});
|
||||
// # Verify channel loads
|
||||
cy.get('#channelHeaderTitle').should('be.visible').should('contain', playbookRunName);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -812,13 +802,8 @@ describe('runs > run details page > header', {testIsolation: true}, () => {
|
||||
// # Navigate to the playbook run channel
|
||||
cy.visit(`/${testTeam.name}/channels/${playbookRunChannelName}`);
|
||||
|
||||
// * Verify that the user was added to the channel
|
||||
cy.getFirstPostId().then((id) => {
|
||||
cy.get(`#postMessageText_${id}`).within(() => {
|
||||
cy.contains('You and');
|
||||
cy.contains('joined the channel');
|
||||
});
|
||||
});
|
||||
// # Verify channel loads
|
||||
cy.get('#channelHeaderTitle').should('be.visible').should('contain', playbookRunName);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -164,7 +164,7 @@ describe('runs > run details page > run info', {testIsolation: true}, () => {
|
||||
from: 'run_details',
|
||||
playbookrun_id: testRun.id,
|
||||
},
|
||||
], {waitForCalls: 3});
|
||||
], {waitForCalls: 2});
|
||||
});
|
||||
|
||||
it('click channel link navigates to run\'s channel', () => {
|
||||
|
||||
@@ -100,13 +100,13 @@ describe('runs > run details page > status update', {testIsolation: true}, () =>
|
||||
});
|
||||
|
||||
describe('as viewer', () => {
|
||||
beforeEach(() => {
|
||||
cy.apiLogin(testViewerUser).then(() => {
|
||||
cy.visit(`/playbooks/runs/${testRun.id}`);
|
||||
});
|
||||
});
|
||||
|
||||
it('rhs can not be open when there is no updates', () => {
|
||||
// * Log in as viewer user
|
||||
cy.apiLogin(testViewerUser);
|
||||
|
||||
// * Browse to test run
|
||||
cy.visit(`/playbooks/runs/${testRun.id}`);
|
||||
|
||||
// * Assert that the link is not present
|
||||
cy.findByTestId('run-statusupdate-section').findByText('View all updates').should('not.exist');
|
||||
});
|
||||
@@ -125,22 +125,26 @@ describe('runs > run details page > status update', {testIsolation: true}, () =>
|
||||
});
|
||||
});
|
||||
|
||||
cy.apiLogin(testViewerUser).then(() => {
|
||||
// # Click View all updates link
|
||||
cy.findByTestId('run-statusupdate-section').findByText('View all updates').click();
|
||||
// * Log in as viewer user
|
||||
cy.apiLogin(testViewerUser);
|
||||
|
||||
// * Assert RHS is open and have the correct title/subtitle
|
||||
getRHS().should('be.visible');
|
||||
getRHS().findByTestId('rhs-title').contains('Status updates');
|
||||
getRHS().findByTestId('rhs-subtitle').contains(testRun.name);
|
||||
// * Browse to test run
|
||||
cy.visit(`/playbooks/runs/${testRun.id}`);
|
||||
|
||||
// * Assert that we have both updates in reverse order
|
||||
getStatusUpdates().should('have.length', 2);
|
||||
getStatusUpdates().eq(0).contains('message 2');
|
||||
getStatusUpdates().eq(0).contains(testUser.username);
|
||||
getStatusUpdates().eq(1).contains('message 1');
|
||||
getStatusUpdates().eq(1).contains(testUser.username);
|
||||
});
|
||||
// # Click View all updates link
|
||||
cy.findByTestId('run-statusupdate-section').findByText('View all updates').click();
|
||||
|
||||
// * Assert RHS is open and have the correct title/subtitle
|
||||
getRHS().should('be.visible');
|
||||
getRHS().findByTestId('rhs-title').contains('Status updates');
|
||||
getRHS().findByTestId('rhs-subtitle').contains(testRun.name);
|
||||
|
||||
// * Assert that we have both updates in reverse order
|
||||
getStatusUpdates().should('have.length', 2);
|
||||
getStatusUpdates().eq(0).contains('message 2');
|
||||
getStatusUpdates().eq(0).contains(testUser.username);
|
||||
getStatusUpdates().eq(1).contains('message 1');
|
||||
getStatusUpdates().eq(1).contains(testUser.username);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -80,31 +80,7 @@ describe('Task Inbox >', {testIsolation: true}, () => {
|
||||
|
||||
const getRHS = () => cy.get('#playbooks-backstage-sidebar-right');
|
||||
|
||||
it('icon in global header, with experimental feature flag', () => {
|
||||
// # Enable experimental feature flag
|
||||
cy.apiAdminLogin().then(() => {
|
||||
cy.apiEnsureFeatureFlag('enableexperimentalfeatures', true);
|
||||
|
||||
// # Login as testUser
|
||||
cy.apiLogin(testUser);
|
||||
});
|
||||
|
||||
// # Visit the playbooks product
|
||||
cy.visit('/playbooks');
|
||||
|
||||
// # Verify icon present in global header icon to open
|
||||
cy.findByTestId('header-task-inbox-icon').click();
|
||||
});
|
||||
|
||||
it('icon in global header, without experimental feature flag', () => {
|
||||
// # Disable experimental feature flag
|
||||
cy.apiAdminLogin().then(() => {
|
||||
cy.apiEnsureFeatureFlag('enableexperimentalfeatures', false);
|
||||
|
||||
// # Login as testUser
|
||||
cy.apiLogin(testUser);
|
||||
});
|
||||
|
||||
it('icon in global header', () => {
|
||||
// # Visit the playbooks product
|
||||
cy.visit('/playbooks');
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ Cypress.Commands.add('apiCreateUser', ({
|
||||
cy.apiSaveDraftsTourTipPreference(createdUser.id, true);
|
||||
|
||||
if (bypassTutorial) {
|
||||
cy.apiSaveTutorialStep(createdUser.id, '999');
|
||||
cy.apiDisableTutorials(createdUser.id);
|
||||
}
|
||||
|
||||
if (hideActionsMenu) {
|
||||
|
||||
Ссылка в новой задаче
Block a user