@@ 54-68 (lines=15) @@ | ||
51 | /** |
|
52 | * @Then /^(?:|I )select ([\w\s]*) contact as default$/ |
|
53 | */ |
|
54 | public function selectContactAsDefault($name) |
|
55 | { |
|
56 | foreach ($this->getFormContacts() as $contact) { |
|
57 | if (false !== strpos($contact->getText(), $name)) { |
|
58 | $contact->find('css', 'input[type="radio"]')->click(); |
|
59 | ||
60 | return; |
|
61 | } |
|
62 | } |
|
63 | ||
64 | throw new ExpectationException( |
|
65 | sprintf('Can\'t find contact with "%s" name', $name), |
|
66 | $this->getSession()->getDriver() |
|
67 | ); |
|
68 | } |
|
69 | ||
70 | /** |
|
71 | * @Then delete :name contact |
|
@@ 73-87 (lines=15) @@ | ||
70 | /** |
|
71 | * @Then delete :name contact |
|
72 | */ |
|
73 | public function deleteContact($name) |
|
74 | { |
|
75 | foreach ($this->getFormContacts() as $contact) { |
|
76 | if (false !== strpos($contact->getText(), $name)) { |
|
77 | $contact->find('css', 'i.icon-remove')->click(); |
|
78 | ||
79 | return; |
|
80 | } |
|
81 | } |
|
82 | ||
83 | throw new ExpectationException( |
|
84 | sprintf('Can\'t find contact with "%s" name', $name), |
|
85 | $this->getSession()->getDriver() |
|
86 | ); |
|
87 | } |
|
88 | ||
89 | /** |
|
90 | * @return NodeElement[] |