ContactCest.php 965 B

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