layout | title |
---|---|
default |
Home |
It's no secret, that using of the PageObject pattern can drastically simplify functional test writing, but there was no PHP implementation at the moment, that will be close enough to the Selenium Java version.
I decided to fill that gap and created this library which uses all the good parts of the Java implementation, like:
- element selector annotations (e.g.
@find-by('css' => '....')
) - element proxies (allows to lazy-load elements as you go)
- rock solid architecture
and none of the bad parts, like selectOptionByIndex
and such methods, that are
there just to preserve backwards compatibility.
Library consist of following 3 parts, which one to use it's up to you:
- PageObject - Implementation of Page Object pattern as done in Selenium Java library.
- HtmlElements - Solution of the major problem with PageObject implementation (that original library had) - each element had all methods and even ones, that have no effect on element itself. For example a
setValue
method existed for aH1
tag. - BEM - Locating elements on the page according to BEM (block-element-modificator) methodology (http://bem.info/).
Dive into action by looking at the examples, read the documentation or learn more about [the api]({{ site.api.url }}) first, it's up to you.
- behat/mink - for browser interaction
- mindplay/annotations - for annotation handling
Define the dependencies in your composer.json
:
{% highlight json %} { "require": { "qa-tools/qa-tools": "~1.0" } } {% endhighlight %}
Install/update your vendors:
{% highlight bash %} $ curl http://getcomposer.org/installer | php $ php composer.phar install {% endhighlight %}