1 | <?php |
||
19 | class FormContext extends AbstractContext |
||
20 | { |
||
21 | /** |
||
22 | * @var DefaultPage |
||
23 | */ |
||
24 | private $defaultPage; |
||
25 | |||
26 | public function __construct(DefaultPage $defaultPage) |
||
30 | |||
31 | /** |
||
32 | * @When I change form field :field to value :value |
||
33 | */ |
||
34 | public function iChangeFormFieldWithValue($field, $value) |
||
39 | |||
40 | /** |
||
41 | * @Given /^I should see form with following fields$/ |
||
42 | */ |
||
43 | public function iShouldSeeFormWithFollowingFields(TableNode $table) |
||
50 | |||
51 | /** |
||
52 | * @Given /^I press form "([^"]*)" button$/ |
||
53 | */ |
||
54 | public function iPressFormButton($button) |
||
58 | |||
59 | /** |
||
60 | * @Given I fill the form with values: |
||
61 | */ |
||
62 | public function iFillFormFields(TableNode $table) |
||
77 | |||
78 | /** |
||
79 | * @Transform /"([^"]*)" non-editable collection/ |
||
80 | * @Transform /non-editable collection "([^"]*)"/ |
||
81 | * @Transform /removable-only collection "([^"]*)"/ |
||
82 | */ |
||
83 | public function transformToNoneditableCollection($collectionNames) |
||
87 | |||
88 | /** |
||
89 | * @Transform /^"([^"]*)" collection/ |
||
90 | * @Transform /collection "([^"]*)"/ |
||
91 | */ |
||
92 | public function transformToCollection($collectionNames) |
||
96 | |||
97 | /** |
||
98 | * @Given /^("[^"]*" collection) has (\d+) (element|elements)$/ |
||
99 | * @Then /^("[^"]*" collection) should have (\d+) (element|elements)$/ |
||
100 | * @Given /^(non-editable collection "[^"]*") has (\d+) (element|elements)$/ |
||
101 | * @Then /^(non-editable collection "[^"]*") should have (\d+) (element|elements)$/ |
||
102 | * @Then /^(removable-only collection "[^"]*") should have (\d+) (element|elements)$/ |
||
103 | */ |
||
104 | public function collectionShouldHaveElements(NodeElement $collection, $elementsCount) |
||
109 | |||
110 | /** |
||
111 | * @Given /^(collection "[^"]*") should have "([^"]*)" button$/ |
||
112 | */ |
||
113 | public function collectionShouldHaveButton(NodeElement $collection, $buttonName) |
||
117 | |||
118 | /** |
||
119 | * @Then /^all buttons for adding and removing items in (non-editable collection "[^"]*") should be disabled$/ |
||
120 | */ |
||
121 | public function allCollectionButtonsDisabled(NodeElement $collection) |
||
134 | |||
135 | /** |
||
136 | * @Then /^button for adding item in (removable-only collection "[^"]*") should be disabled$/ |
||
137 | */ |
||
138 | public function collectionAddButtonIsDisabled(NodeElement $collection) |
||
146 | |||
147 | /** |
||
148 | * @Then /^buttons for removing items in (removable-only collection "[^"]*") should be enabled/ |
||
149 | */ |
||
150 | public function collectionRemoveButtonsAreEnabled(NodeElement $collection) |
||
158 | |||
159 | /** |
||
160 | * @When /^I press "([^"]*)" in (collection "[^"]*")$/ |
||
161 | */ |
||
162 | public function iPressInCollection($buttonName, NodeElement $collection) |
||
168 | |||
169 | /** |
||
170 | * @Given /^I fill "([^"]*)" with "([^"]*)" in (collection "[^"]*") at position (\d+)$/ |
||
171 | */ |
||
172 | public function iFillWithInCollectionAtPosition($fieldName, $fieldValue, NodeElement $collection, $position) |
||
177 | |||
178 | /** |
||
179 | * @Given /^I remove (\w+) element in (collection "[^"]*")$/ |
||
180 | * @Given /^I remove (\w+) element in (removable-only collection "[^"]*")$/ |
||
181 | */ |
||
182 | public function iRemoveElementInCollection($index, NodeElement $collection) |
||
187 | |||
188 | private function getFormElement(): Form |
||
192 | } |
||
193 |