Problem/Motivation
In order to make the jump to the next major version of Nightwatch as painless as possible (hah!), let's replace the deprecated functions in this issue before attempting to make the jump.
Steps to reproduce
The output of the GitLab CI Nightwatch job currently tells us that they are present with a cheery:
- This command has been deprecated and is removed from the W3C Webdriver standard. for keys()
- DEPRECATED: the assertion .containsText() has been deprecated and will be removed from future versions. Use assert.textContains(). for .containsText()
- DEPRECATED: the assertion .value() has been deprecated and will be removed from future versions. Use assert.valueEquals() instead. for .value()
Proposed resolution
Deprecated command keys()
Replace the keys() command with an extended Selenium user actions API command.
Before:
.keys(some.key)
After:
.perform(function () {
return this.actions().sendKeys(some.key);
})
Deprecated command .containsText()
Replace the .containsText() command with .textContains().
Before:
.assert.containsText(
'selector',
'some text',
)
After:
.assert.textContains(
'selector',
'some text',
)
Deprecated command value()
Replace the .value() command with .valueEquals().
Before:
.assert.value(
'selector',
'some text',
)
After:
.assert.valueEquals(
'selector',
'some text',
)
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3413135
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3413135-replace-deprecated-functions
changes, plain diff MR !6062
Comments
Comment #2
spokjeComment #3
spokjeComment #4
spokjeComment #5
spokjeComment #6
spokjeComment #8
spokjeComment #9
spokjeComment #10
spokjeComment #11
spokjeComment #12
spokjeComment #13
smustgrave commentedApplied the MR and did a search and replacement seems good.
Comment #14
longwaveAll looks correct to me. Backported to 10.2.x to keep things in sync.
Committed and pushed 95348401e9 to 11.x and 36c793867c to 10.2.x. Thanks!