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

AccountsCest::ensureIndexPageWorks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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 AccountsCest
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('@account'));
25
        $I->see('Accounts', '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('Create account', 'a');
33
        $I->see('Advanced search', 'h3');
34
35
        $formId = 'form-advancedsearch-account-search';
36
        $this->index->containsFilters($formId, [
37
            ['input' => [
38
                'id' => 'accountsearch-login_like',
39
                'placeholder' => 'Login',
40
            ]],
41
        ]);
42
43
        $I->see('Server', "//form[@id='$formId']//span");
44
        $I->see('Type', "//form[@id='$formId']//span");
45
        $I->see('Status', "//form[@id='$formId']//span");
46
    }
47
48 View Code Duplication
    private function ensureICanSeeBulkSearchBox()
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...
49
    {
50
        $this->index->containsBulkButtons([
51
            ["//button[@type='button']" => 'Basic actions'],
52
        ]);
53
        $this->index->containsColumns('bulk-account-search', [
54
            'Account',
55
            'Server',
56
            'Status',
57
            'Type',
58
        ]);
59
    }
60
}
61