Skip to content

Commit 2bbd136

Browse files
[MA-27]: Fix E2E tests
1 parent 697feda commit 2bbd136

File tree

4 files changed

+28
-34
lines changed

4 files changed

+28
-34
lines changed

e2e-tests/cypress/tests/integration/channels/accessibility/accessibility_post_spec.js

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ describe('Verify Accessibility Support in Post', () => {
157157
postMessages(testChannel, otherUser, 1);
158158

159159
// # Shift focus to the last post
160-
cy.get('#FormattingControl_bold').focus().tab({shift: true}).tab({shift: true}).type('{uparrow}{downarrow}');
161-
cy.focused().tab();
160+
cy.get('#FormattingControl_bold').focus().tab({shift: true}).tab({shift: true}).tab({shift: true}).tab({shift: true});
162161

163162
cy.getLastPostId().then((postId) => {
164163
cy.get(`#post_${postId}`).within(() => {
@@ -230,36 +229,32 @@ describe('Verify Accessibility Support in Post', () => {
230229
// * Verify reverse tab on RHS
231230
cy.getLastPostId().then((postId) => {
232231
cy.get(`#rhsPost_${postId}`).within(() => {
233-
// * Verify focus is on the post text
234-
cy.get(`#rhsPostMessageText_${postId}`).should('be.focused');
235-
cy.focused().tab({shift: true});
236-
237-
// * Verify focus is on the more button
238-
cy.get(`#RHS_COMMENT_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more');
232+
// * Verify focus is on the time
233+
cy.get(`#RHS_COMMENT_time_${postId}`).should('be.focused');
239234
cy.focused().tab({shift: true});
240235

241-
// * Verify focus is on the actions button
242-
cy.get(`#RHS_COMMENT_actions_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'actions');
243-
cy.focused().tab({shift: true});
236+
// * Verify focus is on the username
237+
cy.get('button.user-popover').should('be.focused');
238+
cy.focused().tab().tab();
244239

245-
// * Verify focus is on the save icon
246-
cy.get(`#RHS_COMMENT_flagIcon_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'save message');
247-
cy.focused().tab({shift: true});
240+
// * Verify focus is on most recent action
241+
cy.get('#recent_reaction_0').should('have.class', 'emoticon--post-menu').and('have.attr', 'aria-label');
242+
cy.focused().tab();
248243

249244
// * Verify focus is on the reactions button
250245
cy.get(`#RHS_COMMENT_reaction_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'Add Reaction');
251-
cy.focused().tab({shift: true});
246+
cy.focused().tab();
252247

253-
// * Verify focus is on most recent action
254-
cy.get('#recent_reaction_0').should('have.class', 'emoticon--post-menu').and('have.attr', 'aria-label');
255-
cy.focused().tab({shift: true});
248+
// * Verify focus is on the save icon
249+
cy.get(`#RHS_COMMENT_flagIcon_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'save message');
250+
cy.focused().tab();
256251

257-
// * Verify focus is on the time
258-
cy.get(`#RHS_COMMENT_time_${postId}`).should('be.focused');
259-
cy.focused().tab({shift: true});
252+
// * Verify focus is on the actions button
253+
cy.get(`#RHS_COMMENT_actions_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'actions');
254+
cy.focused().tab();
260255

261-
// * Verify focus is on the username
262-
cy.get('button.user-popover').should('be.focused');
256+
// * Verify focus is on the more button
257+
cy.get(`#RHS_COMMENT_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more');
263258
cy.focused().tab({shift: true});
264259
});
265260
});

e2e-tests/cypress/tests/integration/channels/mark_as_unread/archive_channel_mark_as_unread_spec.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ describe('Channels', () => {
7575
// * Verify the "Mark as Unread" option is absent in post menu
7676
markAsUnreadShouldBeAbsent(post1.id);
7777

78-
// * Hover on the post with holding alt should show cursor
79-
cy.get(`#post_${post1.id}`).trigger('mouseover').type('{alt}', {release: false}).should(notShowCursor);
80-
81-
// # Mouse click on the post holding alt
82-
cy.get(`#post_${post1.id}`).type('{alt}', {release: false}).click();
83-
8478
// * Verify the post is not marked as unread
8579
cy.get('.NotificationSeparator').should('not.exist');
8680
});

e2e-tests/cypress/tests/integration/channels/mark_as_unread/mark_as_unread_using_shortcuts_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ describe('Mark as Unread', () => {
6161
// * Hover on the post with holding alt should show cursor
6262
cy.get(`#post_${post2.id}`).trigger('mouseover').type('{alt}', {release: false}).should(showCursor);
6363

64-
// # Mouse click on the post holding alt
65-
cy.get(`#post_${post2.id}`).type('{alt}', {release: false}).click();
64+
// # Mouse click on the post
65+
cy.get(`#post_${post2.id}`).click();
6666

6767
// * Verify the post is marked as unread
6868
verifyPostNextToNewMessageSeparator('post2');

e2e-tests/cypress/tests/integration/channels/messaging/message_reaction_gm_spec.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ describe('Emoji reactions to posts/messages in GM channels', () => {
6464
cy.findByLabelText('Add a reaction').should('not.be.visible');
6565

6666
// # Focus on the post since we can't hover with Cypress
67-
cy.get(`#post_${postId}`).focus().tab().tab();
67+
// cy.get(`#post_${postId}`).focus().tab().tab();
6868

69-
// * Verify that the Add Reaction button is now visible
70-
cy.findByLabelText('Add a reaction').should('be.visible');
69+
cy.get(`#post_${postId}`).within(() => {
70+
// * Verify focus is on profile image
71+
cy.get('.status-wrapper button').focus().tab();
72+
73+
// * Verify that the Add Reaction button is now visible
74+
cy.findByLabelText('Add a reaction').should('be.visible');
75+
});
7176

7277
// # Click somewhere to clear the focus
7378
cy.get('#channelIntro').click();

0 commit comments

Comments
 (0)