Drupal investigation

ContactCest.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use yii\helpers\Url as 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. }