From 73e770dc413323b3d99a34abb1e148f4496816c4 Mon Sep 17 00:00:00 2001 From: ben-lu-uw <69722289+ben-lu-uw@users.noreply.github.com> Date: Thu, 25 Nov 2021 13:50:38 -0500 Subject: [PATCH] Add scroll test (#599) --- test/e2e/core/scroll.test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/e2e/core/scroll.test.js diff --git a/test/e2e/core/scroll.test.js b/test/e2e/core/scroll.test.js new file mode 100644 index 000000000..ef4d3c31d --- /dev/null +++ b/test/e2e/core/scroll.test.js @@ -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); + }); +}); \ No newline at end of file