Skip to content

Commit

Permalink
Add scroll test (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-lu-uw authored Nov 25, 2021
1 parent 71fceb2 commit 73e770d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/e2e/core/scroll.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
describe("Scroll test", ()=> {
beforeAll(async () => {
await page.goto(PATH + "mapml-viewer.html");
});

afterAll(async function () {
await context.close();
});

test("Scrolling the map does not scroll the document", async ()=>{
//Force the windows scroll bar to appear
await page.$eval("body > textarea",
(textarea) => textarea.setAttribute("cols", 200)
);
await page.waitForTimeout(1000);
await page.keyboard.press("Tab");
await page.waitForTimeout(500);
await page.keyboard.press("ArrowRight");
await page.waitForTimeout(1000);

const scrollX = await page.evaluate('window.scrollX');
expect(scrollX).toEqual(0);
});
});

0 comments on commit 73e770d

Please sign in to comment.