MM-62288 - add e2e to RHS focus functionality (#29655)
* MM-62288 - add e2e to RHS focus functionality * remove describe only * Use existence check before closing RHS * modify close rhs function to not fail when rhs is not opened * avoid body to not get found --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -165,6 +165,81 @@ describe('Verify Accessibility Support in Channel Sidebar Navigation', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Accessibility tests for RHS getting focus after buttons actions', () => {
|
||||
let testUser;
|
||||
|
||||
before(() => {
|
||||
cy.apiInitSetup().then(({team, user}) => {
|
||||
testUser = user;
|
||||
|
||||
// # Login as the test user and visit the town-square channel
|
||||
cy.apiLogin(testUser);
|
||||
cy.visit(`/${team.name}/channels/town-square`);
|
||||
cy.get('#postListContent').should('be.visible');
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// # Close the RHS
|
||||
cy.uiCloseRHS();
|
||||
cy.get('#sidebar-right').should('not.exist');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// # Close the RHS
|
||||
cy.uiCloseRHS();
|
||||
cy.get('#sidebar-right').should('not.exist');
|
||||
});
|
||||
|
||||
it('Focus should be on RHS when opening Recent Mentions', () => {
|
||||
// # Click the Recent Mentions button
|
||||
cy.findByRole('button', {name: /Recent mentions/i}).click();
|
||||
|
||||
// * Verify RHS is open
|
||||
cy.get('#sidebar-right').should('be.visible');
|
||||
|
||||
// * Check that the RHS container is focused
|
||||
cy.get('.sidebar-right-container').should('be.focused');
|
||||
});
|
||||
|
||||
it('Focus should be on RHS when opening Saved Messages', () => {
|
||||
// # Click the Saved Messages button
|
||||
cy.findByRole('button', {name: /Saved messages/i}).click();
|
||||
|
||||
// * Verify RHS is open
|
||||
cy.get('#sidebar-right').should('be.visible');
|
||||
|
||||
// * Check that the RHS container is focused
|
||||
cy.get('.sidebar-right-container').should('be.focused');
|
||||
});
|
||||
|
||||
it('Focus should be on RHS when opening Members', () => {
|
||||
cy.get('#channelHeaderInfo').should('exist');
|
||||
|
||||
// # Click the Members button
|
||||
cy.get('#member_rhs').
|
||||
should('be.visible').
|
||||
click();
|
||||
|
||||
// * Verify RHS is open
|
||||
cy.get('#sidebar-right').should('be.visible');
|
||||
|
||||
// * Check that the RHS container is focused
|
||||
cy.get('.sidebar-right-container').should('be.focused');
|
||||
});
|
||||
|
||||
it('Focus should be on RHS when opening Channel files', () => {
|
||||
// # Click the Channel files button
|
||||
cy.findByRole('button', {name: /Channel files/i}).click();
|
||||
|
||||
// * Verify RHS is open
|
||||
cy.get('#sidebar-right').should('be.visible');
|
||||
|
||||
// * Check that the RHS container is focused
|
||||
cy.get('.sidebar-right-container').should('be.focused');
|
||||
});
|
||||
});
|
||||
|
||||
function markAsFavorite(channelName) {
|
||||
// # Visit the channel
|
||||
cy.get(`#sidebarItem_${channelName}`).click();
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('Messaging', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it.skip('MM-T91 Replying to an older post by a user that has no content (only file attachments)', () => {
|
||||
it('MM-T91 Replying to an older post by a user that has no content (only file attachments)', () => {
|
||||
// # Get yesterdays date in UTC
|
||||
const yesterdaysDate = Cypress.dayjs().subtract(1, 'days').valueOf();
|
||||
|
||||
|
||||
@@ -10,7 +10,12 @@ Cypress.Commands.add('uiGetRHS', (options = {visible: true}) => {
|
||||
});
|
||||
|
||||
Cypress.Commands.add('uiCloseRHS', () => {
|
||||
cy.findByLabelText('Close Sidebar Icon').click();
|
||||
cy.document().then((doc) => {
|
||||
const closeButton = doc.querySelector('[aria-label="Close Sidebar Icon"]');
|
||||
if (closeButton) {
|
||||
closeButton.click();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('uiExpandRHS', () => {
|
||||
|
||||
Ссылка в новой задаче
Block a user