web: update tests for Chromedriver 131 (#12199)

* web: Add InvalidationFlow to Radius Provider dialogues

## What

- Bugfix: adds the InvalidationFlow to the Radius Provider dialogues
  - Repairs: `{"invalidation_flow":["This field is required."]}` message, which was *not* propagated
    to the Notification.
- Nitpick: Pretties `?foo=${true}` expressions: `s/\?([^=]+)=\$\{true\}/\1/`

## Note

Yes, I know I'm going to have to do more magic when we harmonize the forms, and no, I didn't add the
Property Mappings to the wizard, and yes, I know I'm going to have pain with the *new* version of
the wizard. But this is a serious bug; you can't make Radius servers with *either* of the current
dialogues at the moment.

* web: fix selector warnings in WebdriverIO

Despite the [promises made](https://webdriver.io/docs/selectors#deep-selectors) by the WebdriverIO
team, we are still getting a lot of warnings and "falling back to pre-BIDI behavior" messages
when we attempt to access ShadowDOM contexts without the "pierce" (`>>>`) syntax.  So I've put
it back wherever it occurred and the system now uses the BIDI controllers correctly.

* web: update to Chromedriver 131 breaks a lot of stuff

This annoying bit of janitorial work cleans up the failure messages and resolution bugs
that arose when updating to the latest version of Chrome.  Keeping track of all the
weakness and breakage while the in-browser testing teams figure out how to live with
the ShadowDOM is just really time-consuming.
This commit is contained in:
Ken Sternberg
2024-12-02 08:19:51 -08:00
committed by GitHub
parent a65fb19489
commit 248fcdd1bf
21 changed files with 60 additions and 58 deletions

View File

@ -41,20 +41,20 @@ describe("Select Table", () => {
});
it("the table should have as many entries as the data source", async () => {
const rows = await table.$("tbody").$$("tr");
const rows = await table.$(">>>tbody").$$(">>>tr");
expect(rows.length).toBe(content.length);
});
it(`the third item ought to have the name ${item3.name}`, async () => {
const rows = await table.$("tbody").$$("tr");
const cells = await rows[2].$$("td");
const rows = await table.$(">>>tbody").$$(">>>tr");
const cells = await rows[2].$$(">>>td");
const cell1Text = await cells[1].getText();
expect(cell1Text).toEqual(item3.name);
});
it("Selecting one item ought to result in the value of the table being set", async () => {
const rows = await table.$("tbody").$$("tr");
const control = await rows[2].$$("td")[0].$("input");
const rows = await table.$(">>>tbody").$$(">>>tr");
const control = await rows[2].$$(">>>td")[0].$(">>>input");
await control.click();
expect(await selecttable.getValue()).toEqual(slug(item3.name));
});
@ -88,26 +88,27 @@ describe("Multiselect Table", () => {
});
it("it should render the select-all control", async () => {
const selall = await table.$("thead").$$("tr")[0].$$("td")[0];
const thead = await table.$(">>>thead");
const selall = await thead.$$(">>>tr")[0].$$(">>>td")[0];
if (selall === undefined) {
throw new Error("Could not find table header");
}
const input = await selall.$("input");
const input = await selall.$(">>>input");
expect(await input.getProperty("name")).toEqual("select-all-input");
});
it("it should set the value when one input is clicked", async () => {
const input = await table.$("tbody").$$("tr")[2].$$("td")[0].$("input");
const input = await table.$(">>>tbody").$$(">>>tr")[2].$$(">>>td")[0].$(">>>input");
await input.click();
expect(await selecttable.getValue()).toEqual(slug(nutritionDbUSDA[2].name));
});
it("it should select all when that control is clicked", async () => {
const selall = await table.$("thead").$$("tr")[0].$$("td")[0];
const selall = await table.$(">>>thead").$$(">>>tr")[0].$$(">>>td")[0];
if (selall === undefined) {
throw new Error("Could not find table header");
}
const input = await selall.$("input");
const input = await selall.$(">>>input");
await input.click();
const value = await selecttable.getValue();
const values = value.split(";").toSorted(alphaSort).join(";");
@ -116,11 +117,11 @@ describe("Multiselect Table", () => {
});
it("it should clear all when that control is clicked twice", async () => {
const selall = await table.$("thead").$$("tr")[0].$$("td")[0];
const selall = await table.$(">>>thead").$$(">>>tr")[0].$$(">>>td")[0];
if (selall === undefined) {
throw new Error("Could not find table header");
}
const input = await selall.$("input");
const input = await selall.$(">>>input");
await input.click();
const value = await selecttable.getValue();
const values = value.split(";").toSorted(alphaSort).join(";");

View File

@ -30,7 +30,8 @@ describe("Simple Table", () => {
});
it("the table should have as many entries as the data source", async () => {
const rows = await table.$("tbody").$$("tr");
const tbody = await table.$(">>>tbody");
const rows = await tbody.$$(">>>tr");
expect(rows.length).toBe(content.length);
});

View File

@ -15,7 +15,7 @@ describe("ak-divider", () => {
it("should render the divider with the specified text", async () => {
render(html`<ak-divider><span>Your Message Here</span></ak-divider>`);
const span = await $("ak-divider").$("span");
const span = await $("ak-divider").$(">>>span");
await expect(span).toExist();
await expect(span).toHaveText("Your Message Here");
});