@@ 28-40 (lines=13) @@ | ||
25 | /** |
|
26 | * @When /^I (?:click|press|follow) "([^"]*)" near "([^"]*)"$/ |
|
27 | */ |
|
28 | public function iClickNear($button, $value) |
|
29 | { |
|
30 | $selector = sprintf('table tbody tr:contains("%s")', $value); |
|
31 | $tr = $this->assertSession()->elementExists('css', $selector); |
|
32 | ||
33 | $locator = sprintf('button:contains("%s")', $button); |
|
34 | ||
35 | if ($tr->has('css', $locator)) { |
|
36 | $tr->find('css', $locator)->press(); |
|
37 | } else { |
|
38 | $tr->clickLink($button); |
|
39 | } |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * @Then /^I should see "([^"]*)" near "([^"]*)"$/ |
@@ 160-172 (lines=13) @@ | ||
157 | /** |
|
158 | * @When /^I (?:click|press|follow) "([^"]*)" near "([^"]*)"$/ |
|
159 | */ |
|
160 | public function iClickNear($button, $value) |
|
161 | { |
|
162 | $selector = sprintf('.server-list .server-item:contains("%s")', $value); |
|
163 | $item = $this->assertSession()->elementExists('css', $selector); |
|
164 | ||
165 | $locator = sprintf('button:contains("%s")', $button); |
|
166 | ||
167 | if ($item->has('css', $locator)) { |
|
168 | $item->find('css', $locator)->press(); |
|
169 | } else { |
|
170 | $item->clickLink($button); |
|
171 | } |
|
172 | } |
|
173 | ||
174 | /** |
|
175 | * @Then /^I should be on the ftp page of ([^""]*) "([^""]*)"$/ |