ConfirmData::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Pagantis\SeleniumFormUtils\Step;
4
5
use Facebook\WebDriver\WebDriverBy;
6
7
/**
8
 * Class ConfirmData
9
 *
10
 * @package Pagantis\SeleniumFormUtils\Step
11
 */
12
class ConfirmData extends AbstractStep
13
{
14
    /**
15
     * Handler step
16
     */
17
    const STEP = 'ConfirmData';
18
19
    /**
20
     * First step Confirm retrieved data
21
     *
22
     * @param bool $rejected
23
     * @return bool
24
     * @throws \Exception
25
     */
26
    public function run($rejected = false)
27
    {
28
        $this->validateStep(self::STEP);
29
        //Click on confirm:
30
        $confirmCheckbox = $this->webDriver->findElement(WebDriverBy::className('checkmark'));
31
        $confirmCheckbox->click();
32
        $formContinue = $this->webDriver->findElement(WebDriverBy::name('continue_button'));
33
        $formContinue->click();
34
35
        return true;
36
    }
37
}
38