Completed
Pull Request — master (#50)
by
unknown
14:10
created

HidePaymentNotificationCest::_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\ticket\tests\acceptance\seller;
4
5
use hipanel\helpers\Url;
6
use hipanel\tests\_support\Step\Acceptance\Seller;
7
use hipanel\tests\_support\Page\IndexPage;
8
9
class HidePaymentNotificationCest
10
{
11
    /**
12
     * @var IndexPage
13
     */
14
    private $index;
15
16
    public function _before(Seller $I)
17
    {
18
        $this->index = new IndexPage($I);
19
    }
20
21
    public function enusreICanHidePaymentNotification(Seller $I)
22
    {
23
        $I->login();
24
        $I->needPage(Url::to('@ticket/index'));
25
        $this->setFilters($I);
26
        $I->click('Search');
27
        $I->waitForPageUpdate();
28
        $this->ensureICantSeePaymentTickets($I);
29
    }
30
31
    private function setFilters(Seller $I): void
32
    {
33
        $I->checkOption('#threadsearch-hide_payment');
34
    }
35
36
    private function ensureICantSeePaymentTickets(Seller $I)
37
    {
38
        $rowCount = $this->index->countRowsInTableBody();
39
        for ($currentRow = 1; $currentRow < $rowCount; $currentRow++) {
40
            $I->dontSee('Payment', "//tbody//tr[$currentRow]//li//span");
41
        }
42
    }
43
}
44