Skip to content

Commit

Permalink
Merge pull request #13355 from calixteman/fix_integration_test2
Browse files Browse the repository at this point in the history
Fix some integration tests
  • Loading branch information
timvandermeij authored May 8, 2021
2 parents 0ec945c + 38503d1 commit a6f324d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit a6f324d

Please sign in to comment.