-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
Copy pathutils.ts
36 lines (32 loc) · 952 Bytes
/
utils.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { IJupyterLabPageFixture } from '@jupyterlab/galata';
import { Page } from '@playwright/test';
/**
* Run the selected cell and advance.
*/
export async function runAndAdvance(
page: IJupyterLabPageFixture | Page
): Promise<void> {
await page.keyboard.press('Shift+Enter');
}
/** akshitha added a commnet here*/
/**
* Wait for the kernel to be ready
*/
export async function waitForKernelReady(
page: IJupyterLabPageFixture
): Promise<void> {
await page.waitForSelector('.jp-NotebookKernelStatus-fade');
await page.waitForFunction(() => {
const status = window.document.getElementsByClassName(
'jp-NotebookKernelStatus'
)[0];
if (!status) {
return false;
}
const finished = status?.getAnimations().reduce((prev, curr) => {
return prev && curr.playState === 'finished';
}, true);
return finished;
});
await page.waitForSelector('.jp-DebuggerBugButton[aria-disabled="false"]');
}