Passed
Pull Request — master (#5)
by
unknown
14:27
created

ContactCest::_before()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
use yii\helpers\Url;
4
5
class ContactCest
6
{
7
    public function _before(\AcceptanceTester $I)
8
    {
9
        $I->amOnPage(Url::toRoute('/site/contact'));
10
    }
11
    
12
    public function contactPageWorks(AcceptanceTester $I)
13
    {
14
        $I->wantTo('ensure that contact page works');
15
        $I->see('Contact', 'h1');
16
    }
17
18
    public function contactFormCanBeSubmitted(AcceptanceTester $I)
19
    {
20
        $I->amGoingTo('submit contact form with correct data');
21
        $I->fillField('#contactform-name', 'tester');
22
        $I->fillField('#contactform-email', '[email protected]');
23
        $I->fillField('#contactform-subject', 'test subject');
24
        $I->fillField('#contactform-body', 'test content');
25
        $I->fillField('#contactform-verifycode', 'testme');
26
27
        $I->click('contact-button');
28
        
29
        $I->wait(2); // wait for button to be clicked
30
31
        $I->dontSeeElement('#contact-form');
32
        $I->see('Thank you for contacting us. We will respond to you as soon as possible.');
33
    }
34
}
35