Passed
Pull Request — master (#14)
by pablo
02:25
created

AccountVerification   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
c 1
b 0
f 0
dl 0
loc 33
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 17 1
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;
0 ignored issues
show
Bug introduced by
The type Clearpay\Clearpay\Test\ClearpayMagentoTest was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
/**
10
 * Class AccountVerification
11
 *
12
 * @package Clearpay\SeleniumFormUtils\Step
13
 */
14
class AccountVerification extends AbstractStep
15
{
16
    /**
17
     * Handler step
18
     */
19
    const STEP = 'AccountVerification';
20
21
    const EMAIL = '[email protected]';
22
23
    /**
24
     * First step Confirm retrieved data
25
     *
26
     * @param bool $rejected
27
     * @return bool
28
     * @throws \Exception
29
     */
30
    public function run($rejected = false)
31
    {
32
        //Wait after redirection
33
        $simulatorElementSearch = WebDriverBy::name('email');
34
        $condition  = WebDriverExpectedCondition::presenceOfElementLocated($simulatorElementSearch);
35
        $this->webDriver->wait()->until($condition);
36
37
        //Fill email
38
        $fillEmail = $this->webDriver->findElement($simulatorElementSearch)->clear()->sendKeys(self::EMAIL);
0 ignored issues
show
Unused Code introduced by
The assignment to $fillEmail is dead and can be removed.
Loading history...
39
40
        //Click on confirm
41
        $formContinue = $this->webDriver->findElement(WebDriverBy::id('continueBtn'));
42
        $formContinue->click();
43
44
        sleep(5);
45
46
        return true;
47
    }
48
}
49