Skip to content

Commit 144d377

Browse files
committed
web: Fix selectors.
1 parent 4787ee9 commit 144d377

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

web/tests/pageobjects/admin.page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Page from "../pageobjects/page.js";
33
import { $ } from "@wdio/globals";
44

55
export default class AdminPage extends Page {
6-
public async pageHeader() {
7-
return await $(">>>ak-page-header").$('>>>slot[name="header"]');
6+
public pageHeader() {
7+
return $(">>>ak-page-navbar").$(".page-title");
88
}
99

1010
async openApplicationsListPage() {

web/tests/pageobjects/controls.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { browser } from "@wdio/globals";
2-
import { match } from "ts-pattern";
32
import { Key } from "webdriverio";
43

54
export async function doBlur(el: WebdriverIO.Element | ChainablePromiseElement) {
@@ -85,11 +84,13 @@ export async function setFormGroup(name: string | RegExp, setting: "open" | "clo
8584
}
8685

8786
await formGroup.scrollIntoView();
88-
const toggle = await formGroup.$(">>>div.pf-c-form__field-group-toggle-button button");
89-
await match([await toggle.getAttribute("aria-expanded"), setting])
90-
.with(["false", "open"], async () => await toggle.click())
91-
.with(["true", "closed"], async () => await toggle.click())
92-
.otherwise(async () => {});
87+
88+
const open = await formGroup.getAttribute("open").then((value) => value !== null);
89+
90+
if ((setting === "open" && !open) || (setting === "closed" && open)) {
91+
await formGroup.$(">>>summary").click();
92+
}
93+
9394
await doBlur(formGroup);
9495
}
9596

web/tests/pageobjects/forms/application.form.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class ApplicationForm extends Page {
88
}
99

1010
async uiSettings() {
11-
return await $(">>>ak-form-group").$('button[aria-label="UI Settings"]');
11+
return $('>>>ak-form-group[label="UI Settings"]');
1212
}
1313

1414
async launchUrl() {

0 commit comments

Comments
 (0)