1 |
efrain |
1 |
@tool @tool_behat
|
|
|
2 |
Feature: Transform steps arguments
|
|
|
3 |
In order to write tests with complex nasty arguments
|
|
|
4 |
As a tests writer
|
|
|
5 |
I need to apply some transformations to the steps arguments
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given I am on site homepage
|
|
|
9 |
And the following "courses" exist:
|
|
|
10 |
| fullname | shortname | category |
|
|
|
11 |
| Course 1 | C1 | 0 |
|
|
|
12 |
And I log in as "admin"
|
|
|
13 |
And I open my profile in edit mode
|
|
|
14 |
|
|
|
15 |
Scenario: Use nasty strings on steps arguments
|
|
|
16 |
When I set the field "Last name" to "$NASTYSTRING1"
|
|
|
17 |
And I set the field "Description" to "$NASTYSTRING2"
|
|
|
18 |
And I set the field "City/town" to "$NASTYSTRING3"
|
|
|
19 |
And I press "Update profile"
|
|
|
20 |
And I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
21 |
Then I should not see "NASTYSTRING"
|
|
|
22 |
And the field "Last name" matches value "$NASTYSTRING1"
|
|
|
23 |
And the field "City/town" matches value "$NASTYSTRING3"
|
|
|
24 |
|
|
|
25 |
Scenario: Use nasty strings on table nodes
|
|
|
26 |
When I set the following fields to these values:
|
|
|
27 |
| Last name | $NASTYSTRING1 |
|
|
|
28 |
| Description | $NASTYSTRING2 |
|
|
|
29 |
| City/town | $NASTYSTRING3 |
|
|
|
30 |
And I press "Update profile"
|
|
|
31 |
And I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
32 |
Then I should not see "NASTYSTRING"
|
|
|
33 |
And the field "Last name" matches value "$NASTYSTRING1"
|
|
|
34 |
And the field "City/town" matches value "$NASTYSTRING3"
|
|
|
35 |
|
|
|
36 |
Scenario: Use double quotes
|
|
|
37 |
When I set the following fields to these values:
|
|
|
38 |
| First name | va"lue1 |
|
|
|
39 |
| Description | va\"lue2 |
|
|
|
40 |
And I set the field "City/town" to "va\"lue3"
|
|
|
41 |
And I press "Update profile"
|
|
|
42 |
And I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
43 |
Then I should not see "NASTYSTRING"
|
|
|
44 |
And the field "First name" matches value "va\"lue1"
|
|
|
45 |
And the field "Description" matches value "va\\"lue2"
|
|
|
46 |
And the field "City/town" matches value "va\"lue3"
|
|
|
47 |
|
|
|
48 |
Scenario: Nasty strings with other contents
|
|
|
49 |
When I set the field "First name" to "My Firstname $NASTYSTRING1"
|
|
|
50 |
And I set the following fields to these values:
|
|
|
51 |
| Last name | My Last name $NASTYSTRING2 |
|
|
|
52 |
And I press "Update profile"
|
|
|
53 |
And I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
54 |
Then I should not see "NASTYSTRING"
|
|
|
55 |
And I should see "My Firstname"
|
|
|
56 |
And I should see "My Last name"
|
|
|
57 |
And the field "First name" matches value "My Firstname $NASTYSTRING1"
|
|
|
58 |
And the field "Last name" matches value "My Last name $NASTYSTRING2"
|