Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 6bd751c

Browse files
author
Dmytro Yushkin
committed
MAGETWO-65119: Create/update automated functional tests
- Guarantee cancel flow using plugins now - Webhook wait functions deleted
1 parent 28577b6 commit 6bd751c

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

Test/Block/SignifydConsole/Webhooks.php

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,6 @@ class Webhooks extends Block
6767
*/
6868
private $webhookDeleteButton = '[class*="webhook-delete"]';
6969

70-
/**
71-
* Css selector of popup block for delete webhook confirmation.
72-
*
73-
* @var string
74-
*/
75-
private $webhookDeleteConfirmOverlay = '[class="appriseOuter"]';
76-
7770
/**
7871
* Css selector of confirming button for deleting webhook.
7972
*
@@ -96,7 +89,7 @@ public function create($team)
9689
continue;
9790
}
9891

99-
$this->addWebhook($handlerUrl, $webhookEventCode, $webhookEventName, $team);
92+
$this->addWebhook($handlerUrl, $webhookEventCode, $team);
10093
}
10194
}
10295

@@ -135,44 +128,32 @@ private function getWebhook($team, $webhookEventName)
135128
/**
136129
* Delete webhook element with confirmation popup.
137130
*
138-
* Signifyd creates the same popup every time Selenium click on delete button,
139-
* so we need to wait that previous popup will be closed.
140-
*
141131
* @param ElementInterface $webhook
142132
* @return void
143133
*/
144134
private function deleteWebhook(ElementInterface $webhook)
145135
{
146136
$webhook->find($this->webhookDeleteButton)->click();
147137
$this->_rootElement->find($this->webhookDeleteConfirmButton)->click();
148-
149-
$this->_rootElement->waitUntil(
150-
function () {
151-
return $this->_rootElement->find($this->webhookDeleteConfirmOverlay)
152-
->isPresent() ? null : true;
153-
}
154-
);
155138
}
156139

157140
/**
158141
* Sets webhook data and add it.
159142
*
160143
* @param string $handlerUrl
161144
* @param string $webhookEventCode
162-
* @param string $webhookEventName
163145
* @param string $team
164146
* @return void
165147
*/
166148
private function addWebhook(
167149
$handlerUrl,
168150
$webhookEventCode,
169-
$webhookEventName,
170151
$team
171152
) {
172153
$this->setEvent($webhookEventCode);
173154
$this->setTeam($team);
174155
$this->setUrl($handlerUrl);
175-
$this->submit($webhookEventName, $handlerUrl);
156+
$this->submit();
176157
}
177158

178159
/**
@@ -216,25 +197,11 @@ private function setUrl($handlerUrl)
216197
/**
217198
* Add webhook element.
218199
*
219-
* Selenium needs to wait until webhook will be added to grid
220-
* before proceed to next step.
221-
*
222-
* @param string $webhookEventName
223-
* @param string $handlerUrl
224200
* @return void
225201
*/
226-
private function submit($webhookEventName, $handlerUrl)
202+
private function submit()
227203
{
228204
$this->_rootElement->find($this->webhookAddButton)->click();
229-
230-
$this->_rootElement->waitUntil(
231-
function () use ($webhookEventName, $handlerUrl) {
232-
return $this->_rootElement->find(
233-
sprintf($this->webhookAddedElement, $handlerUrl, $webhookEventName),
234-
Locator::SELECTOR_XPATH
235-
)->isPresent() ? true : null;
236-
}
237-
);
238205
}
239206

240207
/**

0 commit comments

Comments
 (0)