Esempio n. 1
0
<?php

use tests\pages\ContactPage;
$I = new WebLord($scenario);
$I->wantTo('ensure that contact works');
$contactPage = ContactPage::openBy($I);
$I->see('Contact', 'h1');
$I->amGoingTo('submit contact form with no data');
$contactPage->submit([]);
if (method_exists($I, 'wait')) {
    $I->wait(3);
    // only for selenium
}
$I->expectTo('see validations errors');
$I->see('Contact', 'h1');
$I->see('Name cannot be blank');
$I->see('Email cannot be blank');
$I->see('Subject cannot be blank');
$I->see('Body cannot be blank');
$I->see('The verification code is incorrect');
$I->amGoingTo('submit contact form with not correct email');
$contactPage->submit(['name' => 'Gandalf', 'email' => '@gandalf', 'subject' => 'You cannot pass', 'body' => 'I am a servant of the Secret Fire...', 'verifyCode' => 'mellon']);
if (method_exists($I, 'wait')) {
    $I->wait(3);
    // only for selenium
}
$I->expectTo('see that email adress is wrong');
$I->dontSee('Name cannot be blank', '.help-inline');
$I->see('Email is not a valid email address.');
$I->dontSee('Subject cannot be blank', '.help-inline');
$I->dontSee('Body cannot be blank', '.help-inline');
Esempio n. 2
0
<?php

$I = new WebLord($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('My Company');
$I->seeLink('About');
$I->click('About');
$I->see('This is the About page.');
Esempio n. 3
0
<?php

use tests\pages\AboutPage;
$I = new WebLord($scenario);
$I->wantTo('ensure that about works');
AboutPage::openBy($I);
$I->see('About', 'h1');