diff --git a/ui-tests/playwright.config.js b/ui-tests/playwright.config.js index 9ece6fa..09c86b6 100644 --- a/ui-tests/playwright.config.js +++ b/ui-tests/playwright.config.js @@ -10,5 +10,6 @@ module.exports = { url: 'http://localhost:8888/lab', timeout: 120 * 1000, reuseExistingServer: !process.env.CI - } + }, + workers: 1 }; diff --git a/ui-tests/tests/jupyterlab_new_launcher.spec.ts b/ui-tests/tests/jupyterlab_new_launcher.spec.ts index a3ec91e..ef66d52 100644 --- a/ui-tests/tests/jupyterlab_new_launcher.spec.ts +++ b/ui-tests/tests/jupyterlab_new_launcher.spec.ts @@ -1,4 +1,5 @@ import { expect, test, galata } from '@jupyterlab/galata'; +import { Page } from '@playwright/test'; const SETTINGS_ID = 'jupyterlab-new-launcher:plugin'; @@ -43,15 +44,19 @@ 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 @@ -59,6 +64,8 @@ test.describe('With starred section', () => { expect(await launcher.screenshot()).toMatchSnapshot( 'launcher-with-starred.png' ); + // remove stars from the items + await clickOnStars(page); }); });