Completed
Push — master ( 74888d...983d65 )
by Dmitry
16:06 queued 12:58
created

ServerCest::ensureICanSeeBulkServerSearchBox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace hipanel\modules\server\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 ServerCest
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
    public function ensureIndexPageWorks(Client $I)
22
    {
23
        $I->login();
24
        $I->needPage(Url::to('@server'));
25
        $I->see('Servers', 'h1');
26
        $this->ensureICanSeeAdvancedSearchBox($I);
27
        $this->ensureICanSeeBulkServerSearchBox($I);
28
    }
29
30
    private function ensureICanSeeAdvancedSearchBox(Client $I)
31
    {
32
        $I->seeLink('Buy server', Url::to('/server/order/index'));
33
        $I->see('Advanced search', 'h3');
34
35
        $this->index->containsFilters('form-advancedsearch-server-search', [
36
            ['input' => [
37
                'id' => 'serversearch-name_like',
38
                'placeholder' => 'Name',
39
            ]],
40
            ['input' => [
41
                'id' => 'serversearch-note_like',
42
                'placeholder' => 'Note',
43
            ]],
44
            ['input' => [
45
                'id' => 'serversearch-ip_like',
46
                'placeholder' => 'IP',
47
            ]],
48
            ['input' => ['placeholder' => 'Type']],
49
            ['input' => ['placeholder' => 'Status']],
50
        ]);
51
    }
52
53
    private function ensureICanSeeBulkServerSearchBox(Client $I)
0 ignored issues
show
Unused Code introduced by
The parameter $I is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
    private function ensureICanSeeBulkServerSearchBox(/** @scrutinizer ignore-unused */ Client $I)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
    {
55
        $this->index->containsBulkButtons([
56
            ["//button[@type='button']" => 'Basic actions'],
57
        ]);
58
        $this->index->containsColumns('bulk-server-search', [
59
            'Name',
60
            'IPs',
61
            'Status',
62
            'Expires',
63
            'Tariff',
64
        ]);
65
    }
66
}
67