-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin): allow controlling the time to wait for idle network (#186)
You can pass the `waitForIdle` option to wait for all pending requests to complete before saving the HAR file: ```js cy.saveHar({ waitForIdle: true }); ``` This option is false by default. When set to true, the plugin will monitor the count of pending requests and wait for it to reach zero before proceeding with saving the HAR file. This ensures that all responses have been received and the data in the file is complete and accurate. Additionally, you can pass the `maxWaitDuration` option to specify the maximum time to wait for the pending requests to complete: ```js cy.saveHar({ waitForIdle: true, maxWaitDuration: 20000 }); ``` The `maxWaitDuration` option is set to 5000 milliseconds by default, meaning it will wait for 5 seconds until all pending requests have completed. You can also pass the `minIdleDuration` option to specify the minimum duration in milliseconds to wait for the network idle during the `maxWaitDuration` time. The network is idle if there are no pending requests during this time. ```js cy.saveHar({ waitForIdle: true, minIdleDuration: 1000 }); ``` The `minIdleDuration` option is set to 100 milliseconds by default. closes #185
- Loading branch information
Showing
5 changed files
with
47 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const PORT_OPTION_NAME = '--remote-debugging-port'; | ||
export const ADDRESS_OPTION_NAME = '--remote-debugging-address'; | ||
export const SUPPORTED_BROWSERS: readonly string[] = ['chromium']; | ||
export const MAX_NETWORK_IDLE_THRESHOLD = 100; | ||
export const MAX_NETWORK_IDLE_DURATION = 5000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters