Skip to content

Commit

Permalink
qawolf.scroll may throw error on navigation
Browse files Browse the repository at this point in the history
this test was from very early version of playwright where actions did not wait for navigations
  • Loading branch information
jperl committed Jul 7, 2020
1 parent fa31802 commit 7775e5d
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions test/utils/page/scroll.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Browser, Page } from 'playwright-core';
import { getLaunchOptions, launch, scroll } from '../../../src/utils';
import { launch, scroll } from '../../../src/utils';
import { getScrollValue } from '../../../src/utils/page/scroll';
import { TEST_URL } from '../../utils';

Expand Down Expand Up @@ -47,22 +47,6 @@ describe('scroll', () => {
expect(result.y).toBeLessThan(1600);
});

it('does not throw an error on navigation', async () => {
const promise = page.goto(`${TEST_URL}large`);

if (getLaunchOptions().browserName === 'webkit') {
// give webkit cycle to send goto
await new Promise((resolve) => setTimeout(resolve, 500));
}

await scroll(page, 'html', { x: 0, y: 200 });

const elementHandle = await page.waitForSelector('html');
expect(await getScrollValue(page, elementHandle)).toEqual({ x: 0, y: 200 });

await promise;
});

it('throws error if cannot scroll element at all', async () => {
await page.goto(`${TEST_URL}infinite-scroll`);

Expand Down

0 comments on commit 7775e5d

Please sign in to comment.