Acceptance tests.
This commit is contained in:
@ -62,6 +62,12 @@ https://github.com/Codeception/Verify
|
||||
$ vendor/bin/codecept run
|
||||
```
|
||||
|
||||
# Acceptance testing.
|
||||
|
||||
You just need phantomjs installed. Tests are in /tests/acceptance. You can run tests with:
|
||||
```
|
||||
$ vendor/bin/codecept run
|
||||
```
|
||||
|
||||
# Stylus command
|
||||
stylus -w assets/css/src/*.styl -o assets/css/
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,7 @@
|
||||
class_name: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser:
|
||||
url: http://localhost/myapp
|
||||
- \Helper\Acceptance
|
||||
- WebDriver:
|
||||
url: 'http://127.0.0.1:8888'
|
||||
browser: phantomjs
|
||||
- \Helper\Acceptance
|
||||
|
25
tests/acceptance/ActivationCest.php
Normal file
25
tests/acceptance/ActivationCest.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
use \AcceptanceTester;
|
||||
|
||||
class ActivationCest {
|
||||
|
||||
public function _before(AcceptanceTester $I) {
|
||||
$I->amOnPage('/wp-admin');
|
||||
$I->fillField('Username', 'admin');
|
||||
$I->fillField('Password', 'password');
|
||||
$I->click('Log In');
|
||||
$I->amOnPage('/wp-admin/plugins.php');
|
||||
}
|
||||
|
||||
public function i_can_activate(AcceptanceTester $I) {
|
||||
$I->see('MailPoet');
|
||||
$I->click('#mailpoet .activate a');
|
||||
$I->see('Plugin Activated');
|
||||
}
|
||||
|
||||
public function _after(AcceptanceTester $I) {
|
||||
$I->see('MailPoet');
|
||||
$I->click('#mailpoet .deactivate a');
|
||||
$I->see('Plugin deactivated');
|
||||
}
|
||||
}
|
16
tests/acceptance/HomePageCest.php
Normal file
16
tests/acceptance/HomePageCest.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
use \AcceptanceTester;
|
||||
|
||||
class HomePageCest {
|
||||
|
||||
public function _before(AcceptanceTester $I) {
|
||||
}
|
||||
|
||||
public function it_has_a_title(AcceptanceTester $I) {
|
||||
$I->amOnPage('/');
|
||||
$I->see('Hello');
|
||||
}
|
||||
|
||||
public function _after(AcceptanceTester $I) {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user