Fix Cypress tests on master (#26500)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6ea363e260
Коммит
9e5d486a5b
@@ -56,7 +56,7 @@ describe('Messaging', () => {
|
||||
cy.reload();
|
||||
|
||||
// * Verify that the date separators are rendered in English
|
||||
verifyDateSeparator(0, /^January (04|05), 2019/);
|
||||
verifyDateSeparator(0, /^January (05|06), 2019/);
|
||||
|
||||
//! cannot test for MMMM DD format as it is current-year dependent, need fixed-time comparison
|
||||
|
||||
@@ -79,6 +79,6 @@ describe('Messaging', () => {
|
||||
cy.reload();
|
||||
|
||||
// * Verify that it renders in "es" locale
|
||||
verifyDateSeparator(0, /^(04|05) de enero de 2019/);
|
||||
verifyDateSeparator(0, /^(05|06) de enero de 2019/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ describe('MM-T154 Use keyboard navigation in emoji picker', () => {
|
||||
cy.get('#emojiPickerSearch').type(`{${dir}arrow}`);
|
||||
|
||||
// * The first emoji in the "People" category should be selected
|
||||
testSelectedIndex((idx) => expect(idx).to.equal(0));
|
||||
testSelectedIndex((idx) => expect(idx).to.equal((dir === 'right') ? 1 : 0));
|
||||
|
||||
// # Close emoji picker
|
||||
cy.get('#emojiPickerButton').click();
|
||||
@@ -105,7 +105,7 @@ describe('MM-T154 Use keyboard navigation in emoji picker', () => {
|
||||
});
|
||||
|
||||
const testSelectedIndex = (done) => {
|
||||
cy.get('.emoji-picker__item.selected').then((selectedEmoji) => {
|
||||
cy.get('div.emoji-picker__item.selected').then((selectedEmoji) => {
|
||||
done(selectedEmoji.index());
|
||||
});
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('MM-13064 - Emoji picker keyboard usability', () => {
|
||||
and('have.focus').
|
||||
type('si').
|
||||
should('have.value', 'si').
|
||||
type('{leftarrow}m').
|
||||
type('{leftarrow}{leftarrow}m').
|
||||
should('have.value', 'smi');
|
||||
});
|
||||
|
||||
@@ -48,11 +48,12 @@ describe('MM-13064 - Emoji picker keyboard usability', () => {
|
||||
and('have.focus').
|
||||
type('si').
|
||||
should('have.value', 'si').
|
||||
type('{leftarrow}m').
|
||||
type('{leftarrow}{leftarrow}m').
|
||||
should('have.value', 'smi').
|
||||
type('{leftarrow}{leftarrow}').
|
||||
type('{rightarrow}l').
|
||||
should('have.value', 'smil').
|
||||
type('{rightarrow}');
|
||||
should('have.value', 'smil');
|
||||
|
||||
cy.get('.emoji-picker__item.selected').should('exist').within(() => {
|
||||
cy.findByTestId('smile').should('exist');
|
||||
});
|
||||
@@ -72,10 +73,6 @@ describe('MM-13064 - Emoji picker keyboard usability', () => {
|
||||
|
||||
it('On up or down arrow key press, move the selection up or down the emoji items', () => {
|
||||
// * Check initial state of emoji preview
|
||||
cy.get('.emoji-picker__preview').should('have.text', 'Select an Emoji');
|
||||
|
||||
// # Press down arrow and verify selected emoji
|
||||
cy.get('body').type('{downarrow}');
|
||||
cy.get('.emoji-picker__preview').should('have.text', ':grinning:');
|
||||
|
||||
// # Again, press down arrow and verify next selected emoji
|
||||
@@ -97,11 +94,11 @@ describe('MM-13064 - Emoji picker keyboard usability', () => {
|
||||
cy.findByLabelText('Search for an emoji').should('have.value', 'mi');
|
||||
|
||||
// # Move cursor to the beginning of search text, type "s", and then verify search text input
|
||||
cy.get('body').type('{uparrow}').type('s');
|
||||
cy.get('body').type('{uparrow}{uparrow}').type('s');
|
||||
cy.findByLabelText('Search for an emoji').should('have.value', 'smi');
|
||||
|
||||
// # Move cursor to the end of the text
|
||||
cy.findByLabelText('Search for an emoji').type('{downarrow}{uparrow}');
|
||||
cy.findByLabelText('Search for an emoji').type('{uparrow}');
|
||||
|
||||
// * Verify that nothing is initially selected
|
||||
verifySelectedTextAs('');
|
||||
@@ -117,10 +114,10 @@ describe('MM-13064 - Emoji picker keyboard usability', () => {
|
||||
cy.findByLabelText('Search for an emoji').should('have.value', 'sm');
|
||||
|
||||
// # Move cursor to the beginning then end of search text, type "i", and then verify search text input
|
||||
cy.findByLabelText('Search for an emoji').type('{uparrow}{downarrow}i').should('have.value', 'smi');
|
||||
cy.findByLabelText('Search for an emoji').type('{uparrow}{uparrow}{downarrow}i').should('have.value', 'smi');
|
||||
|
||||
// # Move cursor to the beginning of search text
|
||||
cy.findByLabelText('Search for an emoji').type('{uparrow}');
|
||||
cy.findByLabelText('Search for an emoji').type('{uparrow}{uparrow}');
|
||||
|
||||
// * Verify that nothing is initially selected
|
||||
verifySelectedTextAs('');
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('Message', () => {
|
||||
const expectedSize = '13.5px';
|
||||
|
||||
cy.get('p').first().should('have.text', 'This is a normal sentence.').and('have.css', 'font-size', expectedSize);
|
||||
cy.get('ol li').first().should('have.text', 'this is point 1\nthis is a bullet under 1').and('have.css', 'font-size', expectedSize);
|
||||
cy.get('ol li').first().should('have.text', 'this is point 1this is a bullet under 1').and('have.css', 'font-size', expectedSize);
|
||||
cy.get('ol li ul li').should('have.text', 'this is a bullet under 1').and('have.css', 'font-size', expectedSize);
|
||||
cy.get('p').last().should('have.text', 'This is more normal text.').and('have.css', 'font-size', expectedSize);
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@ describe('Messaging', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// if the root post is deleted Drafts under that post from all users are deleted.
|
||||
it('MM-T113 Delete a Message during reply, other user sees "(message deleted)"', () => {
|
||||
const message = 'aaa';
|
||||
const draftMessage = 'draft';
|
||||
@@ -54,40 +55,11 @@ describe('Messaging', () => {
|
||||
and('not.contain', message);
|
||||
});
|
||||
|
||||
// # Send message
|
||||
cy.uiGetReplyTextBox().type('{enter}');
|
||||
|
||||
// * Post Deleted Modal should be visible
|
||||
cy.findAllByTestId('postDeletedModal').should('be.visible');
|
||||
|
||||
// # Close the modal
|
||||
cy.findAllByTestId('postDeletedModalOkButton').click();
|
||||
|
||||
// // * The message should not have been sent
|
||||
// * The message should not have been sent
|
||||
cy.uiGetRHS().find('.post__content').each((content) => {
|
||||
cy.wrap(content).findByText(draftMessage).should('not.exist');
|
||||
});
|
||||
|
||||
// * Textbox should still have the draft message
|
||||
cy.uiGetReplyTextBox().should('contain', draftMessage);
|
||||
|
||||
// # Try to post the message one more time pressing enter
|
||||
cy.uiGetReplyTextBox().type('{enter}');
|
||||
|
||||
// * The modal should have appeared again
|
||||
cy.findAllByTestId('postDeletedModal').should('be.visible');
|
||||
|
||||
// # Close the modal by hitting the OK button
|
||||
cy.findAllByTestId('postDeletedModalOkButton').click();
|
||||
|
||||
// // * The message should not have been sent
|
||||
cy.uiGetRHS().find('.post__content').each((content) => {
|
||||
cy.wrap(content).findByText(draftMessage).should('not.exist');
|
||||
});
|
||||
|
||||
// * Textbox should still have the draft message
|
||||
cy.uiGetReplyTextBox().should('contain', draftMessage);
|
||||
|
||||
// # Change to the other user and go to test channel
|
||||
cy.apiAdminLogin();
|
||||
cy.visit(testChannelUrl);
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('Messaging', () => {
|
||||
// # Click reply icon
|
||||
cy.clickPostCommentIcon(latestPostId);
|
||||
|
||||
cy.uiGetReplyTextBox().should('have.css', 'height', '100px').invoke('height').then((height) => {
|
||||
cy.uiGetReplyTextBox().should('have.css', 'height', '46px').invoke('height').then((height) => {
|
||||
// # Get the initial height of the textbox
|
||||
// Setting alias based on reference to element seemed to be problematic with Cypress (regression)
|
||||
// Quick hack to reference based on value
|
||||
|
||||
@@ -19,6 +19,14 @@ describe('Messaging', () => {
|
||||
before(() => {
|
||||
cy.shouldNotRunOnCloudEdition();
|
||||
cy.shouldHavePluginUploadEnabled();
|
||||
cy.apiUpdateConfig({
|
||||
ServiceSettings: {
|
||||
EnableGifPicker: true,
|
||||
},
|
||||
FileSettings: {
|
||||
EnablePublicLink: true,
|
||||
},
|
||||
});
|
||||
|
||||
// # Login as test user and visit off-topic
|
||||
cy.apiInitSetup().then(({team, user, offTopicUrl}) => {
|
||||
@@ -45,10 +53,10 @@ describe('Messaging', () => {
|
||||
openAndVerifyTooltip(() => cy.uiGetChannelMemberButton(), 'Members');
|
||||
|
||||
// * Pinned post tooltip is present
|
||||
openAndVerifyTooltip(() => cy.uiGetChannelPinButton(), 'Pinned posts');
|
||||
openAndVerifyTooltip(() => cy.uiGetChannelPinButton(), 'Pinned messages');
|
||||
|
||||
// * Saved posts tooltip is present
|
||||
openAndVerifyTooltip(() => cy.uiGetSavedPostButton(), 'Saved posts');
|
||||
openAndVerifyTooltip(() => cy.uiGetSavedPostButton(), 'Saved messages');
|
||||
|
||||
// * Add to favorites posts tooltip is present - un checked
|
||||
openAndVerifyTooltip(() => cy.uiGetChannelFavoriteButton(), 'Add to Favorites');
|
||||
@@ -76,7 +84,7 @@ describe('Messaging', () => {
|
||||
cy.get('@longChannelAtSidebar').trigger('mouseout');
|
||||
|
||||
// * Check that the Demo plugin tooltip is present
|
||||
cy.get('@channelHeader').find('.fa-plug').should('be.visible').trigger('mouseover');
|
||||
cy.get('[role=button] .fa-plug').should('be.visible').trigger('mouseover');
|
||||
cy.uiGetToolTip('Demo Plugin');
|
||||
});
|
||||
});
|
||||
|
||||
Ссылка в новой задаче
Block a user