From 75a0e61de7b000687540e413c6da9ad5ebc33677 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Thu, 15 Jun 2023 21:58:00 +0800 Subject: [PATCH] fix failed e2e tests (#23741) --- .../tests/fixtures/markdown/markdown_inline_images_6.md | 2 +- .../image_link_preview_new_window_spec.js | 2 +- .../files_and_attachments/image_link_preview_spec.js | 6 +++--- .../channels/integrations/slash_commands_spec.js | 5 +++-- .../integration/channels/markdown/markdown_image_spec.js | 4 ++-- .../messaging/inline_images_open_preview_window_spec.js | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/e2e-tests/cypress/tests/fixtures/markdown/markdown_inline_images_6.md b/e2e-tests/cypress/tests/fixtures/markdown/markdown_inline_images_6.md index a82e0b74d8..bb4e1c9ee2 100644 --- a/e2e-tests/cypress/tests/fixtures/markdown/markdown_inline_images_6.md +++ b/e2e-tests/cypress/tests/fixtures/markdown/markdown_inline_images_6.md @@ -1,3 +1,3 @@ ### In-line Images -![test image](https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/image-small-height.png) +![test image](https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/image-small-height.png) diff --git a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_new_window_spec.js b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_new_window_spec.js index 44bb7f844d..9e7f940298 100644 --- a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_new_window_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_new_window_spec.js @@ -30,7 +30,7 @@ describe('Image Link Preview', () => { }); it('MM-T329 Image link preview', () => { - const link = 'https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/image-small-height.png'; + const link = 'https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/image-small-height.png'; const baseUrl = Cypress.config('baseUrl'); const encodedIconUrl = encodeURIComponent(link); diff --git a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_spec.js b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_spec.js index 0d5a681eaf..431a85bb35 100644 --- a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/image_link_preview_spec.js @@ -38,7 +38,7 @@ describe('Image Link Preview', () => { }); it('MM-T331 Image link preview - Collapse and expand', () => { - const link = 'https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/small-image.png'; + const link = 'https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/small-image.png'; // # Post a link to an externally hosted image cy.postMessage(link); @@ -178,13 +178,13 @@ describe('Image Link Preview', () => { { filename: 'image-1000x40.jpg', originalSize: {width: 1000, height: 40}, - thumbnailSize: {width: 948, height: 38}, + thumbnailSize: {width: 899, height: 36}, containerSize: {height: 46}, }, { filename: 'image-1600x40.jpg', originalSize: {width: 1600, height: 40}, - thumbnailSize: {width: 948, height: 24}, + thumbnailSize: {width: 899, height: 23}, previewSize: {width: 1204, height: 30}, containerSize: {height: 46}, }, diff --git a/e2e-tests/cypress/tests/integration/channels/integrations/slash_commands_spec.js b/e2e-tests/cypress/tests/integration/channels/integrations/slash_commands_spec.js index 040cf56df4..45ca364c04 100644 --- a/e2e-tests/cypress/tests/integration/channels/integrations/slash_commands_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/integrations/slash_commands_spec.js @@ -188,7 +188,7 @@ describe('Integrations', () => { cy.getLastPost().should('contain', 'Image links now expand by default').and('contain', 'System'); // # Post message - cy.postMessage('https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/png-image-file.png'); + cy.postMessage('https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/png-image-file.png'); cy.getLastPostId().as('postID'); cy.get('@postID').then((postID) => { @@ -208,7 +208,7 @@ describe('Integrations', () => { cy.visit(offTopicUrl1); // # Post message - cy.postMessage('https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/png-image-file.png'); + cy.postMessage('https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/png-image-file.png'); cy.getLastPostId().as('postID'); // # Open RHS @@ -244,6 +244,7 @@ describe('Integrations', () => { it('MM-T705 Ephemeral message', () => { cy.apiAdminLogin(); cy.visit(offTopicUrl1); + cy.postMessage('hello'); // # Navigate to slash commands and create the slash command cy.uiOpenProductMenu('Integrations'); diff --git a/e2e-tests/cypress/tests/integration/channels/markdown/markdown_image_spec.js b/e2e-tests/cypress/tests/integration/channels/markdown/markdown_image_spec.js index c7ab762957..4b834a73c2 100644 --- a/e2e-tests/cypress/tests/integration/channels/markdown/markdown_image_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/markdown/markdown_image_spec.js @@ -122,7 +122,7 @@ describe('Markdown', () => { it('channel header is markdown image', () => { // # Update channel header - cy.updateChannelHeader('![MM Logo](https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/small-image.png)').wait(TIMEOUTS.TWO_SEC); + cy.updateChannelHeader('![MM Logo](https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/small-image.png)').wait(TIMEOUTS.TWO_SEC); // * Verify image in header cy.get('#channelHeaderDescription').find('span.markdown__paragraph-inline').as('imageDiv'); @@ -145,7 +145,7 @@ describe('Markdown', () => { it('channel header is markdown image that is also a link', () => { // # Update channel header - cy.updateChannelHeader('[![Build Status](https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/small-image.png)](https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/small-image.png)').wait(TIMEOUTS.TWO_SEC); + cy.updateChannelHeader('[![Build Status](https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/small-image.png)](https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/small-image.png)').wait(TIMEOUTS.TWO_SEC); // * Verify image in header cy.get('#channelHeaderDescription').find('span.markdown__paragraph-inline').as('imageDiv'); diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/inline_images_open_preview_window_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/inline_images_open_preview_window_spec.js index 4846998ec4..fb99ec5dea 100644 --- a/e2e-tests/cypress/tests/integration/channels/messaging/inline_images_open_preview_window_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/messaging/inline_images_open_preview_window_spec.js @@ -21,7 +21,7 @@ describe('Messaging', () => { it('MM-T187 Inline markdown images open preview window', () => { // # Post the image link to the channel - cy.postMessage('Hello ![test image](https://raw.githubusercontent.com/furqanmlk/furqanmlk.github.io/main/images/image-small-height.png)'); + cy.postMessage('Hello ![test image](https://raw.githubusercontent.com/mattermost/mattermost/master/e2e-tests/cypress/tests/fixtures/image-small-height.png)'); // * Confirm the image container is visible cy.uiWaitUntilMessagePostedIncludes('Hello');