minkphp / webdriver-classic-driver

Mink driver for the W3C WebDriver Classic protocol
MIT License
3 stars 5 forks source link

Improve test coverage #10

Open aik099 opened 9 months ago

aik099 commented 9 months ago

Browsing through the driver code I've noticed, that most of the error reporting isn't covered by tests. Without this, we can't be sure if the code actually works.

Either the https://github.com/minkphp/driver-testsuite needs to be improved or this repo custom tests.

stof commented 9 months ago

I think this might be a mix of both.

The error handling for start and stop should be covered in custom tests (as the failure modes there are specific to each driver). The error handling of getWebdriver should as well because the DriverInterface makes it an undefined behavior to call methods on a non-started driver. It does not require getting a DriverException in such case.

Other cases might correspond to holes in the coverage of invalid usages in the shared testsuite (for instance, we added testing for some invalid form field value types among the latest improvements of that testsuite). Those should be implemented in the shared testsuite to improve coverage in all drivers.