Merge pull request #19192 from timvandermeij/scripting-intermittent
Fix intermittent issues in the `issue14307.pdf` integration tests
This commit is contained in:
commit
35573cb8e8
@ -1060,38 +1060,26 @@ describe("Interaction", () => {
|
|||||||
it("must check input for US zip format", async () => {
|
it("must check input for US zip format", async () => {
|
||||||
// Run the tests sequentially to avoid any focus issues between the two
|
// Run the tests sequentially to avoid any focus issues between the two
|
||||||
// browsers when an alert is displayed.
|
// browsers when an alert is displayed.
|
||||||
for (const [browserName, page] of pages) {
|
for (const [, page] of pages) {
|
||||||
await waitForScripting(page);
|
await waitForScripting(page);
|
||||||
|
|
||||||
await clearInput(page, getSelector("29R"));
|
|
||||||
await clearInput(page, getSelector("30R"));
|
|
||||||
|
|
||||||
await page.focus(getSelector("29R"));
|
await page.focus(getSelector("29R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("29R"), "12A");
|
await typeAndWaitForSandbox(page, getSelector("29R"), "12A");
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(`${getQuerySelector("29R")}.value === "12"`);
|
||||||
`${getQuerySelector("29R")}.value !== "12A"`
|
|
||||||
);
|
|
||||||
|
|
||||||
let text = await page.$eval(getSelector(`29R`), el => el.value);
|
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("12");
|
|
||||||
|
|
||||||
await page.focus(getSelector("29R"));
|
await page.focus(getSelector("29R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("29R"), "34");
|
await typeAndWaitForSandbox(page, getSelector("29R"), "34");
|
||||||
await page.click("[data-annotation-id='30R']");
|
await page.click("[data-annotation-id='30R']");
|
||||||
|
await waitForSandboxTrip(page);
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(`${getQuerySelector("29R")}.value === ""`);
|
||||||
`${getQuerySelector("29R")}.value !== "1234"`
|
|
||||||
);
|
|
||||||
|
|
||||||
text = await page.$eval(getSelector(`29R`), el => el.value);
|
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("");
|
|
||||||
|
|
||||||
await page.focus(getSelector("29R"));
|
await page.focus(getSelector("29R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("29R"), "12345");
|
await typeAndWaitForSandbox(page, getSelector("29R"), "12345");
|
||||||
await page.click("[data-annotation-id='30R']");
|
await page.click("[data-annotation-id='30R']");
|
||||||
|
await waitForSandboxTrip(page);
|
||||||
text = await page.$eval(getSelector(`29R`), el => el.value);
|
await page.waitForFunction(
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("12345");
|
`${getQuerySelector("29R")}.value === "12345"`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1115,38 +1103,28 @@ describe("Interaction", () => {
|
|||||||
it("must check input for US phone number (long) format", async () => {
|
it("must check input for US phone number (long) format", async () => {
|
||||||
// Run the tests sequentially to avoid any focus issues between the two
|
// Run the tests sequentially to avoid any focus issues between the two
|
||||||
// browsers when an alert is displayed.
|
// browsers when an alert is displayed.
|
||||||
for (const [browserName, page] of pages) {
|
for (const [, page] of pages) {
|
||||||
await waitForScripting(page);
|
await waitForScripting(page);
|
||||||
|
|
||||||
await clearInput(page, getSelector("29R"));
|
|
||||||
await clearInput(page, getSelector("30R"));
|
|
||||||
|
|
||||||
await page.focus(getSelector("30R"));
|
await page.focus(getSelector("30R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("30R"), "(123) 456A");
|
await typeAndWaitForSandbox(page, getSelector("30R"), "(123) 456A");
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
`${getQuerySelector("30R")}.value !== "(123) 456A"`
|
`${getQuerySelector("30R")}.value === "(123) 456"`
|
||||||
);
|
);
|
||||||
|
|
||||||
let text = await page.$eval(getSelector(`30R`), el => el.value);
|
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("(123) 456");
|
|
||||||
|
|
||||||
await page.focus(getSelector("30R"));
|
await page.focus(getSelector("30R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("30R"), "-789");
|
await typeAndWaitForSandbox(page, getSelector("30R"), "-789");
|
||||||
await page.click("[data-annotation-id='29R']");
|
await page.click("[data-annotation-id='29R']");
|
||||||
|
await waitForSandboxTrip(page);
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(`${getQuerySelector("30R")}.value === ""`);
|
||||||
`${getQuerySelector("30R")}.value !== "(123) 456-789"`
|
|
||||||
);
|
|
||||||
|
|
||||||
text = await page.$eval(getSelector(`30R`), el => el.value);
|
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("");
|
|
||||||
|
|
||||||
await page.focus(getSelector("30R"));
|
await page.focus(getSelector("30R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("30R"), "(123) 456-7890");
|
await typeAndWaitForSandbox(page, getSelector("30R"), "(123) 456-7890");
|
||||||
await page.click("[data-annotation-id='29R']");
|
await page.click("[data-annotation-id='29R']");
|
||||||
|
await waitForSandboxTrip(page);
|
||||||
text = await page.$eval(getSelector("30R"), el => el.value);
|
await page.waitForFunction(
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("(123) 456-7890");
|
`${getQuerySelector("30R")}.value === "(123) 456-7890"`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1170,38 +1148,28 @@ describe("Interaction", () => {
|
|||||||
it("must check input for US phone number (short) format", async () => {
|
it("must check input for US phone number (short) format", async () => {
|
||||||
// Run the tests sequentially to avoid any focus issues between the two
|
// Run the tests sequentially to avoid any focus issues between the two
|
||||||
// browsers when an alert is displayed.
|
// browsers when an alert is displayed.
|
||||||
for (const [browserName, page] of pages) {
|
for (const [, page] of pages) {
|
||||||
await waitForScripting(page);
|
await waitForScripting(page);
|
||||||
|
|
||||||
await clearInput(page, getSelector("29R"));
|
|
||||||
await clearInput(page, getSelector("30R"));
|
|
||||||
|
|
||||||
await page.focus(getSelector("30R"));
|
await page.focus(getSelector("30R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("30R"), "123A");
|
await typeAndWaitForSandbox(page, getSelector("30R"), "123A");
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
`${getQuerySelector("30R")}.value !== "123A"`
|
`${getQuerySelector("30R")}.value === "123"`
|
||||||
);
|
);
|
||||||
|
|
||||||
let text = await page.$eval(getSelector(`30R`), el => el.value);
|
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("123");
|
|
||||||
|
|
||||||
await page.focus(getSelector("30R"));
|
await page.focus(getSelector("30R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("30R"), "-456");
|
await typeAndWaitForSandbox(page, getSelector("30R"), "-456");
|
||||||
await page.click("[data-annotation-id='29R']");
|
await page.click("[data-annotation-id='29R']");
|
||||||
|
await waitForSandboxTrip(page);
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(`${getQuerySelector("30R")}.value === ""`);
|
||||||
`${getQuerySelector("30R")}.value !== "123-456"`
|
|
||||||
);
|
|
||||||
|
|
||||||
text = await page.$eval(getSelector("30R"), el => el.value);
|
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("");
|
|
||||||
|
|
||||||
await page.focus(getSelector("30R"));
|
await page.focus(getSelector("30R"));
|
||||||
await typeAndWaitForSandbox(page, getSelector("30R"), "123-4567");
|
await typeAndWaitForSandbox(page, getSelector("30R"), "123-4567");
|
||||||
await page.click("[data-annotation-id='29R']");
|
await page.click("[data-annotation-id='29R']");
|
||||||
|
await waitForSandboxTrip(page);
|
||||||
text = await page.$eval(getSelector("30R"), el => el.value);
|
await page.waitForFunction(
|
||||||
expect(text).withContext(`In ${browserName}`).toEqual("123-4567");
|
`${getQuerySelector("30R")}.value === "123-4567"`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user