From aaf213a5f6b4d78afeb94954c2cd90444dc1be21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Aug 2021 04:10:30 +0000 Subject: [PATCH] adding maxWait command line flag Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] adding maxWait command line flag adding maxWait flag adding maxWait flag --- README.md | 4 ++++ packages/galata/bin/cli.js | 5 +++++ packages/galata/jest-env.js | 3 ++- packages/galata/util.js | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bcc74e0..e30ae62 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/packages/galata/bin/cli.js b/packages/galata/bin/cli.js index 0abaa3b..ada205b 100755 --- a/packages/galata/bin/cli.js +++ b/packages/galata/bin/cli.js @@ -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 @@ -193,6 +194,10 @@ const cli = meow( theme: { type: 'string', default: config.theme || '' + }, + maxWait: { + type: 'number', + default: config.maxWait || 5000 } } } diff --git a/packages/galata/jest-env.js b/packages/galata/jest-env.js index fdd209e..befdbbb 100644 --- a/packages/galata/jest-env.js +++ b/packages/galata/jest-env.js @@ -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', diff --git a/packages/galata/util.js b/packages/galata/util.js index a08858a..d4ca988 100644 --- a/packages/galata/util.js +++ b/packages/galata/util.js @@ -15,7 +15,8 @@ const configKeys = { 'testId', 'testOutputDir', 'referenceDir', - 'theme' + 'theme', + 'maxWait' ]), boolean: new Set([ 'headless',