Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UI tests #277

Merged
merged 6 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"test:update": "npx playwright test --update-snapshots"
},
"devDependencies": {
"@jupyterlab/galata": "^5.0.5",
"@jupyterlab/services": "^7.0.5",
"@jupyterlab/galata": "^5.1.5",
"@jupyterlab/services": "^7.1.5",
"@playwright/test": "^1.35.0"
},
"resolutions": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions ui-tests/tests/notebook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test.describe('Initialization', () => {
await guestPage.notebook.open(pathUntitled);

const nbPanel = await page.notebook.getNotebookInPanel();
expect(await nbPanel?.screenshot()).toMatchSnapshot(
expect.soft(await nbPanel?.screenshot()).toMatchSnapshot(
'initialization-create-notebook-host.png'
);

Expand All @@ -131,9 +131,10 @@ test.describe('Initialization', () => {

await guestPage.filebrowser.refresh();
await guestPage.notebook.open(exampleNotebook);
await guestPage.notebook.activate(exampleNotebook);

const nbPanel = await page.notebook.getNotebookInPanel();
expect(await nbPanel?.screenshot()).toMatchSnapshot(
expect.soft(await nbPanel?.screenshot()).toMatchSnapshot(
'initialization-open-notebook-host.png'
);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions ui-tests/tests/user-menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@ test.use( {
});

const openDialog = async (page: IJupyterLabPageFixture): Promise<Locator> => {
const sharedLinkButton = page.locator('button[data-command="collaboration:shared-link"]');
const sharedLinkButton = page.locator('jp-button[data-command="collaboration:shared-link"]');
await sharedLinkButton.click();
await expect(page.locator('.jp-Dialog')).toBeVisible();
return page.locator('.jp-Dialog').first();
};

test('the top bar should contain the user menu with 2 items', async ({ page }) => {
const topBarItems = page.locator('#jp-top-bar > :not(.jp-Toolbar-spacer)');
await expect(topBarItems).toHaveCount(2);
test('the top bar should contain one user menu and one share button', async ({ page }) => {
const shareButton = page.locator('#jp-top-bar jp-button[data-command="collaboration:shared-link"]');
await expect(shareButton).toHaveCount(1);
const userMenu = page.locator('#jp-top-bar .jp-MenuBar-anonymousIcon');
await expect(userMenu).toHaveCount(1);
});

test('should open dialog when clicking on the shared link button', async ({ page }) => {
const sharedLinkButton = page.locator('button[data-command="collaboration:shared-link"]');
const sharedLinkButton = page.locator('jp-button[data-command="collaboration:shared-link"]');

expect(await sharedLinkButton.screenshot()).toMatchSnapshot(
'shared-link-icon.png'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading