Skip to content

Commit

Permalink
add more accessibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonas Berhe authored and Yonas Berhe committed Feb 24, 2025
1 parent e020b5f commit 28eee9d
Show file tree
Hide file tree
Showing 13 changed files with 357 additions and 50 deletions.
4 changes: 4 additions & 0 deletions cypress/e2e/po/components/toggle-switch.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ export default class ToggleSwitchPo extends ComponentPo {
.then(() => this.value())
.then((value) => expect(value).equal(label));
}

get(selector: string) {
return this.self().find(selector);
}
}
5 changes: 5 additions & 0 deletions cypress/e2e/po/edit/chart-repositories.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LabeledSelectPo from '@/cypress/e2e/po/components/labeled-select.po';
import RadioGroupInputPo from '@/cypress/e2e/po/components/radio-group-input.po';
import NameNsDescription from '@/cypress/e2e/po/components/name-ns-description.po';
import SelectOrCreateAuthPo from '@/cypress/e2e/po/components/select-or-create-auth.po';
import KeyValuePo from '@/cypress/e2e/po/components/key-value.po';

export default class ChartRepositoriesCreateEditPo extends PagePo {
private static createPath(clusterId: string, product: 'apps' | 'manager', repoName?: string ) {
Expand Down Expand Up @@ -54,6 +55,10 @@ export default class ChartRepositoriesCreateEditPo extends PagePo {
return new RadioGroupInputPo('[data-testid="clusterrepo-radio-input"]');
}

lablesAnnotationsKeyValue() {
return new KeyValuePo(this.self());
}

saveCreateForm(): AsyncButtonPo {
return new AsyncButtonPo('[data-testid="action-button-async-button"]', this.self());
}
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/po/edit/pod-security-admissions.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import InputPo from '@/cypress/e2e/po/components/input.po';
import CheckboxInputPo from '@/cypress/e2e/po/components/checkbox-input.po';
import AsyncButtonPo from '@/cypress/e2e/po/components/async-button.po';
import CodeMirrorPo from '@/cypress/e2e/po/components/code-mirror.po';
import ResourceDetailPo from '@/cypress/e2e/po/edit/resource-detail.po';

export default class PodSecurityAdmissionsCreateEditPo extends PagePo {
private static createPath(clusterId: string, id?: string ) {
Expand All @@ -21,6 +22,10 @@ export default class PodSecurityAdmissionsCreateEditPo extends PagePo {
super(PodSecurityAdmissionsCreateEditPo.createPath(clusterId, id));
}

resourceDetail() {
return new ResourceDetailPo(this.self());
}

nameNsDescription() {
return new NameNsDescription(this.self());
}
Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/po/pages/account-api-keys.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export default class AccountPagePo extends PagePo {
return this.self().get('button[type="reset"]').click();
}

changePasswordModal() {
return cy.get('.change-password-modal');
}

currentPassword(): PasswordPo {
return new PasswordPo('[data-testid="account__current_password"]');
}
Expand Down
6 changes: 5 additions & 1 deletion cypress/e2e/po/pages/global-settings/settings.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export class SettingsPagePo extends RootClusterPage {
return this.advancedSettingRow(label).find('[data-testid*="action-button"]');
}

editSettingsButton() {
return cy.get('[dropdown-menu-item]').contains('Edit Setting');
}

/**
* Click Edit Settings
* @param label
Expand All @@ -44,7 +48,7 @@ export class SettingsPagePo extends RootClusterPage {
editSettingsByLabel(label: string) {
this.actionButtonByLabel(label).click();

return cy.contains('Edit Setting').click();
return this.editSettingsButton().click();
}

editSettings(clusterId: string, setting: string) {
Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/po/pages/login-page.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ export class LoginPagePo extends PagePo {
loginBackgroundImage() {
return cy.getId('login-landscape__img');
}

localSelector() {
return cy.getId('locale-selector');
}
}
2 changes: 1 addition & 1 deletion cypress/e2e/po/side-bars/burger-side-menu.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ export default class BurgerMenuPo extends ComponentPo {
* @returns
*/
headerBrandLogoImage(): Cypress.Chainable {
return cy.getId('header-side-menu__brand-img');
return cy.getId('header__brand-img');
}
}
4 changes: 2 additions & 2 deletions cypress/e2e/po/side-bars/user-menu.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default class UserMenuPo extends ComponentPo {
* When added to the dom it may not yet be visible
*
*/
private userMenuContainer() {
return cy.get('body').find('[dropdown-menu-collection]');
userMenuContainer() {
return cy.get('[dropdown-menu-collection]');
}

/**
Expand Down
Loading

0 comments on commit 28eee9d

Please sign in to comment.