Skip to content

Commit 46ae385

Browse files
committed
Merge branch 'feature-updateTests' into dev33
2 parents 6d666c0 + 1adb438 commit 46ae385

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

tests/features/bootstrap/FeatureContext.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class FeatureContext extends MinkContext
1616
{
1717

1818
private $params = array();
19+
private $data = array();
1920

2021
/**
2122
* Initializes context.
@@ -54,4 +55,22 @@ public function iRecreateTheDatabase()
5455
mysqli_query($db,'drop database if exists phplistbehattestdb');
5556
mysqli_query($db,'create database phplistbehattestdb');
5657
}
58+
59+
/**
60+
* @When /^I fill in "([^"]*)" with an email address$/
61+
*/
62+
public function iFillInWithAnEmailAddress($fieldName)
63+
{
64+
$this->data['email'] = '[email protected]'; // at some point really make random
65+
$this->fillField($fieldName, $this->data['email']);
66+
}
67+
68+
/**
69+
* @Given /^I should see the email address I entered$/
70+
*/
71+
public function iShouldSeeTheEmailAddressIEntered()
72+
{
73+
$this->assertSession()->pageTextContains($this->data['email']);
74+
}
75+
5776
}

tests/features/loaddefaultattributes.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Feature: Create new campaign
2-
In order to create a new campaign
1+
Feature: Load default attributes
2+
In order to load default attributes
33
As an admin user
4-
I need to be able to login and start a new campaign
4+
I need to be able to login and load default attributes and add a value
55

6-
Scenario: Login and create a campaign
6+
Scenario: Load default attributes and add a value
77
Given I am on "/lists/admin/?page=attributes"
88
When I fill in "login" with "admin"
99
And I fill in "password" with "Mypassword123+"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Feature: Create a new subscriber
2+
In order to create a new subscriber
3+
As an admin user
4+
I need to be able to login and start a new campaign
5+
6+
Scenario: Login and create a campaign
7+
Given I am on "/lists/admin/"
8+
When I fill in "login" with "admin"
9+
And I fill in "password" with "Mypassword123+"
10+
And I press "Continue"
11+
Then I should see "Add a new subscriber"
12+
When I follow "Add a new subscriber"
13+
Then I should see "Email address"
14+
When I fill in "email" with an email address
15+
And I press "change"
16+
Then I should see "subscriber profile"
17+
# Then print last response
18+
# this fails, even though the address is there
19+
# And I should see the email address I entered
20+
And I follow "History"
21+
Then I should see the email address I entered
22+

0 commit comments

Comments
 (0)