Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Add UI test for the mobile layout
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Nov 22, 2021
1 parent 26332bd commit 4002f21
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ui-tests/test/mobile.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import path from 'path';

import { expect } from '@playwright/test';

import { test } from './fixtures';

test.use({ autoGoto: false, viewport: { width: 512, height: 768 } });

test.describe('Mobile', () => {
test('The layout should be more compact on the file browser page', async ({
page,
tmpPath
}) => {
await page.goto(`tree/${tmpPath}`);
expect(await page.screenshot()).toMatchSnapshot('tree.png');
});

test('The layout should be more compact on the notebook page', async ({
page,
tmpPath
}) => {
const notebook = 'empty.ipynb';
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${notebook}`),
`${tmpPath}/${notebook}`
);
await page.goto(`notebooks/${tmpPath}/${notebook}`);

expect(await page.screenshot()).toMatchSnapshot('notebook.png');
});
});

0 comments on commit 4002f21

Please sign in to comment.