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:
@@ -23,6 +23,7 @@ class RoboFile extends \Robo\Tasks {
|
||||
}
|
||||
|
||||
function testUnit() {
|
||||
$this->loadEnv();
|
||||
$this->_exec('vendor/bin/codecept run unit');
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] b7decc66e5ef5eaba3d375be7320376b
|
||||
<?php //[STAMP] 12e9de7bcc1022c6da0faca845309ecc
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
|
@@ -10,6 +10,6 @@ modules:
|
||||
- WebDriver:
|
||||
url: 'http://localhost'
|
||||
browser: phantomjs
|
||||
wait: 1
|
||||
wait: 2
|
||||
restart: true
|
||||
- \Helper\Acceptance
|
||||
|
@@ -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"]');
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,4 @@
|
||||
<?php
|
||||
$dotenv = new Dotenv\Dotenv(dirname(dirname(__DIR__)));
|
||||
$dotenv->load();
|
||||
|
||||
$wordpress_path = getenv('WP_TEST_PATH');
|
||||
|
||||
if($wordpress_path) {
|
||||
|
Reference in New Issue
Block a user