Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the "must check that a value is correctly updated on a field and its siblings" scripting integration test #18624

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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