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

Using before in expect assertions considers the default timeout value 'waitForConditionTimeout' even when a timeout value has been specified in the command #764

Closed
rachna86 opened this issue Dec 2, 2015 · 0 comments
Labels

Comments

@rachna86
Copy link

rachna86 commented Dec 2, 2015

Nightwatch version: 0.8.6
The following command:
Test:

module.exports = {
    "Test 1": function (browser) {
        browser.url('https://www.google.com');
        browser.expect.element('#myelement').to.be.visible.before('10000'); 
    }
}

waitForConditionTimeout = 5000

Log output:

Starting selenium server... started - PID:  24805

[Test] Test Suite
=================

Running:  Test 1
1449077704002
1449077704004
INFO Request: POST /wd/hub/session 
 - data:  {"desiredCapabilities":{"browserName":"chrome","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","name":"Test"}} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":126}
INFO Response 200 POST /wd/hub/session{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: null,
  value: 
   { platform: 'MAC',
     acceptSslCerts: true,
     javascriptEnabled: true,
     browserName: 'chrome',
     chrome: { userDataDir: '/var/folders/f6/06dqw47j0bx4lwl4g__8hh300000gn/T/.org.chromium.Chromium.I2wsTy' },
     rotatable: false,
     locationContextEnabled: true,
     mobileEmulationEnabled: false,
     'webdriver.remote.sessionid': 'f7319571-c4ef-4414-8520-289cb8b9f852',
     version: '47.0.2526.73',
     takesHeapSnapshot: true,
     cssSelectorsEnabled: true,
     databaseEnabled: false,
     handlesAlerts: true,
     browserConnectionEnabled: false,
     nativeEvents: true,
     webStorageEnabled: true,
     hasTouchScreen: false,
     applicationCacheEnabled: false,
     takesScreenshot: true },
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1519550907 }
INFO Got sessionId from selenium f7319571-c4ef-4414-8520-289cb8b9f852
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/url 
 - data:  {"url":"https://www.google.com"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":32}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/url{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1473389017 }
LOG     → Completed command url (1419 ms)
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 703899723 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 2126888507 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 339480952 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 2042457144 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 304146170 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1632929342 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 916140722 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1161209093 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1149978970 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1994994754 }
INFO Request: POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements 
 - data:  {"using":"css selector","value":"#myelement"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":45}
INFO Response 200 POST /wd/hub/session/f7319571-c4ef-4414-8520-289cb8b9f852/elements{ sessionId: 'f7319571-c4ef-4414-8520-289cb8b9f852',
  status: 0,
  state: 'success',
  value: [],
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1589889799 }
 ✖ Expected element <#myelement> to be visible - element was not found  - expected "visible" but got: not found   
LOG     → Completed command element (5190 ms)
INFO FINISHED

FAILED:  1 assertions failed (8.419s)

From LOG → Completed command element (5190 ms) in the output it is obvious that the assertion only waited for ~5000ms instead of 10000ms.

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

No branches or pull requests

2 participants