2016-07-14 19:19:59 +03:00
|
|
|
<?php
|
|
|
|
|
2017-09-12 17:29:58 +08:00
|
|
|
use yii\helpers\Url;
|
2016-07-16 04:13:51 +03:00
|
|
|
|
2016-07-14 19:19:59 +03:00
|
|
|
class ContactCest
|
|
|
|
{
|
|
|
|
public function _before(\AcceptanceTester $I)
|
|
|
|
{
|
2016-07-16 04:13:51 +03:00
|
|
|
$I->amOnPage(Url::toRoute('/site/contact'));
|
2016-07-14 19:19:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function contactPageWorks(AcceptanceTester $I)
|
|
|
|
{
|
|
|
|
$I->wantTo('ensure that contact page works');
|
|
|
|
$I->see('Contact', 'h1');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function contactFormCanBeSubmitted(AcceptanceTester $I)
|
|
|
|
{
|
|
|
|
$I->amGoingTo('submit contact form with correct data');
|
|
|
|
$I->fillField('#contactform-name', 'tester');
|
|
|
|
$I->fillField('#contactform-email', 'tester@example.com');
|
|
|
|
$I->fillField('#contactform-subject', 'test subject');
|
|
|
|
$I->fillField('#contactform-body', 'test content');
|
|
|
|
$I->fillField('#contactform-verifycode', 'testme');
|
|
|
|
|
|
|
|
$I->click('contact-button');
|
2016-07-16 04:13:51 +03:00
|
|
|
|
|
|
|
$I->wait(2); // wait for button to be clicked
|
2016-07-14 19:19:59 +03:00
|
|
|
|
|
|
|
$I->dontSeeElement('#contact-form');
|
|
|
|
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
|
|
|
|
}
|
|
|
|
}
|