-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic skeleton with tests #1
base: master
Are you sure you want to change the base?
Conversation
*/ | ||
public function loginFail() | ||
{ | ||
$this->page = $this->page->loginFailure(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's incorrect approach.
Page provides method to interact with elements on a page. It doesn't have methods, that would deliberately fill the form with data, that will lead to failure/success to allow tests to use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case always combine submit and filling the form? I always divided that but it could also be one step after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method on PageObject/element class represents complete action from UI/user viewpoint. User sees login process as single action: fill fields + press ENTER/login button. This way the PageObject should do it in same fashion.
Today’s review completed. |
Behat\MinkExtension: | ||
default_session: selenium2 | ||
javascript_session: selenium2 | ||
base_url: 'http://behat-example.qa-tools.io' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use http://localhost
as url here and in other setting. It's most unlikely that people will have that domain.
Also in README.md I recommend mentioning steps required to make example operational, like go and replace base_url
in 2 places with your actual url.
…ies and added steps for setup to README.md
755bb93
to
a27f0c9
Compare
I updated the example a bit. |
{ | ||
|
||
/** | ||
* @Given I'm on ':page' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to http://docs.behat.org/en/latest/guides/2.definitions.html the single or double quotes are not required around parameter names. Parameters would be detected in scenario even if somebody adds quotes by accident:
I'm on My Page
I'm on "My Page"
I'm on 'My Page'
Not sure how spaces are handled through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check that yet, but good to know, then I will drop them.
A basic skeleton which can be extended in the future.
Currently containing: