Completed
Push — master ( 27c0a7...08c543 )
by Dmitry
11s
created

IPAddressesCest::_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 hipanel\modules\hosting\tests\acceptance\admin;
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\Select2;
9
use hipanel\tests\_support\Step\Acceptance\Admin;
10
11
class IPAddressesCest
12
{
13
    /**
14
     * @var IndexPage
15
     */
16
    private $index;
17
18
    public function _before(Admin $I)
19
    {
20
        $this->index = new IndexPage($I);
21
    }
22
23
    public function ensureIndexPageWorks(Admin $I)
24
    {
25
        $I->login();
26
        $I->needPage(Url::to('@ip'));
27
        $I->see('IP addresses', 'h1');
28
        $this->ensureICanSeeAdvancedSearchBox();
29
        $this->ensureICanSeeLegendBox();
30
        $this->ensureICanSeeBulkSearchBox();
31
    }
32
33
    private function ensureICanSeeAdvancedSearchBox()
34
    {
35
        $this->index->containsFilters([
36
            new Input('IP'),
37
            new Select2('Servers'),
38
            new Input('Tags'),
39
        ]);
40
    }
41
42
    private function ensureICanSeeLegendBox()
43
    {
44
        $this->index->containsLegend([
45
            'Shared',
46
            'Free',
47
            'Dedicated',
48
            'System',
49
            'Blocked',
50
        ]);
51
    }
52
53
    private function ensureICanSeeBulkSearchBox()
54
    {
55
        $this->index->containsColumns([
56
            'IP',
57
            'Note',
58
            'Tags',
59
            'Counters',
60
            'Links',
61
        ]);
62
    }
63
}
64