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

ContactCest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A contactPageWorks() 0 4 1
A contactFormCanBeSubmitted() 0 15 1
A _before() 0 3 1
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