nightwatch: ` TypeError: this.resultValue.indexOf is not a function`

I keep getting this error at:

search.waitForElementVisible('@headerTitle', client.globals.waitForTiming);
search.expect.element('@headerTitle').text.to.contain('Miami');

Error:

 TypeError: this.resultValue.indexOf is not a function
    at TextAssertion.<anonymous> (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:218:48)
    at TextAssertion.BaseAssertion.getResult (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:182:19)
    at TextAssertion.BaseAssertion.conditionFlag (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:258:22)
    at TextAssertion.BaseAssertion.@containsFlag (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:217:8)
    at TextAssertion.<anonymous> (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:144:33)
    at Array.forEach (native)
    at TextAssertion.BaseAssertion.processFlags (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:140:30)
    at TextAssertion.<anonymous> (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/api/expect/_baseAssertion.js:112:10)
    at HttpRequest.<anonymous> (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/index.js:339:20)
    at emitTwo (events.js:100:13)
    at HttpRequest.emit (events.js:185:7)
    at HttpRequest.<anonymous> (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/index.js:378:15)
    at emitThree (events.js:110:13)
    at HttpRequest.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/home/travis/build/gadabout/sparrow/node_modules/nightwatch/lib/http/request.js:157:16)
    at emitNone (events.js:85:20)
    at IncomingMessage.emit (events.js:179:7)
    at endReadableNT (_stream_readable.js:906:12)
    at nextTickCallbackWith2Args (node.js:475:9)
    at process._tickDomainCallback (node.js:430:17)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 21 (2 by maintainers)

Most upvoted comments

Me too. Never on the local machine, but in exactly the same circumstances when running on a CI server. (The error appears when repeatedly using an element(...).text.to.contain(...) test.)