Completed
Push — master ( 910aee...a67276 )
by Dmitry
03:24
created

Index::ensurePageWorks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace hipanel\modules\ticket\tests\_support\Page\ticket;
4
5
use hipanel\tests\_support\Page\Authenticated;
6
use yii\helpers\Url;
7
8
/**
9
 * Class Index
10
 *
11
 * @author Dmytro Naumenko <[email protected]>
12
 */
13
class Index extends Authenticated
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 hasntLinkToTicket($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->dontSeeElement('tr', ['data-key' => $id]);
59
60
        return $this;
61
    }
62
}
63