Skip to content

Commit

Permalink
Fix failed test (#31652)
Browse files Browse the repository at this point in the history
* fix failed test

* code clean-up
  • Loading branch information
fazilqa authored Aug 28, 2024
1 parent e9b8b97 commit f7474fe
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import SecureMessagingSite from '../sm_site/SecureMessagingSite';
import { AXE_CONTEXT, Locators, Data } from '../utils/constants';
import SecureMessagingLandingPage from '../pages/SecureMessagingLandingPage';

// veification of 'Back to top' link slipped and will be fixed in separate PR
describe('Secure Messaging Verify Links and Buttons Keyboard Nav', () => {
it('Tab to Links and Buttons on the Landing Page', () => {
cy.viewport(1810, 1080);
SecureMessagingSite.login();
SecureMessagingLandingPage.loadMainPage();

cy.tabToElement('[text="Go to your inbox"]').should(
cy.tabToElement(Locators.ALERTS.INBOX_TEXT).should(
'have.text',
Data.GO_YOUR_INBOX,
);
Expand All @@ -24,14 +24,16 @@ describe('Secure Messaging Verify Links and Buttons Keyboard Nav', () => {
cy.get(el).should('have.focus');
});

cy.realPress('Tab');
cy.get(Locators.ALERTS.BACK_TOP).scrollIntoView();

cy.get(Locators.ALERTS.BACK_TOP)
.shadow()
.find('a')
.should(`have.attr`, `href`, `#ds-back-to-top`);
.should('be.visible')
.and(`have.attr`, `href`, `#ds-back-to-top`);

// cy.get(Locators.ALERTS.BACK_TOP).should('have.focus');
cy.realPress('Tab');
cy.get(Locators.ALERTS.BACK_TOP).should('have.focus');

cy.injectAxe();
cy.axeCheck(AXE_CONTEXT);
Expand Down

0 comments on commit f7474fe

Please sign in to comment.