RefusesCest::ensureICanSeeAdvancedSearchBox()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\tests\acceptance\seller;
12
13
use hipanel\helpers\Url;
14
use hipanel\tests\_support\Page\IndexPage;
15
use hipanel\tests\_support\Page\Widget\Input\Dropdown;
16
use hipanel\tests\_support\Page\Widget\Input\Select2;
17
use hipanel\tests\_support\Step\Acceptance\Seller;
18
19
class RefusesCest
20
{
21
    /**
22
     * @var IndexPage
23
     */
24
    private $index;
25
26
    public function _before(Seller $I)
27
    {
28
        $this->index = new IndexPage($I);
29
    }
30
31
    public function ensureIndexPageWorks(Seller $I)
32
    {
33
        $I->login();
34
        $I->needPage(Url::to('/server/refuse'));
35
        $I->see('Refuses', 'h1');
36
        $this->ensureICanSeeAdvancedSearchBox($I);
37
        $this->ensureICanSeeBulkServerSearchBox();
38
    }
39
40
    private function ensureICanSeeAdvancedSearchBox(Seller $I)
41
    {
42
        $this->index->containsFilters([
43
            Select2::asAdvancedSearch($I, 'Client'),
44
            (Dropdown::asAdvancedSearch($I, 'State'))->withItems([
45
                'New',
46
                'Approved',
47
                'Rejected',
48
            ]),
49
        ]);
50
    }
51
52
    private function ensureICanSeeBulkServerSearchBox()
53
    {
54
        $this->index->containsBulkButtons([
55
            'Approve',
56
            'Reject',
57
        ]);
58
        $this->index->containsColumns([
59
            'Client',
60
            'Server',
61
            'User comment',
62
            'Time',
63
        ]);
64
    }
65
}
66