How do I assert .containsText
with case insensitive in Nightwatch.js
?
For example I search for 'odin
sphere' on google.
There are a lot of possibilities for the search result, like 'Odin Sphere' 'odin sphere' 'ODIN SPHERE' etc etc I would like to assert with just 'odin sphere'.
Here's the code I wrote.
module.exports = {
beforeEach: browser => {
browser.url('https://www.google.com/')
},
after: browser => {
browser.end()
},
'Search test': browser => {
browser
.setValue('input[name="q"]',['odin sphere',browser.Keys.ENTER])
.waitForElementVisible('#res')
.pause(5000)
.verify.containsText('#res','Odin Sphere')
}
}```
Thanks in advance!
https://nightwatchjs.org/api/#assert-containsText
Usage: