From 0161dd1a953c5bb666f39895ded8b9b52eb7b9b1 Mon Sep 17 00:00:00 2001 From: Greg Date: Mon, 16 Aug 2021 08:18:18 -0600 Subject: [PATCH] Code review feedback --- tests/e2e/env/CHANGELOG.md | 7 ++++--- tests/e2e/env/README.md | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/e2e/env/CHANGELOG.md b/tests/e2e/env/CHANGELOG.md index 430535092db..69b47c445ad 100644 --- a/tests/e2e/env/CHANGELOG.md +++ b/tests/e2e/env/CHANGELOG.md @@ -1,12 +1,13 @@ # Unreleased -- `updateReadyPageStatus` utility to update the status of the ready page -- Added plugin upload functionality util that provides a method to pull a plugin zip from a remote location +- `updateReadyPageStatus` utility to update the status of the ready page. +- Added plugin upload functionality util that provides a method to pull a plugin zip from a remote location: - `getRemotePluginZip( fileUrl )` to get the remote zip. Returns the filepath of the zip location. - Added plugin zip utility functions: - `checkNestedZip( zipFilePath, savePath )` checks a plugin zip file for any nested zip files. If one is found, it is extracted. Returns the path where the zip file is located. - `downloadZip( fileUrl, downloadPath )` downloads a plugin zip file from a remote location to the provided path. -- Added `getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )` util function to get the latest release zip from a GitHub repository +- Added `getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )` util function to get the latest release zip from a GitHub repository. +- Added `DEFAULT_TIMEOUT_OVERRIDE` that allows passing in a time in milliseconds to override the default Jest and Puppeteer timeouts. # 0.2.2 diff --git a/tests/e2e/env/README.md b/tests/e2e/env/README.md index 6420d746d5e..a9e2e1ece71 100644 --- a/tests/e2e/env/README.md +++ b/tests/e2e/env/README.md @@ -87,6 +87,21 @@ await takeScreenshotFor( 'name of current step' ); Screenshots will be saved to `tests/e2e/screenshots`. This folder is cleared at the beginning of each test run. +### Override default test timeout + +To override the default timeout for the tests, you can use the `DEFAULT_TIMEOUT_OVERRIDE` flag and pass in a maximum timeout in milliseconds. For example, you can pass it in when running the tests from the command line: + +```bash +DEFAULT_TIMEOUT_OVERRIDE=35000 npx wc-e2e test:e2e +``` + +This value will override the default Jest timeout as well as pass the timeout to the following Puppeteer methods: + +* page.setDefaultTimeout(); +* page.setDefaultNavigationTimeout(); + +For a list of the methods that the above timeout affects, please see the Puppeteer documentation for [`page.setDefaultTimeout()`](https://pptr.dev/#?product=Puppeteer&version=v10.2.0&show=api-pagesetdefaulttimeouttimeout) and [`page.setDefaultNavigationTimeout`](https://pptr.dev/#?product=Puppeteer&version=v10.2.0&show=api-pagesetdefaultnavigationtimeouttimeout) for more information. + ### Jest Puppeteer Config The test sequencer uses the following default Puppeteer configuration: