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

Workaround test failure #3

Closed
wants to merge 4 commits into from
Closed
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
14 changes: 14 additions & 0 deletions tests/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ async def test_dirty(
assert not jupyter_ydoc.dirty


async def cleanup(jp_serverapp):
# workaround for a shutdown issue of aiosqlite, see
# https://github.com/jupyterlab/jupyter-collaboration/issues/252
await jp_serverapp.web_app.settings["jupyter_collaboration"].stop_extension()
# workaround `jupyter_server_fileid` manager accessing database on GC
del jp_serverapp.web_app.settings["file_id_manager"]


async def test_room_concurrent_initialization(
jp_serverapp,
rtc_create_file,
rtc_connect_doc_client,
):
Expand All @@ -60,8 +69,11 @@ async def connect(file_format, file_type, file_path):
t1 = time()
assert t1 - t0 < 0.5

await cleanup(jp_serverapp)


async def test_room_sequential_opening(
jp_serverapp,
rtc_create_file,
rtc_connect_doc_client,
):
Expand All @@ -81,3 +93,5 @@ async def connect(file_format, file_type, file_path):
assert dt < 1
dt = await connect(file_format, file_type, file_path)
assert dt < 1

await cleanup(jp_serverapp)
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