Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #85 from dharmaquark/0821-maxwait-flag
Browse files Browse the repository at this point in the history
adding maxWait command line flag
  • Loading branch information
jtpio authored Sep 1, 2021
2 parents 4023808 + aaf213a commit dcd7965
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ Notes:

*Default*: `false`

- **--max-wait**: Maximum time (in ms) to wait for JupyterLab to load

*Default*: `5000`

- **--help**: Show usage information

Shows usage information with list of all command-line options. Skips test execution.
Expand Down
5 changes: 5 additions & 0 deletions packages/galata/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const cli = meow(
--image-match-threshold image matching threshold
--slow-mo slow down UI operations by the specified ms
--theme JupyterLab Theme to set [light / JupyterLab Light, dark / JupyterLab Dark, installed theme name]
--max-wait maximum time (in ms) to wait for for JupyterLab to load (window.jupyterlab object available)
Other options:
--launch-result-server launch result file server for a test
Expand Down Expand Up @@ -193,6 +194,10 @@ const cli = meow(
theme: {
type: 'string',
default: config.theme || ''
},
maxWait: {
type: 'number',
default: config.maxWait || 5000
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/galata/jest-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class TestEnvironment extends NodeEnvironment {
await context.page.goto(context.jlabUrl, {
waitUntil: 'domcontentloaded'
});
await this.waitForJupyterLabAppObject();
const maxWait = config.maxWait ? config.maxWait : 5000;
await this.waitForJupyterLabAppObject(maxWait);
} catch (error) {
await logAndExit(
'error',
Expand Down
3 changes: 2 additions & 1 deletion packages/galata/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const configKeys = {
'testId',
'testOutputDir',
'referenceDir',
'theme'
'theme',
'maxWait'
]),
boolean: new Set([
'headless',
Expand Down

0 comments on commit dcd7965

Please sign in to comment.