You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1017 B

10 months ago
  1. <?php
  2. use yii\helpers\Url;
  3. class ContactCest
  4. {
  5. public function _before(\AcceptanceTester $I)
  6. {
  7. $I->amOnPage(Url::toRoute('/site/contact'));
  8. }
  9. public function contactPageWorks(AcceptanceTester $I)
  10. {
  11. $I->wantTo('ensure that contact page works');
  12. $I->see('Contact', 'h1');
  13. }
  14. public function contactFormCanBeSubmitted(AcceptanceTester $I)
  15. {
  16. $I->amGoingTo('submit contact form with correct data');
  17. $I->fillField('#contactform-name', 'tester');
  18. $I->fillField('#contactform-email', 'tester@example.com');
  19. $I->fillField('#contactform-subject', 'test subject');
  20. $I->fillField('#contactform-body', 'test content');
  21. $I->fillField('#contactform-verifycode', 'testme');
  22. $I->click('contact-button');
  23. $I->wait(2); // wait for button to be clicked
  24. $I->dontSeeElement('#contact-form');
  25. $I->see('Thank you for contacting us. We will respond to you as soon as possible.');
  26. }
  27. }