Completed
Push — master ( ead01b...7a01b6 )
by
unknown
10:37
created

Index::ensureTicketClosed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace hipanel\modules\ticket\tests\_support\Page\ticket;
4
5
use hipanel\tests\_support\Page\IndexPage;
6
use yii\helpers\Url;
7
8
/**
9
 * Class Index
10
 *
11
 * @author Dmytro Naumenko <[email protected]>
12
 */
13
class Index extends IndexPage
14
{
15
    public function ensurePageWorks()
16
    {
17
        $I = $this->tester;
18
        $I->amOnPage(Url::to(['@ticket']));
19
20
        $I->performOnContent(\Codeception\Util\ActionSequence::build()
21
            ->see('Create ticket')
22
        );
23
24
        return $this;
25
    }
26
27
    public function ensureThatICanNavigateToCreateTicketPage()
28
    {
29
        $I = $this->tester;
30
31
        $I->amOnPage(Url::to(['@ticket']));
32
33
        $I->click('Create ticket', '.content-wrapper');
34
35
        $I->waitForElement('#create-thread-form');
36
        $I->see('Topics');
37
        $I->see('Subject');
38
        $I->see('Create ticket', 'button');
39
40
        return $this;
41
    }
42
43 View Code Duplication
    public function hasLinkToTicket($id)
0 ignored issues
show
Duplication introduced by
This method 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...
44
    {
45
        $I = $this->tester;
46
47
        $I->amOnPage(Url::to(['@ticket']));
48
        $I->seeElement('tr', ['data-key' => $id]);
49
50
        return $this;
51
    }
52
53 View Code Duplication
    public function ensureTicketClosed($id)
0 ignored issues
show
Duplication introduced by
This method 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...
54
    {
55
        $I = $this->tester;
56
57
        $I->amOnPage(Url::to(['@ticket']));
58
        $I->seeElement("//tr[@data-key='$id']/td/span/span[contains(text(), 'Closed')]");
59
60
        return $this;
61
    }
62
}
63