New answers tagged

0

You must note that selenium is an automation tool and not a test library. Having said that its always preferred to write tests (usually provided by manual testing services) with respect to functionality. Given we have the tests (or scenarios incase of BDD) then automation scripts for these tests can be programmed using your preferred combination of test ...


0

You want to export a class: module.exports = { SearchPage }; , not an object of that class: module.exports = new SearchPage(); If you export a class, you can instantiate new objects as required however if you just export an created object, then you cannot create more objects out of it, if required.


2

Have you tried to run it? constructor(page) { this.page = page; } and later: module.exports = new SearchPage(); What about that missing page? this.page in the object will be undefined, so none of the methods will actually work and you will get some sort of exception at runtime. A solution could be to send page to every method: async search(page, text) {...


2

I recommend writing the scripts for functionality. However I recommend staying to the full path (end to end) for the functionality being tested. However, this does not cover many of the cases or tests that are usually desired, therefore, in addition to selenium tests for full functionality I also try to have: 100% unit test coverage unit test coverage for ...


Top 50 recent answers are included