ConfigureTest::configureModule()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 23
rs 9.7998
1
<?php
2
3
namespace Test\Configure;
4
5
use Facebook\WebDriver\WebDriverBy;
6
use Facebook\WebDriver\WebDriverExpectedCondition;
7
8
/**
9
 * Class ConfigureTest
10
 * @package Test\Configure
11
 *
12
 * @group oscommerce-configure
13
14
 */
15
class ConfigureTest extends AbstractConfigure
16
{
17
    /**
18
     * testConfigurePagantisInOscommerce
19
     */
20
    public function testConfigurePagantisInOscommerce()
21
    {
22
        $this->loginToBackOffice();
23
        $this->goToPagantis();
24
        $this->installPagantisModule();
25
        $this->configureModule();
26
        $this->quit();
27
    }
28
29
    /**
30
     * Configure paylater module
31
     */
32
    public function configureModule()
33
    {
34
        // Click on edit
35
        $button = WebDriverBy::id('tdb2');
36
        $condition = WebDriverExpectedCondition::visibilityOfElementLocated($button);
37
        $this->waitUntil($condition);
38
        $this->findById('tdb2')->click();
39
40
        $this->findByName('configuration[MODULE_PAYMENT_PAGANTIS_PK]')
41
            ->clear()
42
            ->sendKeys($this->configuration['publicKey'])
43
        ;
44
45
        $this->findByName('configuration[MODULE_PAYMENT_PAGANTIS_SK]')
46
            ->clear()
47
            ->sendKeys($this->configuration['secretKey'])
48
        ;
49
50
        // click on Save
51
        $button = WebDriverBy::id('tdb2');
52
        $condition = WebDriverExpectedCondition::visibilityOfElementLocated($button);
53
        $this->waitUntil($condition);
54
        $this->findById('tdb2')->click();
55
    }
56
}
57