diff --git a/e2e-tests/cypress/tests/integration/channels/accessibility/accessibility_post_spec.js b/e2e-tests/cypress/tests/integration/channels/accessibility/accessibility_post_spec.js index f74a7a5360..b71ed0ec78 100644 --- a/e2e-tests/cypress/tests/integration/channels/accessibility/accessibility_post_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/accessibility/accessibility_post_spec.js @@ -157,8 +157,7 @@ describe('Verify Accessibility Support in Post', () => { postMessages(testChannel, otherUser, 1); // # Shift focus to the last post - cy.get('#FormattingControl_bold').focus().tab({shift: true}).tab({shift: true}).type('{uparrow}{downarrow}'); - cy.focused().tab(); + cy.get('#FormattingControl_bold').focus().tab({shift: true}).tab({shift: true}).tab({shift: true}).tab({shift: true}); cy.getLastPostId().then((postId) => { cy.get(`#post_${postId}`).within(() => { @@ -199,9 +198,6 @@ describe('Verify Accessibility Support in Post', () => { // * Verify focus is on the more button cy.get(`#CENTER_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more'); cy.focused().tab(); - - // * Verify focus is on the post text - cy.get(`#postMessageText_${postId}`).should('be.focused'); }); }); }); @@ -230,36 +226,32 @@ describe('Verify Accessibility Support in Post', () => { // * Verify reverse tab on RHS cy.getLastPostId().then((postId) => { cy.get(`#rhsPost_${postId}`).within(() => { - // * Verify focus is on the post text - cy.get(`#rhsPostMessageText_${postId}`).should('be.focused'); - cy.focused().tab({shift: true}); - - // * Verify focus is on the more button - cy.get(`#RHS_COMMENT_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more'); - cy.focused().tab({shift: true}); - - // * Verify focus is on the actions button - cy.get(`#RHS_COMMENT_actions_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'actions'); - cy.focused().tab({shift: true}); - - // * Verify focus is on the save icon - cy.get(`#RHS_COMMENT_flagIcon_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'save message'); - cy.focused().tab({shift: true}); - - // * Verify focus is on the reactions button - cy.get(`#RHS_COMMENT_reaction_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'Add Reaction'); - cy.focused().tab({shift: true}); - - // * Verify focus is on most recent action - cy.get('#recent_reaction_0').should('have.class', 'emoticon--post-menu').and('have.attr', 'aria-label'); - cy.focused().tab({shift: true}); - // * Verify focus is on the time cy.get(`#RHS_COMMENT_time_${postId}`).should('be.focused'); cy.focused().tab({shift: true}); // * Verify focus is on the username cy.get('button.user-popover').should('be.focused'); + cy.focused().tab().tab(); + + // * Verify focus is on most recent action + cy.get('#recent_reaction_0').should('have.class', 'emoticon--post-menu').and('have.attr', 'aria-label'); + cy.focused().tab(); + + // * Verify focus is on the reactions button + cy.get(`#RHS_COMMENT_reaction_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'Add Reaction'); + cy.focused().tab(); + + // * Verify focus is on the save icon + cy.get(`#RHS_COMMENT_flagIcon_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'save message'); + cy.focused().tab(); + + // * Verify focus is on the actions button + cy.get(`#RHS_COMMENT_actions_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'actions'); + cy.focused().tab(); + + // * Verify focus is on the more button + cy.get(`#RHS_COMMENT_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more'); cy.focused().tab({shift: true}); }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_input_fields_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_input_fields_spec.ts index 927e258c34..7de7e50a58 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_input_fields_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_input_fields_spec.ts @@ -231,7 +231,7 @@ describe('Verify Accessibility Support in different input fields', () => { cy.get('#rhsContainer').within(() => { // * Verify Accessibility Support in RHS input - cy.uiGetReplyTextBox().should('have.attr', 'placeholder', 'Reply to this thread...').and('have.attr', 'role', 'textbox').focus().type('test').tab({shift: true}).tab().tab(); + cy.uiGetReplyTextBox().should('have.attr', 'placeholder', 'Reply to this thread...').and('have.attr', 'role', 'textbox').focus().type('test').tab(); // * Verify if the focus is on the preview button cy.get('#PreviewInputTextButton').should('be.focused').and('have.attr', 'aria-label', 'preview').tab(); diff --git a/e2e-tests/cypress/tests/integration/channels/mark_as_unread/archive_channel_mark_as_unread_spec.js b/e2e-tests/cypress/tests/integration/channels/mark_as_unread/archive_channel_mark_as_unread_spec.js index 848d6c5cd2..a7973363c7 100644 --- a/e2e-tests/cypress/tests/integration/channels/mark_as_unread/archive_channel_mark_as_unread_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/mark_as_unread/archive_channel_mark_as_unread_spec.js @@ -10,7 +10,7 @@ // Stage: @prod // Group: @channels @mark_as_unread -import {notShowCursor, markAsUnreadShouldBeAbsent} from './helpers'; +import {markAsUnreadShouldBeAbsent} from './helpers'; describe('Channels', () => { let testUser; @@ -75,12 +75,6 @@ describe('Channels', () => { // * Verify the "Mark as Unread" option is absent in post menu markAsUnreadShouldBeAbsent(post1.id); - // * Hover on the post with holding alt should show cursor - cy.get(`#post_${post1.id}`).trigger('mouseover').type('{alt}', {release: false}).should(notShowCursor); - - // # Mouse click on the post holding alt - cy.get(`#post_${post1.id}`).type('{alt}', {release: false}).click(); - // * Verify the post is not marked as unread cy.get('.NotificationSeparator').should('not.exist'); }); diff --git a/e2e-tests/cypress/tests/integration/channels/mark_as_unread/mark_as_unread_using_shortcuts_spec.js b/e2e-tests/cypress/tests/integration/channels/mark_as_unread/mark_as_unread_using_shortcuts_spec.js index b0546edf45..85039ad1f7 100644 --- a/e2e-tests/cypress/tests/integration/channels/mark_as_unread/mark_as_unread_using_shortcuts_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/mark_as_unread/mark_as_unread_using_shortcuts_spec.js @@ -61,8 +61,8 @@ describe('Mark as Unread', () => { // * Hover on the post with holding alt should show cursor cy.get(`#post_${post2.id}`).trigger('mouseover').type('{alt}', {release: false}).should(showCursor); - // # Mouse click on the post holding alt - cy.get(`#post_${post2.id}`).type('{alt}', {release: false}).click(); + // # Mouse click on the post + cy.get(`#post_${post2.id}`).click(); // * Verify the post is marked as unread verifyPostNextToNewMessageSeparator('post2'); diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/message_reaction_gm_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/message_reaction_gm_spec.js index 7ac353d460..127c6198fd 100644 --- a/e2e-tests/cypress/tests/integration/channels/messaging/message_reaction_gm_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/messaging/message_reaction_gm_spec.js @@ -63,11 +63,7 @@ describe('Emoji reactions to posts/messages in GM channels', () => { // * Verify that the Add Reaction button isn't visible cy.findByLabelText('Add a reaction').should('not.be.visible'); - // # Focus on the post since we can't hover with Cypress - cy.get(`#post_${postId}`).focus().tab().tab(); - - // * Verify that the Add Reaction button is now visible - cy.findByLabelText('Add a reaction').should('be.visible'); + cy.get(`#post_${postId}`).trigger('mouseover'); // # Click somewhere to clear the focus cy.get('#channelIntro').click(); diff --git a/webapp/channels/src/components/post/post_component.tsx b/webapp/channels/src/components/post/post_component.tsx index cc4b303960..de8c16a1e0 100644 --- a/webapp/channels/src/components/post/post_component.tsx +++ b/webapp/channels/src/components/post/post_component.tsx @@ -526,7 +526,6 @@ function PostComponent(props: Props) { ref={postRef} id={getTestId()} data-testid={postAriaLabelDivTestId} - tabIndex={0} post={post} className={getClassName()} onClick={handlePostClick} diff --git a/webapp/channels/src/components/post_edit_history/__snapshots__/post_edit_history.test.tsx.snap b/webapp/channels/src/components/post_edit_history/__snapshots__/post_edit_history.test.tsx.snap index 0ebd6f303b..15103bdb2a 100644 --- a/webapp/channels/src/components/post_edit_history/__snapshots__/post_edit_history.test.tsx.snap +++ b/webapp/channels/src/components/post_edit_history/__snapshots__/post_edit_history.test.tsx.snap @@ -300,7 +300,6 @@ exports[`components/post_edit_history should match snapshot 1`] = ` class="post-message__text" dir="auto" id="rhsPostMessageText_post_id" - tabindex="0" >

post message diff --git a/webapp/channels/src/components/post_edit_history/edited_post_item/__snapshots__/edited_post_item.test.tsx.snap b/webapp/channels/src/components/post_edit_history/edited_post_item/__snapshots__/edited_post_item.test.tsx.snap index 7ff40ff474..340d7ecd97 100644 --- a/webapp/channels/src/components/post_edit_history/edited_post_item/__snapshots__/edited_post_item.test.tsx.snap +++ b/webapp/channels/src/components/post_edit_history/edited_post_item/__snapshots__/edited_post_item.test.tsx.snap @@ -131,7 +131,6 @@ exports[`components/post_edit_history/edited_post_item should match snapshot whe class="post-message__text" dir="auto" id="rhsPostMessageText_post_id" - tabindex="0" >

post message diff --git a/webapp/channels/src/components/post_view/post_message_view/__snapshots__/post_message_view.test.tsx.snap b/webapp/channels/src/components/post_view/post_message_view/__snapshots__/post_message_view.test.tsx.snap index dfa0598849..be1945d506 100644 --- a/webapp/channels/src/components/post_view/post_message_view/__snapshots__/post_message_view.test.tsx.snap +++ b/webapp/channels/src/components/post_view/post_message_view/__snapshots__/post_message_view.test.tsx.snap @@ -10,7 +10,6 @@ exports[`components/post_view/PostAttachment should match snapshot 1`] = ` dir="auto" id="postMessageText_post_id" onClick={[Function]} - tabIndex={0} > { maxHeight={maxHeight} >