Skip to content

Commit

Permalink
E2E: Fix flaky tests on system message spec and update markdown spec …
Browse files Browse the repository at this point in the history
…due to latest structure change (mattermost#3084)

* E2E: Fix flaky tests on system message spec and update markdown spec due to latest structure change

* update per latest change
  • Loading branch information
saturninoabril authored and sudheerDev committed Jul 10, 2019
1 parent 88c26c2 commit b32f03d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions e2e/cypress/integration/markdown/markdown_image_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('Markdown', () => {

const baseUrl = Cypress.config('baseUrl');

const inlineImage1 = `<h3 class="markdown__heading">In-line Images</h3><p>Mattermost/platform build status: <a class="theme markdown__link" href="https://travis-ci.org/mattermost/platform" rel="noreferrer" target="_blank"><img alt="Build Status" class="markdown-inline-img" src="${baseUrl}/api/v4/image?url=https%3A%2F%2Ftravis-ci.org%2Fmattermost%2Fplatform.svg%3Fbranch%3Dmaster"></a></p>`;
const inlineImage2 = `<h3 class="markdown__heading">In-line Images</h3><p>GitHub favicon: <img alt="Github" class="markdown-inline-img" src="${baseUrl}/api/v4/image?url=https%3A%2F%2Fgithub.githubassets.com%2Ffavicon.ico"></p>`;
const inlineImage1 = `<h3 class="markdown__heading">In-line Images</h3><p>Mattermost/platform build status: <a class="theme markdown__link" href="https://travis-ci.org/mattermost/platform" rel="noreferrer" target="_blank"><button class="style--none" alt="Build Status" aria-label="file thumbnail"><img class="markdown-inline-img" alt="image placeholder" src="${baseUrl}/api/v4/image?url=https%3A%2F%2Ftravis-ci.org%2Fmattermost%2Fplatform.svg%3Fbranch%3Dmaster"></button></a></p>`;
const inlineImage2 = `<h3 class="markdown__heading">In-line Images</h3><p>GitHub favicon: <button class="style--none" alt="Github" aria-label="file thumbnail"><img class="markdown-inline-img" alt="image placeholder" src="${baseUrl}/api/v4/image?url=https%3A%2F%2Fgithub.githubassets.com%2Ffavicon.ico"></button></p>`;

const tests = [
{name: 'with in-line images 1', fileKey: 'markdown_inline_images_1', expected: inlineImage1},
Expand Down
21 changes: 12 additions & 9 deletions e2e/cypress/integration/multi_team/system_message_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ describe('MM-15240 - no status on a system message', () => {
// # Login and go to /
cy.apiLogin('user-1');
cy.visit('/');

// # Post a regular message
cy.postMessage('Test for no status of a system message');

// # Update the header
cy.getCurrentChannelId().then((channelId) => {
cy.apiPatchChannel(
channelId,
{header: ' Updating header'.repeat(Math.floor(Math.random() * 10))}
);
});
});

const displayTypes = ['compact', 'clean'];
Expand All @@ -37,14 +48,6 @@ describe('MM-15240 - no status on a system message', () => {
// # Set message display
cy.apiSaveMessageDisplayPreference(type);

// # Update the header
cy.getCurrentChannelId().then((channelId) => {
cy.apiPatchChannel(
channelId,
{header: ' Updating header'.repeat(Math.floor(Math.random() * 10))}
);
});

// # Get last post
cy.getLastPostId().then((postId) => {
cy.get(`#post_${postId}`).as('SystemMessage');
Expand All @@ -54,4 +57,4 @@ describe('MM-15240 - no status on a system message', () => {
verifySystemMessage('@SystemMessage');
});
});
});
});

0 comments on commit b32f03d

Please sign in to comment.