Replace deprecated functions in Nightwatch tests

Created on 8 January 2024, 11 months ago
Updated 26 January 2024, 10 months ago

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

πŸ“Œ Task
Status

Fixed

Version

10.2 ✨

Component
JavascriptΒ  β†’

Last updated 2 days ago

Created by

πŸ‡³πŸ‡±Netherlands spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024