Skip to content

Commit

Permalink
Test against mobile browsers (only on CI) (#49)
Browse files Browse the repository at this point in the history
* Test against mobile browsers in CI

* Skip scroll event test in mobile devices

* typo fix

Co-authored-by: Andrew Hyndman <ahyndman@dropbox.com>
  • Loading branch information
ajhyndman and Andrew Hyndman authored Jun 8, 2022
1 parent 62df344 commit bb62f6a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
32 changes: 18 additions & 14 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ const config: PlaywrightTestConfig = {
},
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: {
// ...devices['Pixel 5'],
// },
// },
// {
// name: 'Mobile Safari',
// use: {
// ...devices['iPhone 12'],
// },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
Expand All @@ -103,4 +89,22 @@ const config: PlaywrightTestConfig = {
},
};

if (process.env.CI) {
config.projects?.push(
/* Test against mobile viewports (CI only). */
{
name: 'Mobile Chrome',
use: {
...devices['Pixel 5'],
},
},
{
name: 'Mobile Safari',
use: {
...devices['iPhone 12'],
},
}
);
}

export default config;
4 changes: 3 additions & 1 deletion test/e2e/interaction3/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {getEntries, entryCountIs} from '../../util/entries';
const PAGELOAD_DELAY = 500;

test.describe('TTVC', () => {
test('an user scrolls', async ({page}) => {
test('a user scrolls', async ({page, isMobile}) => {
test.skip(Boolean(isMobile), 'wheel events are not defined for mobile devices');

await page.goto(`/test/interaction3?delay=${PAGELOAD_DELAY}`, {});

await page.mouse.wheel(0, 2000);
Expand Down

0 comments on commit bb62f6a

Please sign in to comment.