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 some integration tests #13355

Merged
merged 1 commit into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/integration/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ describe("Checkbox annotation", () => {
pages.map(async ([browserName, page]) => {
for (const selector of selectors) {
await page.click(selector);
await page.waitForFunction(
`document.querySelector("${selector} > :first-child").checked`
);

for (const otherSelector of selectors) {
const checked = await page.$eval(
`${otherSelector} > :first-child`,
Expand Down
12 changes: 12 additions & 0 deletions test/integration/scripting_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ describe("Interaction", () => {
await page.type("#\\34 16R", "3.14159", { delay: 200 });
await page.click("#\\34 19R");

await page.waitForFunction(
`getComputedStyle(document.querySelector("#\\\\34 27R")).visibility !== "hidden"`
);

visibility = await page.$eval(
"#\\34 27R",
el => getComputedStyle(el).visibility
Expand All @@ -80,6 +84,10 @@ describe("Interaction", () => {
// and leave it
await page.click("#\\34 19R");

await page.waitForFunction(
`getComputedStyle(document.querySelector("#\\\\34 27R")).visibility !== "visible"`
);

visibility = await page.$eval(
"#\\34 27R",
el => getComputedStyle(el).visibility
Expand Down Expand Up @@ -531,6 +539,7 @@ describe("Interaction", () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
for (const num of [7, 6, 4, 3, 2, 1]) {
await clearInput(page, "#\\33 3R");
await page.click(`option[value=Export${num}]`);
await page.waitForFunction(
`document.querySelector("#\\\\33 3R").value !== ""`
Expand Down Expand Up @@ -560,6 +569,7 @@ describe("Interaction", () => {
);

for (const num of [7, 6, 4, 3, 2, 1]) {
await clearInput(page, "#\\33 3R");
await page.click(`option[value=Export${num}]`);
await page.waitForFunction(
`document.querySelector("#\\\\33 3R").value !== ""`
Expand All @@ -579,6 +589,7 @@ describe("Interaction", () => {
let len = 6;
for (const num of [1, 3, 5, 6, 431, -1, 0]) {
++len;
await clearInput(page, "#\\33 3R");
await clearInput(page, "#\\33 9R");
await page.type("#\\33 9R", `${num},Insert${num},Tresni${num}`, {
delay: 10,
Expand Down Expand Up @@ -611,6 +622,7 @@ describe("Interaction", () => {
pages.map(async ([browserName, page]) => {
let len = 6;
// Click on Restore button.
await clearInput(page, "#\\33 3R");
await page.click("[data-annotation-id='37R']");
await page.waitForFunction(
`document.querySelector("#\\\\33 0R").children.length === ${len}`
Expand Down