Completed
Push — master ( d10807...397667 )
by Dmitry
04:55
created

TemplateCest::ensureICanSeeBulkSearchBox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.9
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 View Code Duplication
class TemplateCest
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('@ticket/template'));
27
        $I->see('Answer templates', 'h1');
28
        $I->seeLink('Create template', Url::to('create'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeBulkSearchBox();
31
    }
32
33
    private function ensureICanSeeAdvancedSearchBox()
34
    {
35
        $this->index->containsFilters([
36
            new Input('Name'),
37
            new Select2('Author'),
38
        ]);
39
    }
40
41
    private function ensureICanSeeBulkSearchBox()
42
    {
43
        $this->index->containsBulkButtons([
44
            'Delete',
45
        ]);
46
        $this->index->containsColumns([
47
            'Author',
48
            'Name',
49
            'Is published',
50
        ]);
51
    }
52
}
53