Passed
Branch update-yii-dataview (d90e66)
by Wilmer
13:07
created

ContactPageCest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A _before() 0 3 1
A contactPageWorks() 0 4 1
A contactFormCanBeSubmitted() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Acceptance;
6
7
use App\Tests\AcceptanceTester;
8
9
final class ContactPageCest
10
{
11
    public function _before(AcceptanceTester $I)
12
    {
13
        $I->amOnPage('/contact');
14
    }
15
16
    public function contactPageWorks(AcceptanceTester $I)
17
    {
18
        $I->wantTo('ensure that contact page works');
19
        $I->seeElement('button', ['name' => 'contact-button']);
20
    }
21
22
    public function contactFormCanBeSubmitted(AcceptanceTester $I)
23
    {
24
        $I->amGoingTo('submit contact form with correct data');
25
        $I->fillField('#contactform-name', 'tester');
26
        $I->fillField('#contactform-email', '[email protected]');
27
        $I->fillField('#contactform-subject', 'test subject');
28
        $I->fillField('#contactform-body', 'test content');
29
30
        $I->click('Submit');
31
32
        $I->see("Thank you for contacting us, we'll get in touch with you as soon as possible.");
33
    }
34
}
35