Skip to content

Commit

Permalink
Fix browser-test.js (#15892)
Browse files Browse the repository at this point in the history
* Fix browser-test.js

* Minor revert

* Error out if jupyter-config-data is not found

---------

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
  • Loading branch information
fcollonval and krassowski committed Mar 12, 2024
1 parent 4df55ca commit 910a162
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jupyterlab/browser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if (OUTPUT) {
async function main() {
/* eslint-disable no-console */
console.info(`Starting headless ${BROWSER}...`);
let testError = null;

const pwBrowser = playwright[BROWSER];
const browser = await pwBrowser.launch({
Expand Down Expand Up @@ -65,11 +66,12 @@ async function main() {
console.log('Waiting for page content..');

try {
await page.locator('#jupyter-config-data').waitFor();
await page.locator('#jupyter-config-data').waitFor({ state: 'attached' });
} catch (reason) {
console.error('Error loading JupyterLab page:');
console.error('Error loading JupyterLab page:', reason);
// Limit to 1000 characters
console.error((await page.content()).substring(0, 1000));
testError = reason;
}

console.log('Waiting for #main selector...');
Expand All @@ -81,7 +83,6 @@ async function main() {
state: 'attached'
});
console.log('Waiting for application to start...');
let testError = null;

try {
await page.waitForSelector('.completed', { state: 'attached' });
Expand Down

0 comments on commit 910a162

Please sign in to comment.