Skip to content

Commit 73e770d

Browse files
authored
Add scroll test (#599)
1 parent 71fceb2 commit 73e770d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/e2e/core/scroll.test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
describe("Scroll test", ()=> {
2+
beforeAll(async () => {
3+
await page.goto(PATH + "mapml-viewer.html");
4+
});
5+
6+
afterAll(async function () {
7+
await context.close();
8+
});
9+
10+
test("Scrolling the map does not scroll the document", async ()=>{
11+
//Force the windows scroll bar to appear
12+
await page.$eval("body > textarea",
13+
(textarea) => textarea.setAttribute("cols", 200)
14+
);
15+
await page.waitForTimeout(1000);
16+
await page.keyboard.press("Tab");
17+
await page.waitForTimeout(500);
18+
await page.keyboard.press("ArrowRight");
19+
await page.waitForTimeout(1000);
20+
21+
const scrollX = await page.evaluate('window.scrollX');
22+
expect(scrollX).toEqual(0);
23+
});
24+
});

0 commit comments

Comments
 (0)