1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Pagantis\SeleniumFormUtils\Step; |
4
|
|
|
|
5
|
|
|
use Facebook\WebDriver\WebDriverBy; |
6
|
|
|
use Facebook\WebDriver\WebDriverExpectedCondition; |
7
|
|
|
use Clearpay\Clearpay\Test\ClearpayMagentoTest; |
|
|
|
|
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class OrderConfirmation |
11
|
|
|
* |
12
|
|
|
* @package Clearpay\SeleniumFormUtils\Step |
13
|
|
|
*/ |
14
|
|
|
class OrderConfirmation extends AbstractStep |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* Handler step |
18
|
|
|
*/ |
19
|
|
|
const STEP = 'OrderConfirmation' |
20
|
|
|
; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* First step Confirm retrieved data |
24
|
|
|
* |
25
|
|
|
* @param bool $rejected |
26
|
|
|
* @return bool |
27
|
|
|
* @throws \Exception |
28
|
|
|
*/ |
29
|
|
|
public function run($rejected = false) |
30
|
|
|
{ |
31
|
|
|
try{ |
32
|
|
|
//Wait after redirection |
33
|
|
|
$simulatorElementSearch = WebDriverBy::id('OrderConfirmation-container'); |
34
|
|
|
$condition = WebDriverExpectedCondition::presenceOfElementLocated($simulatorElementSearch); |
35
|
|
|
$this->webDriver->wait()->until($condition); |
36
|
|
|
} catch (\Exception $e) { |
37
|
|
|
$errorElementSearch = WebDriverBy::className('technical-error-container'); |
38
|
|
|
$condition = WebDriverExpectedCondition::presenceOfElementLocated($errorElementSearch); |
39
|
|
|
$this->webDriver->wait()->until($condition); |
40
|
|
|
$this->assertTrue((bool) $condition, "ERROR ON ".self::STEP); |
|
|
|
|
41
|
|
|
return false; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
//Click on popup |
45
|
|
|
sleep(3); |
46
|
|
|
$buttonElementSearch = WebDriverBy::name('dialogButton'); |
47
|
|
|
$condition = WebDriverExpectedCondition::presenceOfElementLocated($buttonElementSearch); |
48
|
|
|
$this->webDriver->wait()->until($condition); |
49
|
|
|
$formContinue = $this->webDriver->findElement($buttonElementSearch)->click(); |
|
|
|
|
50
|
|
|
sleep(3); |
51
|
|
|
|
52
|
|
|
//Click on confirm |
53
|
|
|
$buttonElementSearch = WebDriverBy::className('button-contained-primary'); |
54
|
|
|
$condition = WebDriverExpectedCondition::presenceOfElementLocated($buttonElementSearch); |
55
|
|
|
$this->webDriver->wait()->until($condition); |
56
|
|
|
$formContinue = $this->webDriver->findElement($buttonElementSearch)->click(); |
57
|
|
|
sleep(3); |
58
|
|
|
|
59
|
|
|
return false; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths