|
| 1 | +import { LoginPagePo } from '@/cypress/e2e/po/pages/login-page.po'; |
| 2 | +import HomePagePo from '@/cypress/e2e/po/pages/home.po'; |
| 3 | +import AboutPagePo from '@/cypress/e2e/po/pages/about.po'; |
| 4 | +import PreferencesPagePo from '@/cypress/e2e/po/pages/preferences.po'; |
| 5 | +import UserMenuPo from '@/cypress/e2e/po/side-bars/user-menu.po'; |
| 6 | +import AccountPagePo from '@/cypress/e2e/po/pages/account-api-keys.po'; |
| 7 | +import CreateKeyPagePo from '@/cypress/e2e/po/pages/account-api-keys-create_key.po'; |
| 8 | + |
| 9 | +describe('Shell a11y testing', { tags: ['@adminUser', '@accessibility'] }, () => { |
| 10 | + it('login page', () => { |
| 11 | + const loginPage = new LoginPagePo(); |
| 12 | + |
| 13 | + loginPage.goTo(); |
| 14 | + loginPage.waitForPage(); |
| 15 | + cy.injectAxe(); |
| 16 | + loginPage.username().set('test user'); |
| 17 | + |
| 18 | + cy.checkPageAccessibility(); |
| 19 | + }); |
| 20 | + |
| 21 | + it('locale selector', () => { |
| 22 | + const loginPage = new LoginPagePo(); |
| 23 | + |
| 24 | + loginPage.goTo(); |
| 25 | + loginPage.waitForPage(); |
| 26 | + cy.injectAxe(); |
| 27 | + cy.get('[data-testid="locale-selector"]').click(); |
| 28 | + cy.checkPageAccessibility(); |
| 29 | + }); |
| 30 | + |
| 31 | + describe('Logged in', { testIsolation: 'off' }, () => { |
| 32 | + const aboutPage = new AboutPagePo(); |
| 33 | + const prefPage = new PreferencesPagePo(); |
| 34 | + const userMenu = new UserMenuPo(); |
| 35 | + |
| 36 | + before(() => { |
| 37 | + cy.login(); |
| 38 | + }); |
| 39 | + |
| 40 | + it('home page', () => { |
| 41 | + HomePagePo.goToAndWaitForGet(); |
| 42 | + cy.injectAxe(); |
| 43 | + |
| 44 | + cy.checkPageAccessibility(); |
| 45 | + }); |
| 46 | + |
| 47 | + it('about page', () => { |
| 48 | + AboutPagePo.navTo(); |
| 49 | + aboutPage.waitForPage(); |
| 50 | + |
| 51 | + cy.checkPageAccessibility(); |
| 52 | + }); |
| 53 | + |
| 54 | + it('preferences page', () => { |
| 55 | + userMenu.clickMenuItem('Preferences'); |
| 56 | + userMenu.isClosed(); |
| 57 | + prefPage.waitForPage(); |
| 58 | + prefPage.checkIsCurrentPage(); |
| 59 | + prefPage.title(); |
| 60 | + cy.injectAxe(); |
| 61 | + |
| 62 | + cy.checkPageAccessibility(); |
| 63 | + }); |
| 64 | + |
| 65 | + describe('account', () => { |
| 66 | + const accountPage = new AccountPagePo(); |
| 67 | + const createKeyPage = new CreateKeyPagePo(); |
| 68 | + |
| 69 | + it('account page', () => { |
| 70 | + userMenu.clickMenuItem('Account & API Keys'); |
| 71 | + accountPage.waitForPage(); |
| 72 | + cy.injectAxe(); |
| 73 | + accountPage.checkIsCurrentPage(); |
| 74 | + |
| 75 | + cy.checkPageAccessibility(); |
| 76 | + }); |
| 77 | + |
| 78 | + it('change password dialog', () => { |
| 79 | + accountPage.changePassword(); |
| 80 | + |
| 81 | + cy.checkElementAccessibility('.change-password-modal'); |
| 82 | + |
| 83 | + accountPage.cancel(); |
| 84 | + }); |
| 85 | + |
| 86 | + it('create API key', () => { |
| 87 | + accountPage.create(); |
| 88 | + createKeyPage.waitForPage(); |
| 89 | + createKeyPage.isCurrentPage(); |
| 90 | + |
| 91 | + cy.checkPageAccessibility(); |
| 92 | + }); |
| 93 | + }); |
| 94 | + }); |
| 95 | +}); |
0 commit comments