-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Migrating to Nightwatch 1.0
Andrei Rusu edited this page Apr 24, 2018
·
8 revisions
Below is a list of potentially breaking changes in version 1.0 and deprecated functionality which was removed. All attempts have been made to ensure a complete and accurate list, but there might be things which we overlooked.
- removed
this.client
from after/afterEach hooks - use theclient
argument - after/afterEach currentTest.name is the name of the last test (it used to be null in after()).
- in order not to break compatibility with early versions, afterEach hook used to accept the
done
callback parameter, if passed just one argument (i.e.afterEach(done) {}
; that is no longer the case from 1.0, current behaviour is either:afterEach(client, done) {}
orafterEach(client) {}
; - this.results and this.errors no longer passed to afterEach - use
client.currentTest.results
;
- global beforeEach hooks used to contain a
client.currentTest.results
object with initial values; now the .results object is not present anymore inside the beforeEach hooks
- consolidated the testSuite key on the
results
object passed to a globalreporter
- it is now containing the subfolders relative to the path(s) specified as thesrc_folders
property.
- behaviour of
filter
andexclude
properties has changed; if both are specified,exclude
is now applied on the matches fromfilter
.
- selenium_host -> use webdriver.webdriver_host
- selenium_port -> use webdriver.webdriver_port
- use_ssl -> use webdriver.ssl
- proxy -> use webdriver.proxy
- request_timeout_options -> use webdriver.timeout_options
- default_path_prefix -> use webdriver.default_path_prefix
- username -> use webdriver.username
- access_key -> use webdriver.access_key
- password -> use webdriver.access_key
APIs:
- dismiss_alert
- accept_alert
- window_handle
- window_handles
- execute_async
Test Hooks:
- setUp/tearDown hooks no longer work - use beforeEach/afterEach
Grunt
- support for grunt, i.e.
Nightwatch.initGrunt
, has been removed