Completed
Push — master ( f8a75f...a37a81 )
by Dmitry
9s
created

TariffPlansCest::_before()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace advancedhosters\hipanel\tests\acceptance\module\finance\manager;
4
5
use hipanel\helpers\Url;
6
use hipanel\tests\_support\Page\IndexPage;
7
use hipanel\tests\_support\Page\Widget\Input\Input;
8
use hipanel\tests\_support\Page\Widget\Input\Dropdown;
9
use hipanel\tests\_support\Page\Widget\Input\Select2;
10
use hipanel\tests\_support\Step\Acceptance\Manager;
11
12
class TariffPlansCest
13
{
14
    /**
15
     * @var IndexPage
16
     */
17
    private $index;
18
19
    public function _before(Manager $I)
20
    {
21
        $this->index = new IndexPage($I);
22
    }
23
24 View Code Duplication
    public function ensureIndexPageWorks(Manager $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...
25
    {
26
        $I->login();
27
        $I->needPage(Url::to('@plan'));
28
        $I->see('Tariff plans', 'h1');
29
        $I->seeLink('Create', Url::to('@plan/create'));
30
        $this->ensureICanSeeAdvancedSearchBox();
31
        $this->ensureICanSeeBulkBillSearchBox();
32
    }
33
34
    private function ensureICanSeeAdvancedSearchBox()
35
    {
36
        $this->index->containsFilters([
37
            new Input('Name Ilike'),
38
            new Select2('Client'),
39
            (new Dropdown('plansearch-type'))->withItems([
40
                'Server',
41
                'vCDN',
42
                'pCDN',
43
                'IP',
44
                'Account',
45
                'Domain',
46
                'Client',
47
                'Template',
48
            ]),
49
            new Input('Statuses'),
50
        ]);
51
    }
52
53
    private function ensureICanSeeBulkBillSearchBox()
54
    {
55
        $this->index->containsBulkButtons([
56
            'Restore',
57
            'Delete',
58
        ]);
59
        $this->index->containsColumns([
60
            'Name',
61
            'Client',
62
            'Type',
63
            'Status',
64
        ]);
65
    }
66
}
67