75. criteria
„
In the menu, there is a „register“ item.
On the register page the user can enter the
following information:
user name
real name
email address
After registration, the user should receive a
confirmation email.
138. Scenario: User login
Given I am on login.mittwald.de
When I fill in 123456 for username
And fill in supersecret for password
And press log in
Then I should see Welcome to the customer center
Acceptance
143. Scenario: User login
Given I am on login.mittwald.de
When I fill in 123456 for username
And fill in supersecret for password
And press log in
Then I should see Welcome to the customer center
I
153. ?php
Scenario: User login
class MyTest extends PHPUnit_Extensions_Selenium2TestCase
Given I am on login.mittwald.de
{
When I fill in 123456 for username
protected function setUp()
And fill in supersecret for password
{
And press log in
$this-setBrowser('*firefox');
Then I should see Welcome to the customer center
$this-setBrowserUrl('http://login.mittwald.de/');
}
public function testLoginWithCorrectCredentialsWorksCorrectly()
{
$this-url('login.html');
$this-byXPath('//input[@id=login_username]')-value('123456');
$this-byXPath('//input[@id=login_password]')-value('supersecret');
$this
-byXPath('//input[@type=submit and @name=login_password]')
-clickAndWait();
$this-frame(0);
$this-assertContains(
'Welcome to the customer center',
$this-byXPath('//body')-text()
);
}
}
?
24
6
Lines
185. Scenario: Registration form
Given I am on index.php?id=512
When I follow register now!
And I fill in user_name with Max Mustermann
And I fill in user_email with m.mustermann@example.com
And I attach the file /Users/mmustermann/max.jpeg
to user_image
And I press submit registration
Then I should be on index.php?id=514
And the response should contain Thank you ...
And the mailbox m15273 should contain an email with
subject Your registration
186. Scenario: Registration form
Given I am on index.php?id=512
When I follow register now!
And I fill in user_name with Max Mustermann
And I fill in user_email with m.mustermann@example.com
And I attach the file /Users/mmustermann/max.jpeg
to user_image
And I press submit registration
Then I should be on index.php?id=514
And the response should contain Thank you ...
And the mailbox m15273 should contain an email with
subject Your registration
This
191. Feature: Online registration
In order to use the site's personalized features
As an anonymous user
I want to register to the page.
Scenario: Registration is confirmed
Given I am on the registration page
And I fill in the following:
| Full name
| Max Mustermann
|
| Email address | m.mustermann@example.com |
And I upload an image of myself
And submit the registration
Then I should see a confirmation message
And I should receive a confirmation email
Better!
192. Feature: Online registration
In order to use the site's personalized features
As an anonymous user
I want to register to the page.
Scenario: Registration is confirmed
Given I am on the registration page
And I fill in the following:
| Full name
| Max Mustermann
|
| Email address | m.mustermann@example.com |
And I upload an image of myself
And submit the registration
Then I should see a confirmation message
And I should receive a confirmation email
Who
196. class FeatureContext extends Context
{
/**
* @Then /^(?:|I )should receive a confirmation e?mail$/
*/
public function assertRegistrationMailWasReceived()
{
// Connect to mailbox and see if mail is actually there.
// Throw exception otherwise.
}
}
Then /^(?:I| ) should receive a confirmation e?mail$/ do
# Connect to mailbox and see if mail is actually there.
# Throw exception otherwise.
end