4

I would like to implement some basic acceptance tests for my company's legacy PHP app. Selenium WebDriver looks like the best fit, but I need advice on what testing framework to use.

Option 1
Our unit tests are written in Peridot PHP, and I know WebDriver can be run from PHP via php-webdriver. So, it looks like I should be able to write a suite of Peridot tests that use the php-webdriver API to interact with the site. It's been done for PHPUnit, and at a glance I don't see why Peridot can't do the same (gulp).

Option 2
Alternatively, I also know the Codeception framework integrates well with WebDriver. The nice thing about this is that Codeception takes care of setting up the WebDriver server and loading a test database. It also allows for a very nice, readable set of English-language tests, although it would mean maintaining two separate testing frameworks.

Considerations

  • How completely does Codeception cover the WebDriver set of commands? (i.e. can I do anything I might try in the Selenium IDE through Codeception?)
  • Does Codeception allow me to use the PageObject design pattern?
  • What kind of learning curve would I be facing without Codeception in terms of setting up my WebDriver server and test database? Does Codeception even make it that much easier?
  • There are Firefox plugins to convert 'Selenese' (html) test cases into PHPUnit or Codeception format. The PHPUnit test cases would need to be adapted to Peridot, but the Codeception converter is still in alpha and doesn't convert everything. I would rather not use these a great deal, but they would definitely help with the learning curve. How reliable are either one of these?

1 Answer 1

2

An official WebDriver plugin is definitely on the way for Peridot, but in the meantime, it's pretty easy to mix in WebDriver support using scopes.

We actually use WebDriver to demonstrate scopes here:

https://github.com/peridot-php/peridot-scope-example

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Brian. Although I ultimately landed on the side of Codeception for this project, I will be excited to hear about future support for WebDriver in Peridot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.