Search code examples
javascriptprotractorautomated-testscucumber

'to.include' is not working where 'to.eventually.equal' is working


I was trying to check whether a string is present in another string.I am using the below code expect(actualTimeZone).to.include(employee.timeZone);

But it is giving the below error

AssertionError: object tested must be an array, a map, an object, a set, a string, or a weakset, but object given

But when I tried with the below code, it is not throwing the above error expect(actualTimeZone).to.eventually.equal(employee.timeZone);

I am working on protractor framework with cucumber and javascript. Could someone help to solve this issue


Solution

  • I tried using the below code and it is working

    expect(actualTimeZone).to.eventually.include(employee.timeZone);