codeceptjs / CodeceptJS

Supercharged End 2 End Testing Framework for NodeJS
http://codecept.io
MIT License
4.11k stars 726 forks source link

Puppeteer / waitForText method: doesn't works with xpath selector #1863

Open ko4ergins opened 5 years ago

ko4ergins commented 5 years ago

Provide console output if related. Use --verbose mode for more details.

Text "Get started with GitHub Enterprise" was not found on page after 3 sec
Evaluation failed: TypeError: $XPath is not a function
    at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:4:22)
    at eval (eval at waitForPredicatePageFunction (:2:21), <anonymous>:7:11)
    at onRaf (__puppeteer_evaluation_script__:56:33)
    at pollRaf (__puppeteer_evaluation_script__:48:5)
    at waitForPredicatePageFunction (__puppeteer_evaluation_script__:7:18)

Provide test source code if related

Feature('User Story');

Scenario('QA', (I) => {
  I.amOnPage('https://github.com');
  I.waitForText('Get started with GitHub Enterprise', 3, '//*[@class="h1-mktg"]');

});

Details

grzegorzprzybylo commented 5 years ago

@DavertMik could you take a look on this if you got a second? not sure how important it is (priority) but in some cases XPath selectors are very useful imo. Thanks!


according to documentation Xpath should be supported