Skip to content

Commit

Permalink
Add test for inspector tooltip showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed May 18, 2024
1 parent 44b82c8 commit 30e1257
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions galata/test/jupyterlab/inspector-tooltip.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { expect, test } from '@jupyterlab/galata';

const fileName = 'notebook.ipynb';
const TOOLTIP_SELECTOR = '.jp-Tooltip';

test.describe('Inspector (contextual help) tooltip', () => {
test.beforeEach(async ({ page }) => {
await page.notebook.createNew(fileName);
});

test('Should show up on Shift + Tab', async ({ page }) => {
await page.notebook.setCell(0, 'code', 'int');
const tooltip = page.locator(TOOLTIP_SELECTOR);
await expect(tooltip).toHaveCount(0);
await page.keyboard.press('Shift+Tab');
await expect(tooltip).toHaveCount(1);

Check failure on line 19 in galata/test/jupyterlab/inspector-tooltip.test.ts

View workflow job for this annotation

GitHub Actions / Visual Regression Tests

[jupyterlab] › test/jupyterlab/inspector-tooltip.test.ts:14:7 › Inspector (contextual help) tooltip › Should show up on Shift + Tab

1) [jupyterlab] › test/jupyterlab/inspector-tooltip.test.ts:14:7 › Inspector (contextual help) tooltip › Should show up on Shift + Tab Error: Timed out 5000ms waiting for expect(locator).toHaveCount(expected) Locator: locator('.jp-Tooltip') Expected: 1 Received: 0 Call log: - expect.toHaveCount with timeout 5000ms - waiting for locator('.jp-Tooltip') - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" 17 | await expect(tooltip).toHaveCount(0); 18 | await page.keyboard.press('Shift+Tab'); > 19 | await expect(tooltip).toHaveCount(1); | ^ 20 | await expect(tooltip).toContainText('int'); 21 | }); 22 | }); at /home/runner/work/jupyterlab/jupyterlab/galata/test/jupyterlab/inspector-tooltip.test.ts:19:27

Check failure on line 19 in galata/test/jupyterlab/inspector-tooltip.test.ts

View workflow job for this annotation

GitHub Actions / Visual Regression Tests

[jupyterlab] › test/jupyterlab/inspector-tooltip.test.ts:14:7 › Inspector (contextual help) tooltip › Should show up on Shift + Tab

1) [jupyterlab] › test/jupyterlab/inspector-tooltip.test.ts:14:7 › Inspector (contextual help) tooltip › Should show up on Shift + Tab Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toHaveCount(expected) Locator: locator('.jp-Tooltip') Expected: 1 Received: 0 Call log: - expect.toHaveCount with timeout 5000ms - waiting for locator('.jp-Tooltip') - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" - locator resolved to 0 elements - unexpected value "0" 17 | await expect(tooltip).toHaveCount(0); 18 | await page.keyboard.press('Shift+Tab'); > 19 | await expect(tooltip).toHaveCount(1); | ^ 20 | await expect(tooltip).toContainText('int'); 21 | }); 22 | }); at /home/runner/work/jupyterlab/jupyterlab/galata/test/jupyterlab/inspector-tooltip.test.ts:19:27
await expect(tooltip).toContainText('int');
});
});

0 comments on commit 30e1257

Please sign in to comment.