Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
MM-27804 - Cypress/E2E: Attachments > File Upload (#6333)
Browse files Browse the repository at this point in the history
* Cypress/E2E: Automate backlogs - Attachments > File Upload

* made test less flaky

* code review
  • Loading branch information
reflog committed Sep 7, 2020
1 parent 28851f3 commit eebaa36
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
22 changes: 22 additions & 0 deletions e2e/cypress/integration/files_and_attachments/upload_files_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,28 @@ describe('Upload Files', () => {
cy.findByText('Unable to get the file info.').should('be.visible');
cy.findByText('Back to Mattermost').should('be.visible').parent().should('have.attr', 'href', '/');
});

it('MM-T337 CTRL/CMD+U - Five files on one message, thumbnails while uploading', () => {
cy.visit(`/${testTeam.name}/channels/town-square`);
const filename = 'huge-image.jpg';
cy.get('#centerChannelFooter').find('#fileUploadInput').
attachFile(filename).
attachFile(filename).
attachFile(filename).
attachFile(filename).
attachFile(filename);
for (let i = 1; i < 4; i++) {
cy.get(`:nth-child(${i}) > .post-image__thumbnail > .post-image`).should('be.visible');
}
cy.get(':nth-child(5) > .post-image__thumbnail > .post-image').should('not.be.visible');
cy.get('.file-preview__container').scrollTo('right');
for (let i = 1; i < 3; i++) {
cy.get(`:nth-child(${i}) > .post-image__thumbnail > .post-image`).should('not.be.visible');
}
cy.get(':nth-child(5) > .post-image__thumbnail > .post-image').should('be.visible');
cy.postMessage('test');
cy.findByTestId('fileAttachmentList').find('.post-image').should('have.length', 5);
});
});

function verifyLinkHasDownloadProperties(fileAttachment, filename) {
Expand Down
21 changes: 15 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eebaa36

Please sign in to comment.