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

Updated Accessibility tests based on the latest label changes on the App #5249

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Verify Accessibility Support in Modals & Dialogs', () => {

it('MM-22623 Accessibility Support in Direct Messages Dialog screen', () => {
// * Verify the aria-label in create direct message button
cy.get('#addDirectChannel').should('have.attr', 'aria-label', 'create new direct message').click();
cy.get('#addDirectChannel').should('have.attr', 'aria-label', 'write a direct message').click();

// * Verify the accessibility support in Direct Messages Dialog`
cy.get('#moreDmModal').should('have.attr', 'role', 'dialog').and('have.attr', 'aria-labelledby', 'moreDmModalLabel').within(() => {
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('Verify Accessibility Support in Modals & Dialogs', () => {

it('MM-22623 Accessibility Support in More Channels Dialog screen', () => {
// * Verify the aria-label in more public channels button
cy.get('#sidebarPublicChannelsMore').should('have.attr', 'aria-label', 'more public channels').click();
cy.get('#sidebarPublicChannelsMore').should('have.attr', 'aria-label', 'See more public channels').click();

// * Verify the accessibility support in More Channels Dialog`
cy.get('#moreChannelsModal').should('have.attr', 'role', 'dialog').and('have.attr', 'aria-labelledby', 'moreChannelsModalLabel').within(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function verifyPostLabel(elementId, username, labelSuffix) {
cy.get('@lastPost').then((el) => {
// # Get the post time
cy.wrap(el).find('time.post__time').invoke('text').then((time) => {
const expectedLabel = `${username} at ${time} ${Cypress.moment().format('dddd, MMMM DD')} ${labelSuffix}`;
const expectedLabel = `At ${time} ${Cypress.moment().format('dddd, MMMM D')}, ${username} ${labelSuffix}`;
cy.wrap(el).should('have.attr', 'aria-label', expectedLabel);
});
});
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('Verify Accessibility Support in Post', () => {
cy.get('#fileUploadButton').focus().tab({shift: true}).tab({shift: true}).type('{uparrow}{downarrow}');

// * Verify reader reads out the post correctly
verifyPostLabel(`#rhsPost_${replyId}`, currentUser.username, `wrote a reply, ${replyMessage}`);
verifyPostLabel(`#rhsPost_${replyId}`, currentUser.username, `replied, ${replyMessage}`);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
cy.wait(TIMEOUTS.SMALL);

// # Press tab to the Add Public Channel button
cy.get('#createPublicChannel').focus().tab({shift: true}).tab().should('have.attr', 'aria-label', 'create new public channel');
cy.get('#createPublicChannel').focus().tab({shift: true}).tab().should('have.attr', 'aria-label', 'create a public channel');

// * Verify if the Plus button is round when it has focus
cy.get('#createPublicChannel').should('have.class', 'a11y--active a11y--focused').and('have.css', 'border-radius', '50%').tab();
Expand All @@ -159,7 +159,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
});

// * Verify if focus is on the more public channels
cy.get('#sidebarPublicChannelsMore').should('have.class', 'a11y--active a11y--focused').and('have.attr', 'aria-label', 'more public channels');
cy.get('#sidebarPublicChannelsMore').should('have.class', 'a11y--active a11y--focused').and('have.attr', 'aria-label', 'See more public channels');
});
});
});
Expand All @@ -174,7 +174,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
cy.wait(TIMEOUTS.SMALL);

// # Press tab to the Add Private Channel button
cy.get('#createPrivateChannel').focus().tab({shift: true}).tab().should('have.attr', 'aria-label', 'create new private channel');
cy.get('#createPrivateChannel').focus().tab({shift: true}).tab().should('have.attr', 'aria-label', 'create a private channel');

// * Verify if the Plus button is round when it has focus
cy.get('#createPrivateChannel').should('have.class', 'a11y--active a11y--focused').and('have.css', 'border-radius', '50%').tab();
Expand Down Expand Up @@ -204,7 +204,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
cy.wait(TIMEOUTS.SMALL);

// # Press tab to the Create DM button
cy.get('#addDirectChannel').focus().tab({shift: true}).tab().should('have.attr', 'aria-label', 'create new direct message');
cy.get('#addDirectChannel').focus().tab({shift: true}).tab().should('have.attr', 'aria-label', 'write a direct message');

// * Verify if the Plus button is round when it has focus
cy.get('#addDirectChannel').should('have.class', 'a11y--active a11y--focused').and('have.css', 'border-radius', '50%').tab();
Expand All @@ -215,7 +215,7 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
cy.focused().tab();
});

// * Verify if focus is on the more public channels
cy.get('#moreDirectMessage').should('have.class', 'a11y--active a11y--focused').and('have.attr', 'aria-label', 'more direct messages');
// * Verify if focus is on the more direct messages
cy.get('#moreDirectMessage').should('have.class', 'a11y--active a11y--focused').and('have.attr', 'aria-label', 'See more direct messages');
});
});