Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

evangelion1204
Copy link
Contributor

A basic skeleton which can be extended in the future.

Currently containing:

  • basic configuration and dependencies
  • example pages
    • login page
    • account page
  • simple PHP login

*/
public function loginFail()
{
$this->page = $this->page->loginFailure();
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@aik099
Copy link
Member

aik099 commented Feb 8, 2015

Today’s review completed.

Behat\MinkExtension:
default_session: selenium2
javascript_session: selenium2
base_url: 'http://behat-example.qa-tools.io'
Copy link
Member

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.

@evangelion1204
Copy link
Contributor Author

I updated the example a bit.

{

/**
* @Given I'm on ':page'
Copy link
Member

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants