mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix Cypress tests on master (#26500)
This commit is contained in:
parent
6ea363e260
commit
9e5d486a5b
@ -35,6 +35,7 @@ describe('Verify Accessibility Support in different sections in Settings and Pro
|
||||
{key: 'email', label: 'Email Notifications', type: 'radio'},
|
||||
{key: 'push', label: 'Mobile Push Notifications', type: 'radio'},
|
||||
{key: 'keysWithNotification', label: 'Keywords That Trigger Notifications', type: 'checkbox'},
|
||||
{key: 'keysWithHighlight', label: 'Keywords That Get Highlighted (Without Notifications)', type: 'checkbox'},
|
||||
{key: 'comments', label: 'Reply Notifications', type: 'radio'},
|
||||
],
|
||||
display: [
|
||||
@ -130,6 +131,7 @@ describe('Verify Accessibility Support in different sections in Settings and Pro
|
||||
|
||||
// * Verify if the focus goes to the individual fields in Notifications section
|
||||
cy.findByRole('tab', {name: 'notifications'}).click().tab();
|
||||
cy.focused().should('have.text', 'Learn more about notifications').tab();
|
||||
verifySettings(settings.notifications);
|
||||
|
||||
// // * Verify if the focus goes to the individual fields in Display section
|
||||
|
@ -66,7 +66,7 @@ describe('Verify Quick Navigation support across different regions in the app',
|
||||
cy.uiGetPostTextBox().focus().tab().tab({shift: true});
|
||||
|
||||
// * Verify post input region reads out correctly
|
||||
verifyNavSupport('#advancedTextEditorCell', 'Login Successful message input complimentary region', '2');
|
||||
verifyNavSupport('#advancedTextEditorCell', 'message input complimentary region', '2');
|
||||
});
|
||||
|
||||
it('MM-T1460_3 Verify Navigation Support in RHS Post List & RHS Post Input', () => {
|
||||
@ -90,7 +90,7 @@ describe('Verify Quick Navigation support across different regions in the app',
|
||||
|
||||
// * Verify post input on RHS reads out correctly
|
||||
cy.get('#advancedTextEditorCell').
|
||||
should('have.attr', 'aria-label', 'Login Successful message input complimentary region').
|
||||
should('have.attr', 'aria-label', 'message input complimentary region').
|
||||
and('have.attr', 'data-a11y-sort-order', '2').
|
||||
and('have.class', 'a11y__region');
|
||||
cy.uiGetReplyTextBox().
|
||||
|
@ -69,11 +69,13 @@ describe('Collapsed Reply Threads', () => {
|
||||
|
||||
cy.wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
cy.url().should('include', `${teamB.name}/threads`);
|
||||
|
||||
// # Switch back to Team A
|
||||
cy.get(`#${teamA.name}TeamButton`, {timeout: TIMEOUTS.ONE_MIN}).should('be.visible').click();
|
||||
|
||||
// Verify url is set up for threads view
|
||||
cy.url().should('include', `${teamA.name}/threads`);
|
||||
// Verify url is set to landing channel
|
||||
cy.url().should('include', `${teamA.name}/channels/town-square`);
|
||||
});
|
||||
|
||||
it('MM-T4843_1 should go to threads view when switching a team if that was the last view on that team', () => {
|
||||
|
@ -27,7 +27,7 @@ describe('Custom Status - Setting Your Own Custom Status', () => {
|
||||
|
||||
it('MM-T3846_1 should change the emoji to speech balloon when typed in the input', () => {
|
||||
// # Open the custom status modal
|
||||
cy.uiOpenUserMenu('Set a Custom Status');
|
||||
cy.uiOpenUserMenu('Set a custom status');
|
||||
|
||||
// * Default emoji is currently visible in the custom status input
|
||||
cy.get('#custom_status_modal .StatusModal__emoji-button span').should('have.class', 'icon--emoji');
|
||||
|
@ -32,7 +32,7 @@ describe('Custom Status - Recent Statuses', () => {
|
||||
|
||||
it('MM-T3847_1 set a status', () => {
|
||||
// # Open the custom status modal
|
||||
cy.uiOpenUserMenu('Set a Custom Status');
|
||||
cy.uiOpenUserMenu('Set a custom status');
|
||||
|
||||
// # Type the custom status text in the custom status modal input
|
||||
cy.get('#custom_status_modal .StatusModal__input input').typeWithForce(customStatus.text);
|
||||
|
@ -120,7 +120,9 @@ describe('Custom emojis', () => {
|
||||
|
||||
cy.get('#emojiPicker').should('be.visible').within(() => {
|
||||
// # Scroll to start of custom category section
|
||||
cy.findByLabelText('emoji_picker.custom').should('exist').click().wait(TIMEOUTS.FIVE_SEC);
|
||||
cy.get('i.icon-emoticon-custom-outline').as('customSection');
|
||||
cy.get('@customSection').click().wait(TIMEOUTS.FIVE_SEC);
|
||||
cy.get('@customSection').click().wait(TIMEOUTS.FIVE_SEC);
|
||||
|
||||
// * Verify custom category header is visible
|
||||
cy.findByText('Custom').should('exist').and('is.visible');
|
||||
|
@ -110,6 +110,7 @@ describe('Custom emojis', () => {
|
||||
// * Select the custom emoji
|
||||
cy.findAllByTestId('emojiItem').children().click();
|
||||
});
|
||||
cy.uiGetPostTextBox().type('+' + builtinEmojiWithColons).wait(TIMEOUTS.HALF_SEC).type('{enter}').type('{enter}');
|
||||
|
||||
cy.getLastPostId().then((postId) => {
|
||||
cy.get(`#postReaction-${postId}-` + builtinEmoji).should('be.visible');
|
||||
|
@ -59,7 +59,7 @@ describe('Guest Accounts', () => {
|
||||
});
|
||||
|
||||
// * Guest users are shown as "Inactive".
|
||||
checkUserListStatus(guestUser, 'Inactive');
|
||||
checkUserListStatus(guestUser, 'Deactivated');
|
||||
|
||||
// # Navigate to Guest Access page.
|
||||
cy.visit('/admin_console/authentication/guest_access');
|
||||
@ -70,22 +70,16 @@ describe('Guest Accounts', () => {
|
||||
// # Click "Save".
|
||||
cy.get('#saveSetting').scrollIntoView().click();
|
||||
|
||||
// * Guest users are shown as "Inactive".
|
||||
checkUserListStatus(guestUser, 'Inactive');
|
||||
// * Guest users are shown as "Deactivated".
|
||||
checkUserListStatus(guestUser, 'Deactivated');
|
||||
});
|
||||
|
||||
function getInnerText(el) {
|
||||
return el[0].innerText.replace(/\n/g, '').replace(/\s/g, ' ');
|
||||
}
|
||||
|
||||
function checkUserListStatus(user, status) {
|
||||
// # Go to System Console ➜ Users.
|
||||
cy.visit('/admin_console/user_management/users');
|
||||
|
||||
cy.get('#searchUsers').should('be.visible').type(user.username);
|
||||
cy.get('#selectUserStatus').select(status);
|
||||
cy.get('.more-modal__details > .more-modal__name').should('be.visible').then((el) => {
|
||||
expect(getInnerText(el)).contains(`@${user.username}`);
|
||||
});
|
||||
cy.get('#input_searchTerm').should('be.visible').type(user.username);
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').should('have.text', status);
|
||||
cy.get('#systemUsersTable-cell-0_emailColumn').should('have.text', user.email);
|
||||
}
|
||||
});
|
||||
|
@ -86,8 +86,8 @@ export function verifyInvitationSuccess(user: string, team: Cypress.Team, succes
|
||||
cy.get('.InvitationModal').should('not.exist');
|
||||
}
|
||||
|
||||
export function verifyGuest(userStatus = 'Guest ') {
|
||||
export function verifyGuest(userStatus = 'Guest') {
|
||||
// * Verify if Guest User is displayed
|
||||
cy.findAllByTestId('userListRow').should('have.length', 1);
|
||||
cy.findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').and('have.text', userStatus);
|
||||
cy.get('#systemUsersTable-cell-0_usernameColumn').parent().should('have.length', 1);
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').should('be.visible').and('have.text', userStatus);
|
||||
}
|
||||
|
@ -55,18 +55,18 @@ describe('Guest Account - Verify Manage Guest Users', () => {
|
||||
cy.reload();
|
||||
|
||||
// # Search for Guest User by username
|
||||
cy.get('#searchUsers', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(guestUser.username);
|
||||
cy.get('#input_searchTerm', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(guestUser.username).wait(TIMEOUTS.TWO_SEC);
|
||||
});
|
||||
|
||||
it('MM-18048 Deactivate Guest User and Verify', () => {
|
||||
// # Click on the Deactivate option
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click();
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByText('Deactivate').click();
|
||||
|
||||
// * Verify the confirmation message displayed
|
||||
cy.get('#confirmModal').should('be.visible').within(() => {
|
||||
cy.get('#confirmModalLabel').should('be.visible').and('have.text', `Deactivate ${guestUser.username}`);
|
||||
cy.get('.modal-body').should('be.visible').and('have.text', `This action deactivates ${guestUser.username}. They will be logged out and not have access to any teams or channels on this system. Are you sure you want to deactivate ${guestUser.username}?`);
|
||||
cy.get('.modal-body').should('be.visible').and('have.text', `This action deactivates ${guestUser.username}. They will be logged out and not have access to any teams or channels on this system.\nAre you sure you want to deactivate ${guestUser.username}?`);
|
||||
});
|
||||
|
||||
// * Verify the behavior when Cancel button in the confirmation message is clicked
|
||||
@ -75,21 +75,21 @@ describe('Guest Account - Verify Manage Guest Users', () => {
|
||||
verifyGuest();
|
||||
|
||||
// * Verify the behavior when Deactivate button in the confirmation message is clicked
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click();
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByText('Deactivate').click();
|
||||
cy.get('#confirmModalButton').click();
|
||||
cy.get('#confirmModal').should('not.exist');
|
||||
verifyGuest('Inactive ');
|
||||
verifyGuest('Deactivated');
|
||||
|
||||
// # Reload and verify if behavior is same
|
||||
cy.reload();
|
||||
cy.get('#searchUsers').should('be.visible').type(guestUser.username);
|
||||
verifyGuest('Inactive ');
|
||||
cy.get('#input_searchTerm').should('be.visible').type(guestUser.username);
|
||||
verifyGuest('Deactivated');
|
||||
});
|
||||
|
||||
it('MM-18048 Activate Guest User and Verify', () => {
|
||||
// # Click on the Activate option
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByTestId('userListRow').find('.MenuWrapper a').should('be.visible').click();
|
||||
cy.get('#actionMenuButton-systemUsersTable-0').click();
|
||||
cy.wait(TIMEOUTS.HALF_SEC).findByText('Activate').click();
|
||||
|
||||
// * Verify if User's status is activated again
|
||||
@ -97,7 +97,7 @@ describe('Guest Account - Verify Manage Guest Users', () => {
|
||||
|
||||
// # Reload and verify if behavior is same
|
||||
cy.reload();
|
||||
cy.get('#searchUsers').should('be.visible').type(guestUser.username);
|
||||
cy.get('#input_searchTerm').should('be.visible').type(guestUser.username);
|
||||
verifyGuest();
|
||||
});
|
||||
});
|
||||
|
@ -61,7 +61,7 @@ describe('Archived channels', () => {
|
||||
cy.visit(`/admin_console/user_management/channels/${testChannel.id}`);
|
||||
|
||||
// * Verify the Unarchive Channel button is visible
|
||||
cy.get('button.ArchiveButton', {timeout: TIMEOUTS.ONE_MIN}).findByText('Unarchive Channel').should('be.visible');
|
||||
cy.get('button.btn-secondary', {timeout: TIMEOUTS.TWO_SEC}).should('have.text', 'Unarchive Channel').should('be.visible').should('be.enabled');
|
||||
|
||||
// * Verify that only one widget is visible
|
||||
cy.get('div.AdminPanel').should('be.visible').and('have.length', 1);
|
||||
@ -72,10 +72,10 @@ describe('Archived channels', () => {
|
||||
cy.visit(`/admin_console/user_management/channels/${testChannel.id}`);
|
||||
|
||||
// # Click Unarchive Channel button
|
||||
cy.get('button.ArchiveButton', {timeout: TIMEOUTS.ONE_MIN}).findAllByText('Unarchive Channel').click();
|
||||
cy.get('button.btn-secondary', {timeout: TIMEOUTS.TWO_SEC}).findAllByText('Unarchive Channel').click();
|
||||
|
||||
// * Verify the Archive Channel button is visible
|
||||
cy.get('button.ArchiveButton', {timeout: TIMEOUTS.TWO_SEC}).findAllByText('Archive Channel').should('be.visible');
|
||||
cy.get('button.btn-secondary.btn-danger', {timeout: TIMEOUTS.TWO_SEC}).findAllByText('Archive Channel').should('be.visible');
|
||||
|
||||
// * Verify that the other widget appears
|
||||
cy.get('div.AdminPanel').should('be.visible').should('have.length', 5);
|
||||
|
@ -148,7 +148,7 @@ describe('Compliance Export', () => {
|
||||
cy.findByTestId('enableComplianceExportfalse').click();
|
||||
|
||||
// * Verify that exported button is disabled
|
||||
cy.findByRole('button', {name: /run compliance export job now/i}).should('be.enabled');
|
||||
cy.findByRole('button', {name: /run compliance export job now/i}).should('be.not.enabled');
|
||||
});
|
||||
|
||||
it('MM-T1167 - Compliance Export job can be canceled', () => {
|
||||
|
@ -78,7 +78,7 @@ describe('System Console > Site Statistics', () => {
|
||||
cy.get('.admin-console__content .row').should('have.length', 4);
|
||||
|
||||
// * Check that the title content for the stats is as expected.
|
||||
cy.findByTestId('totalActiveUsersTitle').should('contain', 'Total Active Users');
|
||||
cy.findByTestId('totalActiveUsersTitle').should('have.text', 'Total Activated Users');
|
||||
|
||||
// cy.findByTestId('seatPurchasedTitle').should('contain', 'Total paid users');
|
||||
cy.findByTestId('totalTeamsTitle').should('contain', 'Total Teams');
|
||||
|
@ -243,11 +243,8 @@ describe('Upload Files', () => {
|
||||
// # Set the viewport to mobile
|
||||
cy.viewport('iphone-6');
|
||||
|
||||
// # Scan inside of the message input region
|
||||
cy.findByLabelText('Login Successful message input complimentary region').should('be.visible').within(() => {
|
||||
// * Check if the attachment button is present
|
||||
cy.findByLabelText('Attachment Icon').should('be.visible').and('have.css', 'cursor', 'pointer');
|
||||
});
|
||||
// * Check if the attachment button is present
|
||||
cy.findByLabelText('Attachment Icon').should('be.visible').and('have.css', 'cursor', 'pointer');
|
||||
|
||||
const imageFilename = 'jpg-image-file.jpg';
|
||||
const imageType = 'JPG';
|
||||
|
@ -104,7 +104,7 @@ describe('Integrations', () => {
|
||||
[`#rhsPost_${postId}`, `#post_${postId}`].forEach((selector) => {
|
||||
cy.get(selector).should('have.class', 'current--user').within(() => {
|
||||
cy.get('.profile-icon').should('not.be.visible');
|
||||
cy.get('.post-message__text').findByText(message).should('have.css', 'color', 'rgba(63, 67, 80, 0.6)');
|
||||
cy.get('.post-message__text').findByText(message).should('have.css', 'color', 'rgba(63, 67, 80, 0.75)');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -445,5 +445,5 @@ describe('Integrations page', () => {
|
||||
|
||||
function integrationPageTitleIsBold(title) {
|
||||
cy.get('.section-title__text').contains(title).click();
|
||||
cy.get('.item-details__name').should('be.visible').and('have.css', 'font-weight', '600');
|
||||
cy.get('.item-details__name').should('be.visible').and('have.css', 'font-weight', '400');
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
// Stage: @prod
|
||||
// Group: @channels @keyboard_shortcuts
|
||||
|
||||
import * as TIMEOUTS from '../../../fixtures/timeouts';
|
||||
|
||||
describe('Keyboard Shortcuts', () => {
|
||||
before(() => {
|
||||
cy.apiInitSetup({loginAfter: true}).then(({channelUrl}) => {
|
||||
@ -44,8 +46,7 @@ describe('Keyboard Shortcuts', () => {
|
||||
}
|
||||
|
||||
// * Confirm that reply textbox has focus
|
||||
cy.findByTestId('reply_textbox').should('be.focused');
|
||||
cy.findByTestId('reply_textbox').clear();
|
||||
cy.findByTestId('reply_textbox').should('be.focused').clear();
|
||||
|
||||
// # Press CTRL/CMD + uparrow repeatedly
|
||||
let previousMessageIndex = messages.length - 1;
|
||||
@ -71,14 +72,11 @@ describe('Keyboard Shortcuts', () => {
|
||||
cy.findByTestId('reply_textbox').cmdOrCtrlShortcut('{downarrow}').should('have.text', messages[0]);
|
||||
|
||||
// # Close the RHS
|
||||
cy.uiCloseRHS();
|
||||
cy.uiCloseRHS().wait(TIMEOUTS.HALF_SEC);
|
||||
});
|
||||
|
||||
// * Press CTRL/CMD + uparrow in central textbox check if the text is equal to the last message
|
||||
cy.findByTestId('post_textbox').cmdOrCtrlShortcut('{uparrow}').should('have.text', messages[messages.length - 1]);
|
||||
|
||||
// * Press CTRL/CMD + downarrow in central textbox check if the text is equal to the last message / there is no change in text
|
||||
cy.findByTestId('post_textbox').cmdOrCtrlShortcut('{downarrow}').should('have.text', messages[messages.length - 1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -71,19 +71,19 @@ describe('Mark as Unread', () => {
|
||||
verifyPostNextToNewMessageSeparator(`this is from user: ${otherUser1.id}, 7`);
|
||||
|
||||
// * Verify the group message in LHS is unread
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).should('have.attr', 'aria-label', `${otherUser1.username}, ${otherUser2.username} unread`);
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).should('have.attr', 'aria-label', `${otherUser1.username}, ${otherUser2.username} 2 mentions`);
|
||||
|
||||
// # Leave the group message channel
|
||||
cy.get('#sidebarItem_town-square').click();
|
||||
|
||||
// * Verify the group message in LHS is unread
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).should('have.attr', 'aria-label', `${otherUser1.username}, ${otherUser2.username} unread`);
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).should('have.attr', 'aria-label', `${otherUser1.username}, ${otherUser2.username} 2 mentions`);
|
||||
|
||||
// # Go to the group message channel
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).click().wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
// * Verify the group message in LHS is read
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).should('exist').should('not.have.attr', 'aria-label', `${otherUser1.username}, ${otherUser2.username} unread`);
|
||||
cy.get(`#sidebarItem_${gmChannel.name}`).should('exist').should('not.have.attr', 'aria-label', `${otherUser1.username}, ${otherUser2.username} 2 mentions`);
|
||||
|
||||
// * Verify the notification separator line exists and present before the unread message
|
||||
verifyPostNextToNewMessageSeparator(`this is from user: ${otherUser1.id}, 7`);
|
||||
|
@ -17,7 +17,7 @@ describe('Status dropdown menu', () => {
|
||||
const statusTestCases = [
|
||||
{text: 'Online', className: 'icon-check-circle', profileClassName: 'icon-check-circle'},
|
||||
{text: 'Away', className: 'icon-clock'},
|
||||
{text: 'Do Not Disturb', className: 'icon-minus-circle'},
|
||||
{text: 'Do not disturb', className: 'icon-minus-circle'},
|
||||
{text: 'Offline', className: 'icon-circle-outline'},
|
||||
];
|
||||
|
||||
@ -67,7 +67,7 @@ describe('Status dropdown menu', () => {
|
||||
cy.uiOpenUserMenu().as('userMenu');
|
||||
|
||||
// * Verify "Set a Custom Status" header is clickable
|
||||
cy.get('@userMenu').findByText('Set a Custom Status').should('have.css', 'cursor', 'pointer');
|
||||
cy.get('@userMenu').findByText('Set a custom status').should('have.css', 'cursor', 'pointer');
|
||||
});
|
||||
|
||||
it('MM-T2927_5 When custom status is disabled, status menu is displayed when status icon is clicked', () => {
|
||||
@ -110,7 +110,7 @@ function stepThroughStatuses(statusTestCases = []) {
|
||||
// * Verify the user's status icon changes correctly every time
|
||||
statusTestCases.forEach((tc) => {
|
||||
// # Open user menu and click option
|
||||
if (tc.text === 'Do Not Disturb') {
|
||||
if (tc.text === 'Do not disturb') {
|
||||
cy.uiOpenDndStatusSubMenu().find('#dndTime-thirty_minutes_menuitem').click();
|
||||
} else {
|
||||
cy.uiOpenUserMenu(tc.text);
|
||||
|
@ -192,7 +192,7 @@ describe('Forward Message', () => {
|
||||
cy.get('.forward-post__select').should('not.exist');
|
||||
|
||||
// * Assert if button is enabled
|
||||
cy.get('.GenericModal__button.confirm').should('not.be.disabled');
|
||||
cy.get('.btn-tertiary').should('not.be.disabled');
|
||||
|
||||
// * Assert Notification is shown
|
||||
cy.findByTestId('notification_forward_post').should('be.visible').should('contain.text', `This message is from a private conversation and can only be shared with ${dmChannel.display_name}`);
|
||||
@ -207,7 +207,7 @@ describe('Forward Message', () => {
|
||||
|
||||
if (cancel) {
|
||||
// * Assert if button is active
|
||||
cy.get('.GenericModal__button.cancel').should('not.be.disabled').type('{esc}', {force: true});
|
||||
cy.get('.btn-tertiary').should('not.be.disabled').type('{esc}', {force: true});
|
||||
} else {
|
||||
// * Assert if button is active
|
||||
cy.get('.GenericModal__button.confirm').should('not.be.disabled').type('{enter}', {force: true});
|
||||
|
@ -189,7 +189,7 @@ describe('Forward Message', () => {
|
||||
|
||||
if (cancel) {
|
||||
// * Assert if button is active
|
||||
cy.get('.GenericModal__button.cancel').should('not.be.disabled').click();
|
||||
cy.get('.btn-tertiary').should('not.be.disabled').click();
|
||||
} else {
|
||||
// * Assert if button is active
|
||||
cy.get('.GenericModal__button.confirm').should('not.be.disabled').click();
|
||||
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
@ -68,7 +68,6 @@ describe('Quick switcher', () => {
|
||||
|
||||
// # Search with the term a
|
||||
cy.focused().type('a').wait(TIMEOUTS.HALF_SEC);
|
||||
cy.get('body').type('{downarrow}');
|
||||
|
||||
// * Should have recently interacted DM on top
|
||||
cy.get('.suggestion--selected').should('exist').and('contain.text', secondUser.username);
|
||||
@ -86,7 +85,6 @@ describe('Quick switcher', () => {
|
||||
|
||||
// # Search with the term a
|
||||
cy.focused().type('a').wait(TIMEOUTS.HALF_SEC);
|
||||
cy.get('body').type('{downarrow}');
|
||||
|
||||
// * Should have recently interacted DM on top
|
||||
cy.get('.suggestion--selected').should('exist').and('contain.text', thirdUser.username);
|
||||
@ -100,7 +98,6 @@ describe('Quick switcher', () => {
|
||||
|
||||
cy.uiGetPostTextBox().cmdOrCtrlShortcut('K');
|
||||
cy.focused().type('a').wait(TIMEOUTS.HALF_SEC);
|
||||
cy.get('body').type('{downarrow}');
|
||||
|
||||
// * Should have recently interacted DM on top
|
||||
cy.get('.suggestion--selected').should('exist').and('contain.text', secondUser.username);
|
||||
|
@ -32,6 +32,9 @@ describe('Demo plugin - Webhook events', () => {
|
||||
ServiceSettings: {
|
||||
EnableGifPicker: true,
|
||||
},
|
||||
FileSettings: {
|
||||
EnablePublicLink: true,
|
||||
},
|
||||
};
|
||||
cy.apiUpdateConfig(newSettings);
|
||||
|
||||
|
@ -17,6 +17,21 @@ describe('Link tooltips', () => {
|
||||
cy.shouldNotRunOnCloudEdition();
|
||||
cy.shouldHavePluginUploadEnabled();
|
||||
|
||||
// # Set plugin settings
|
||||
const newSettings = {
|
||||
PluginSettings: {
|
||||
Enable: true,
|
||||
},
|
||||
ServiceSettings: {
|
||||
EnableGifPicker: true,
|
||||
},
|
||||
FileSettings: {
|
||||
EnablePublicLink: true,
|
||||
},
|
||||
};
|
||||
|
||||
cy.apiUpdateConfig(newSettings);
|
||||
|
||||
// # Enable the demo-plugin
|
||||
cy.apiUploadAndEnablePlugin(demoPlugin);
|
||||
|
||||
|
@ -23,9 +23,9 @@ export const agendaPlugin = {
|
||||
|
||||
export const demoPlugin = {
|
||||
id: 'com.mattermost.demo-plugin',
|
||||
version: '0.9.0',
|
||||
url: 'https://github.com/mattermost/mattermost-plugin-demo/releases/download/v0.9.0/com.mattermost.demo-plugin-0.9.0.tar.gz',
|
||||
filename: 'com.mattermost.demo-plugin-0.9.0.tar.gz',
|
||||
version: '0.10.0',
|
||||
url: 'https://github.com/mattermost/mattermost-plugin-demo/releases/download/v0.10.0/com.mattermost.demo-plugin-0.10.0.tar.gz',
|
||||
filename: 'com.mattermost.demo-plugin-0.10.0.tar.gz',
|
||||
};
|
||||
|
||||
export const demoPluginOld = {
|
||||
|
@ -21,7 +21,7 @@ const (
|
||||
)
|
||||
|
||||
func (api *API) InitEmoji() {
|
||||
api.BaseRoutes.Emojis.Handle("", api.APISessionRequired(createEmoji)).Methods("POST")
|
||||
api.BaseRoutes.Emojis.Handle("", api.APISessionRequired(createEmoji, handlerParamFileAPI)).Methods("POST")
|
||||
api.BaseRoutes.Emojis.Handle("", api.APISessionRequired(getEmojiList)).Methods("GET")
|
||||
api.BaseRoutes.Emojis.Handle("/names", api.APISessionRequired(getEmojisByNames)).Methods("POST")
|
||||
api.BaseRoutes.Emojis.Handle("/search", api.APISessionRequired(searchEmojis)).Methods("POST")
|
||||
|
Loading…
Reference in New Issue
Block a user