Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed May 27, 2024
1 parent b22f00f commit 0f5eedb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ module.exports = {
url: 'http://localhost:8888/lab',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
}
},
workers: 1
};
15 changes: 11 additions & 4 deletions ui-tests/tests/jupyterlab_new_launcher.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, test, galata } from '@jupyterlab/galata';
import { Page } from '@playwright/test';

const SETTINGS_ID = 'jupyterlab-new-launcher:plugin';

Expand Down Expand Up @@ -43,22 +44,28 @@ test.describe('With starred section', () => {
}
});

const clickOnStars = async (page: Page) => {
await page
.locator('.jp-Launcher-launchNotebook .jp-starIconButton')
.click();
await page.locator('.jp-Launcher-launchConsole .jp-starIconButton').click();
};

test('should render new launcher with starred section', async ({ page }) => {
const launcher = page.locator('.jp-LauncherBody');
// expand the console section
await page.locator('.jp-Launcher-launchConsole summary').click();
// star some items
await page
.locator('.jp-Launcher-launchNotebook .jp-starIconButton')
.click();
await page.locator('.jp-Launcher-launchConsole .jp-starIconButton').click();
await clickOnStars(page);
// collapse the "create empty" section
await page.locator('.jp-Launcher-openByType summary').click();
// wait for animations to complete
await page.waitForTimeout(400);
expect(await launcher.screenshot()).toMatchSnapshot(
'launcher-with-starred.png'
);
// remove stars from the items
await clickOnStars(page);
});
});

Expand Down

0 comments on commit 0f5eedb

Please sign in to comment.