Skip to content

Commit

Permalink
Merge pull request mozilla#18624 from timvandermeij/intermittent-scri…
Browse files Browse the repository at this point in the history
…pting-siblings

Fix the "must check that a value is correctly updated on a field and its siblings" scripting integration test
  • Loading branch information
timvandermeij authored Aug 19, 2024
2 parents 79dce53 + 5cc77d3 commit 88ea60d
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions test/integration/scripting_spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1494,36 +1494,25 @@ describe("Interaction", () => {
await closePages(pages);
});

it("must check that a values is correctly updated on a field and its siblings", async () => {
it("must check that a value is correctly updated on a field and its siblings", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await waitForScripting(page);

await clearInput(page, getSelector("39R"));
await page.type(getSelector("39R"), "123", { delay: 10 });

const prevTotal = await page.$eval(
getSelector("43R"),
el => el.value
);

await clearInput(page, getSelector("42R"));
await page.type(getSelector("42R"), "456", { delay: 10 });

await page.click(getSelector("45R"));

await page.waitForFunction(
`${getQuerySelector("43R")}.value !== "${prevTotal}"`
`${getQuerySelector("43R")}.value === "579.00"`
);
await page.waitForFunction(
`${getQuerySelector("46R")}.value !== "${prevTotal}"`
`${getQuerySelector("46R")}.value === "579.00"`
);

let total = await page.$eval(getSelector("43R"), el => el.value);
expect(total).withContext(`In ${browserName}`).toEqual("579.00");

total = await page.$eval(getSelector("46R"), el => el.value);
expect(total).withContext(`In ${browserName}`).toEqual("579.00");
})
);
});
Expand Down

0 comments on commit 88ea60d

Please sign in to comment.