Should I use Selenium for a Booking Engine?
We'll be developing a booking engine, a 4-5 step checkout process for reserving rooms with a hotel where there's a lot of complexity involved. Something similar to this.
Has anyone used Selenium for something like this? What kind of tests would I be able to do? Could I set someth开发者_运维问答ing like Selenium to go through the entire process of step 1 to the last step, making sure rooms are available, things are bookable? I could test stuff like making sure data is sessionized, right?
Unit testing means testing individual components in your code in isolation (eg., a function, class or method). After that, there's functional and integration testing which tests the interaction between components, and finally automated UI testing which is where selenium comes in. These are the most brittle tests, and should definitely not be the first thing on your mind when it comes to architecturing a new system.
Selenium doesn't really count as unit testing; it's integration testing.
For unit testing in PHP, PHPUnit seems to be the tool to use.
Selenium is a great too for functional testing. It allows you to do large integrated tests and check that the functionality that you are expecting the user to be able to do is there.
Selenium should only be used to check that the workflow and functionality the user expects is still there.
精彩评论