Completed
Push — master ( b21958...b5070f )
by Dmitry
33s
created

BackupsCest::ensureICanSeeBulkSearchBox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\hosting\tests\acceptance\client;
4
5
use hipanel\helpers\Url;
6
use hipanel\tests\_support\Page\IndexPage;
7
use hipanel\tests\_support\Step\Acceptance\Client;
8
9
class BackupsCest
10
{
11
    /**
12
     * @var IndexPage
13
     */
14
    private $index;
15
16
    public function _before(Client $I)
17
    {
18
        $this->index = new IndexPage($I);
19
    }
20
21 View Code Duplication
    public function ensureIndexPageWorks(Client $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
    {
23
        $I->login();
24
        $I->needPage(Url::to('@backuping'));
25
        $I->see('Backups', 'h1');
26
        $this->ensureICanSeeAdvancedSearchBox($I);
27
        $this->ensureICanSeeBulkSearchBox();
28
    }
29
30 View Code Duplication
    private function ensureICanSeeAdvancedSearchBox(Client $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32
        $I->see('Advanced search', 'h3');
33
34
        $formId = 'form-advancedsearch-backuping-search';
35
        $this->index->containsFilters($formId, []);
36
37
        $I->see('State', "//form[@id='$formId']//span");
38
        $I->see('Account', "//form[@id='$formId']//span");
39
        $I->see('Server', "//form[@id='$formId']//span");
40
    }
41
42
    private function ensureICanSeeBulkSearchBox()
43
    {
44
        $this->index->containsBulkButtons([
45
            ["//button[@type='submit']" => 'Enable'],
46
            ["//button[@type='submit']" => 'Disable'],
47
            ["//button[@type='submit']" => 'Delete'],
48
        ]);
49
        $this->index->containsColumns('bulk-backuping-search', [
50
            'Name',
51
            'Account',
52
            'Server',
53
            'Count',
54
            'Periodicity',
55
            'State',
56
            'Last backup',
57
            'Disk usage',
58
        ]);
59
    }
60
}
61