added loadEnv to unit test and removed bootstrap code + added basic acceptance test for form widget (had to increase the wait value oh web driver to bypass JS animations delay)

This commit is contained in:
Jonathan Labreuille
2015-07-28 11:40:31 +02:00
parent 5e98806f8b
commit ffbc54ffb7
5 changed files with 15 additions and 13 deletions

View File

@@ -23,6 +23,7 @@ class RoboFile extends \Robo\Tasks {
}
function testUnit() {
$this->loadEnv();
$this->_exec('vendor/bin/codecept run unit');
}

View File

@@ -1,4 +1,4 @@
<?php //[STAMP] b7decc66e5ef5eaba3d375be7320376b
<?php //[STAMP] 12e9de7bcc1022c6da0faca845309ecc
namespace _generated;
// This class was automatically generated by build task

View File

@@ -10,6 +10,6 @@ modules:
- WebDriver:
url: 'http://localhost'
browser: phantomjs
wait: 1
wait: 2
restart: true
- \Helper\Acceptance

View File

@@ -1,21 +1,25 @@
<?php
use \AcceptanceTester;
class FormWidgetCest
{
public function _before(AcceptanceTester $I)
{
class FormWidgetCest {
public function _before(AcceptanceTester $I) {
$I->login();
}
public function _after(AcceptanceTester $I)
{
public function _after(AcceptanceTester $I) {
}
// tests
public function itHasAWidget(AcceptanceTester $I)
{
public function iCanAddAWidget(AcceptanceTester $I) {
$I->amOnPage('/wp-admin/widgets.php');
$I->see('MailPoet Subscription Form');
$I->click('.ui-draggable[id*="mailpoet_form"] h4');
$I->click('Add Widget');
$I->seeElement('#widgets-right .widget[id*="mailpoet_form"]');
$I->click('Delete', '#widgets-right .widget[id*="mailpoet_form"]');
}
}

View File

@@ -1,7 +1,4 @@
<?php
$dotenv = new Dotenv\Dotenv(dirname(dirname(__DIR__)));
$dotenv->load();
$wordpress_path = getenv('WP_TEST_PATH');
if($wordpress_path) {