1 | <?php |
||
22 | class FiltersContext extends AbstractContext |
||
23 | { |
||
24 | /** |
||
25 | * @var DefaultPage |
||
26 | */ |
||
27 | private $defaultPage; |
||
28 | |||
29 | /** |
||
30 | * @var DataSourceInterface[] |
||
31 | */ |
||
32 | private $datasources = []; |
||
33 | |||
34 | public function __construct(DefaultPage $defaultPage) |
||
38 | |||
39 | /** |
||
40 | * @Given /^("[^"]*" element) datasource max results is set (\d+)$/ |
||
41 | */ |
||
42 | public function elementDatasourceMaxResultsIsSet(AdminListElement $adminElement, $maxResults) |
||
47 | |||
48 | /** |
||
49 | * @Given /^("[^"]*" element) has datasource with fields$/ |
||
50 | */ |
||
51 | public function elementHaveDatasourceWithFields(AdminListElement $adminElement) |
||
58 | |||
59 | /** |
||
60 | * @Given /^("[^"]*" element) has datasource without filters$/ |
||
61 | */ |
||
62 | public function elementHaveDatasourceWithoutFilters(AdminListElement $adminElement) |
||
77 | |||
78 | /** |
||
79 | * @Then /^both sorting buttons in column header "([^"]*)" should be active$/ |
||
80 | */ |
||
81 | public function bothSortingButtonsInColumnHeaderShouldBeActive($column) |
||
85 | |||
86 | /** |
||
87 | * @When /^I press "([^"]*)" button in "([^"]*)" column header$/ |
||
88 | */ |
||
89 | public function iPressButtonInColumnHeader($sort, $column) |
||
93 | |||
94 | /** |
||
95 | * @Then /^"([^"]*)" button in "([^"]*)" column header should be disabled$/ |
||
96 | */ |
||
97 | public function buttonInColumnHeaderShouldBeDisabled($sort, $column) |
||
112 | |||
113 | /** |
||
114 | * @Given /^"([^"]*)" button in "([^"]*)" column header should be active$/ |
||
115 | */ |
||
116 | public function buttonInColumnHeaderShouldBeActive($sort, $column) |
||
131 | |||
132 | /** |
||
133 | * @When /^I change elements per page to (\d+)$/ |
||
134 | */ |
||
135 | public function iChangeElementsPerPageTo($elementsCount) |
||
139 | |||
140 | /** |
||
141 | * @Then /^I should not see any filters$/ |
||
142 | */ |
||
143 | public function iShouldNotSeeAnyFilters() |
||
147 | |||
148 | /** |
||
149 | * @Then /^I should see simple text filter "([^"]*)"$/ |
||
150 | */ |
||
151 | public function iShouldSeeSimpleTextFilter($filterName) |
||
155 | |||
156 | /** |
||
157 | * @Given /^I should see between filter "([^"]*)" with "([^"]*)" and "([^"]*)" simple text fields$/ |
||
158 | */ |
||
159 | public function iShouldSeeBetweenFilterWithAndSimpleTextFields($filterName, $fromName, $toName) |
||
163 | |||
164 | /** |
||
165 | * @Given /^I should see choice filter "([^"]*)"$/ |
||
166 | */ |
||
167 | public function iShouldSeeChoiceFilter($filterName) |
||
171 | |||
172 | /** |
||
173 | * @Given /^I fill simple text filter "([^"]*)" with value "([^"]*)"$/ |
||
174 | */ |
||
175 | public function iFillSimpleTextFilterWithValue($filterName, $filterValue) |
||
179 | |||
180 | /** |
||
181 | * @When /^I select "([^"]*)" in choice filter "([^"]*)"$/ |
||
182 | */ |
||
183 | public function iSelectInChoiceFilter($filterValue, $filterName) |
||
187 | |||
188 | /** |
||
189 | * @Given /^I press "Search" button$/ |
||
190 | */ |
||
191 | public function iPressSearchButton() |
||
195 | |||
196 | /** |
||
197 | * @Given /^simple text filter "([^"]*)" should be filled with value "([^"]*)"$/ |
||
198 | */ |
||
199 | public function simpleTextFilterShouldBeFilledWithValue($filterName, $filterValue) |
||
203 | |||
204 | /** |
||
205 | * @Given /^choice filter "([^"]*)" should have value "([^"]*)" selected$/ |
||
206 | */ |
||
207 | public function choiceFilterShouldHaveValueSelected($filterName, $choice) |
||
213 | |||
214 | /** |
||
215 | * @Then /^I should see actions dropdown with following options$/ |
||
216 | */ |
||
217 | public function iShouldSeeActionsDropdownWithFollowingOptions(TableNode $actions) |
||
225 | |||
226 | /** |
||
227 | * @Given /^I should see confirmation button "([^"]*)"$/ |
||
228 | */ |
||
229 | public function iShouldSeeConfirmationButton($button) |
||
233 | |||
234 | /** |
||
235 | * @param AdminListElement $adminElement |
||
236 | * @return DataSourceInterface |
||
237 | */ |
||
238 | private function getDataSource(AdminListElement $adminElement) |
||
246 | |||
247 | private function clearDataSource(AdminListElement $element): void |
||
251 | |||
252 | private function getFiltersElement(): Filters |
||
256 | |||
257 | private function getListElement(): ListElement |
||
261 | |||
262 | private function getListResultsElement(): ListResultsElement |
||
266 | } |
||
267 |