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

client.pause(0) leads to indefinite wait time #3422

Closed
qwertynik opened this issue Oct 6, 2022 · 1 comment · Fixed by #3534
Closed

client.pause(0) leads to indefinite wait time #3422

qwertynik opened this issue Oct 6, 2022 · 1 comment · Fixed by #3534
Labels

Comments

@qwertynik
Copy link

qwertynik commented Oct 6, 2022

Description of the bug/issue

During an execution workflow in the script, when the statement client.pause(0) was executed, the script execution waited indefinitely.

The documentation here points out that client.pause() will lead to indefinite wait time. However, client.pause(0) also does which is confusing and not intuitive too. Of course it is unlikely that one may call this statement, however, during execution flows where pause time is not predefined this statement can be called.

Steps to reproduce

  1. Executing the script in the sample test will highlight the issue (/undocumented feature).

Sample test

Execute the below script.

describe("client wait time", function () {

	it("tests client wait time", async (client) => {
		let url = "https://google.com";

		await client.navigateTo(url);

		let duration = 0;

		console.log(`Waiting now for ${duration} ms.`);

		client.pause(duration)

		client.end();
	});
});

Command to run

npx nightwatch .\tests\waitTimeCheck.js --env chrome

Verbose Output

[client wait time] Test Suite
──────────────────────────────────────────────────────────
- Starting ChromeDriver on port 9515...
 Starting ChromeDriver with server_path=D:\xampp\htdocs\vmeetWebRTCTest\node_modules\chromedriver\lib\chrome
driver\chromedriver.exe...
   Request POST /session  
   {
     desiredCapabilities: {
       browserName: 'chrome',
       'goog:chromeOptions': { w3c: true, args: [] },
       name: 'client wait time'
     },
     capabilities: {
       alwaysMatch: {
         browserName: 'chrome',
         'goog:chromeOptions': { w3c: true, args: [] }
       }
     }
\ Starting ChromeDriver on port 9515...

| Starting ChromeDriver on port 9515...
   Response 200 POST /session (1532ms)
   {
     value: {
       capabilities: {
         acceptInsecureCerts: false,
         browserName: 'chrome',
         browserVersion: '105.0.5195.127',
         chrome: {
           chromedriverVersion: '104.0.5112.79 (3cf3e8c8a07d104b9e1260c910efb8f383285dc5-refs/branch-heads/5
112@{#1307})',
           userDataDir: 'C:\\Users\\syste\\AppData\\Local\\Temp\\scoped_dir6392_112913112'
         },
         'goog:chromeOptions': { debuggerAddress: 'localhost:63686' },
         networkConnectionEnabled: false,
         pageLoadStrategy: 'normal',
         platformName: 'windows',
         proxy: {},
         setWindowRect: true,
         strictFileInteractability: false,
         timeouts: { implicit: 0, pageLoad: 300000, script: 30000 },
         unhandledPromptBehavior: 'dismiss and notify',
         'webauthn:extension:credBlob': true,
         'webauthn:extension:largeBlob': true,
         'webauthn:virtualAuthenticators': true
       },
       sessionId: '67fe443d71ea208468d6d7bbe8187c41'
     }
i Connected to ChromeDriver on port 9515 (1620ms).
  Using: chrome (105.0.5195.127) on WINDOWS.

 Received session with ID: 67fe443d71ea208468d6d7bbe8187c41

 → Running [before]:
 → Completed [before].



  Running tests client wait time:
───────────────────────────────────────────────────────────────────────────────────────────────────
 → Running [beforeEach]:
 → Completed [beforeEach].

 → Running command: navigateTo ('https://google.com')
   Request POST /session/67fe443d71ea208468d6d7bbe8187c41/url  
   { url: 'https://google.com' }
   Response 200 POST /session/67fe443d71ea208468d6d7bbe8187c41/url (2665ms)
   { value: null }
  → Completed command: navigateTo ('https://google.com') (2671ms)
Waiting now for 0 ms.
 → Running [afterEach]:
 
 → Running command: pause (0)
Paused...
  Press <space> or F10 to step over to the next test command and pause again.
  Press Ctrl+C to exit.
  Press any other key to RESUME.
[25552:20232:1006/124828.196:ERROR:device_event_log_impl.cc(214)] [12:48:28.196] USB: usb_device_handle_win.
cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. 
(0x1F)
[25552:20232:1006/124828.198:ERROR:device_event_log_impl.cc(214)] [12:48:28.198] USB: usb_device_handle_win.
cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. 
(0x1F)

Nightwatch Configuration

No response

Nightwatch.js Version

2.3.3

Node Version

No response

Browser

Chrome

Operating System

Windows 10

Additional Information

No response

@qwertynik qwertynik changed the title client.pause(0) leads to infinite wait time client.pause(0) leads to indefinite wait time Oct 6, 2022
@qwertynik
Copy link
Author

Good to see this being resolved!

Thanks, @gravityvi @prudhvi22 @beatfactor for your efforts on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants