Completed
Push — master ( 7fa9e9...9a29d0 )
by Dmitry
08:27
created

BillCest::_before()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace hipanel\modules\finance\tests\acceptance\client;
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\Client;
10
11
class BillCest
12
{
13
    /**
14
     * @var IndexPage
15
     */
16
    private $index;
17
18
    public function _before(Client $I)
19
    {
20
        $this->index = new IndexPage($I);
21
    }
22
23
    public function ensureIndexPageWorks(Client $I)
24
    {
25
        $I->login();
26
        $I->needPage(Url::to('@bill/index'));
27
        $I->see('Bills', 'h1');
28
        $I->seeLink('Recharge account', Url::to('@pay/deposit'));
29
        $this->ensureICanSeeAdvancedSearchBox();
30
        $this->ensureICanSeeBulkBillSearchBox();
31
    }
32
33
    private function ensureICanSeeAdvancedSearchBox()
34
    {
35
        $this->index->containsFilters([
36
            new Input('Currency'),
37
            new Input('Type'),
38
            new Input('Servers'),
39
            new Input('Description'),
40
            new Select2('Tariff'),
41
        ]);
42
    }
43
44
    private function ensureICanSeeBulkBillSearchBox()
45
    {
46
        $this->index->containsColumns([
47
            'Time',
48
            'Sum',
49
            'Balance',
50
            'Type',
51
            'Description',
52
        ]);
53
    }
54
}
55