@@ 69-80 (lines=12) @@ | ||
66 | /** |
|
67 | * @Then /^(?:|I )select ([\w\s]*) contact as default$/ |
|
68 | */ |
|
69 | public function selectContactAsDefault($name) |
|
70 | { |
|
71 | foreach ($this->getFormContacts() as $contact) { |
|
72 | if (false !== strpos($contact->getText(), $name)) { |
|
73 | $contact->find('css', 'input[type="radio"]')->click(); |
|
74 | ||
75 | return; |
|
76 | } |
|
77 | } |
|
78 | ||
79 | self::fail(sprintf('Can\'t find contact with "%s" name', $name)); |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * @Then delete :name contact |
|
@@ 85-96 (lines=12) @@ | ||
82 | /** |
|
83 | * @Then delete :name contact |
|
84 | */ |
|
85 | public function deleteContact($name) |
|
86 | { |
|
87 | foreach ($this->getFormContacts() as $contact) { |
|
88 | if (false !== strpos($contact->getText(), $name)) { |
|
89 | $contact->find('css', 'i.icon-remove')->click(); |
|
90 | ||
91 | return; |
|
92 | } |
|
93 | } |
|
94 | ||
95 | self::fail(sprintf('Can\'t find contact with "%s" name', $name)); |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * @return NodeElement[] |