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

IPAddressesCest::ensureICanSeeLegendBox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\hosting\tests\acceptance\seller;
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\Seller;
10
11 View Code Duplication
class IPAddressesCest
0 ignored issues
show
Duplication introduced by
This class 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...
12
{
13
    /**
14
     * @var IndexPage
15
     */
16
    private $index;
17
18
    public function _before(Seller $I)
19
    {
20
        $this->index = new IndexPage($I);
21
    }
22
23
    public function ensureIndexPageWorks(Seller $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
            'Counters',
58
            'Links',
59
        ]);
60
    }
61
}
62