Completed
Pull Request — master (#48)
by
unknown
13:13
created

TicketCest::ensureICanSeeBulkSearchBox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\ticket\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
class TicketCest
12
{
13
    private IndexPage $index;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
14
15
    public function _before(Seller $I): void
16
    {
17
        $this->index = new IndexPage($I);
18
    }
19
20
    public function ensureIndexPageWorks(Seller $I): void
21
    {
22
        $I->login();
23
        $I->needPage(Url::to('@ticket/index'));
24
        $I->see('Tickets', 'h1');
25
        $I->seeLink('Create ticket', Url::to('@ticket/create'));
26
        $this->ensureICanSeeAdvancedSearchBox($I);
27
        $this->ensureICanSeeBulkSearchBox();
28
    }
29
30
    private function ensureICanSeeAdvancedSearchBox(Seller $I): void
31
    {
32
        $this->index->containsFilters([
33
            Input::asAdvancedSearch($I, 'Subject or 1st message'),
34
            Select2::asAdvancedSearch($I, 'Author'),
35
            Select2::asAdvancedSearch($I, 'Recipient'),
36
            Select2::asAdvancedSearch($I, 'Status'),
37
            Select2::asAdvancedSearch($I, 'Assignee'),
38
            Select2::asAdvancedSearch($I, 'Priority'),
39
            Select2::asAdvancedSearch($I, 'Watchers'),
40
            Select2::asAdvancedSearch($I, 'Topics'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeBulkSearchBox(): void
45
    {
46
        $this->index->containsBulkButtons([
47
            'Subscribe',
48
            'Unsubscribe',
49
            'Close',
50
        ]);
51
        $this->index->containsColumns([
52
            'Subject',
53
            'Author',
54
            'Assignee',
55
            'Recipient',
56
            'Answers',
57
        ]);
58
    }
59
}
60