Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose HttpRequest and cdp modules as utils. #4238

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

garg3133
Copy link
Member

This PR exposes a few internal modules like HttpRequest and cdp as utils so that these modules can be imported and used directly inside test suites.

HttpRequest module is useful for modifying the settings of HTTP requests as and when required. For example, we can modify the HTTP timeout and retry attempts for a particular command by calling the updateGlobalSettings static method just before that command:

HttpRequest.updateGlobalSettings({timeout: 10000, retry_attempts: 5});

Note: The above command would change the HttpRequest settings globally for the entirety of the test run. It should ideally be reset back to the original settings once the requirement is over.

Note 2: The initial values of timeout and retry_attempts can be set using the timeout_options property of webdriver config in nightwatch.conf.js.

cdp module is useful when working with CDP commands in Nightwatch -- there could be situations when users want to reset the CDP connection or reset the network mocks. They would also need this module when implementing their own custom CDP commands.

Copy link

Status

  • ❌ No modified files found in the types directory.
    Please make sure to include types for any changes you have made. Thank you!.

@AutomatedTester AutomatedTester merged commit cf0d45a into nightwatchjs:main Sep 17, 2024
17 checks passed
ShreySinha02 pushed a commit to ShreySinha02/nightwatch that referenced this pull request Dec 15, 2024
ShreySinha02 added a commit to ShreySinha02/nightwatch that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants