diff --git a/RoboFile.php b/RoboFile.php index 7ce02a5a8f..5a366c2065 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -382,6 +382,15 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop']) ->stopOnFail(); $this->taskCodecept($pathToCodeception) + ->arg('--steps') + ->arg('--debug') + ->arg('--fail-fast') + ->arg('--env ' . $opts['env']) + ->arg($this->testsPath . 'acceptance/modules.feature') + ->run() + ->stopOnFail(); + + $this->taskCodecept($pathToCodeception) ->arg('--steps') ->arg('--debug') ->arg('--fail-fast') diff --git a/tests/codeception/_support/AcceptanceHelper.php b/tests/codeception/_support/AcceptanceHelper.php deleted file mode 100644 index 4a2a49b1f5..0000000000 --- a/tests/codeception/_support/AcceptanceHelper.php +++ /dev/null @@ -1,43 +0,0 @@ -prefix = (isset($this->config['prefix'])) ? $this->config['prefix'] : ''; + + return parent::_initialize(); + } + + /** + * Inserts an SQL record into a database. This record will be erased after the test. + * + * @param string $table + * @param array $data + * + * @return integer $id The last insert id + */ + public function haveInDatabase($table, array $data) + { + $table = $this->addPrefix($table); + + return parent::haveInDatabase($table, $data); + } + + /** + * See an entry in the database + * + * @param string $table + * @param array $criteria + */ + public function seeInDatabase($table, $criteria = []) + { + $table = $this->addPrefix($table); + + parent::seeInDatabase($table, $criteria); + } + + /** + * @param string $table + * @param array $criteria + */ + public function dontSeeInDatabase($table, $criteria = []) + { + $table = $this->addPrefix($table); + + parent::dontSeeInDatabase($table, $criteria); + } + + /** + * Grab an entry from the database + * + * @param $table + * @param $column + * @param null $criteria + * + * @return mixed + */ + public function grabFromDatabase($table, $column, $criteria = null) + { + $table = $this->addPrefix($table); + + return parent::grabFromDatabase($table, $column, $criteria); + } + + /** + * Asserts that the given number of records were found in the database. + * + * @param int $expectedNumber Expected number + * @param string $table Table name + * @param array $criteria Search criteria [Optional] + */ + public function seeNumRecords($expectedNumber, $table, array $criteria = []) + { + $table = $this->addPrefix($table); + + parent::seeNumRecords($expectedNumber, $table, $criteria); + } + + /** + * Returns the number of rows in a database + * + * @param string $table Table name + * @param array $criteria Search criteria [Optional] + * + * @return int + */ + public function grabNumRecords($table, array $criteria = []) + { + $table = $this->addPrefix($table); + + return parent::grabNumRecords($table, $criteria); + } + + /** + * Add the table prefix + * + * @param $table string + * + * @return string + */ + protected function addPrefix($table) + { + return $this->prefix . $table; + } +} diff --git a/tests/codeception/_support/Page/Acceptance/Administrator/AdminPage.php b/tests/codeception/_support/Page/Acceptance/Administrator/AdminPage.php index f67b37c480..e4c6856355 100644 --- a/tests/codeception/_support/Page/Acceptance/Administrator/AdminPage.php +++ b/tests/codeception/_support/Page/Acceptance/Administrator/AdminPage.php @@ -85,7 +85,7 @@ class AdminPage extends \AcceptanceTester /** * Method to search using given keyword * - * @param string $keyword The keyword to search + * @param string $keyword The keyword to search * * @since __DEPLOY_VERSION__ * @@ -101,9 +101,15 @@ public function search($keyword) } /** - * Method to search user with username + * Method to search item with name or title + * We put the delay before the checkAllResults() because otherwise it + * does not work inside the module manager * - * @param string $keyword The username of user +<<<<<<< HEAD + * @param string $keyword The username of user +======= + * @param string $keyword The name or title of an item +>>>>>>> 79876ad644284175a8ea098542aef54bc74188d5 * * @since __DEPLOY_VERSION__ * @@ -115,6 +121,7 @@ public function haveItemUsingSearch($keyword) $I->amOnPage(static::$url); $I->search($keyword); + $I->wait(1); $I->checkAllResults(); $I->wait(1); } @@ -122,8 +129,8 @@ public function haveItemUsingSearch($keyword) /** * Method is used to see system message after waiting for page title. * - * @param string $title The webpage title - * @param string $message The unpublish successful message + * @param string $title The webpage title + * @param string $message The unpublish successful message * * @since __DEPLOY_VERSION__ * @@ -140,7 +147,7 @@ public function seeSystemMessage($title, $message) /** * Method is to Wait for page title until default timeout. * - * @param string $title Page Title text + * @param string $title Page Title text * * @since __DEPLOY_VERSION__ * @@ -155,7 +162,7 @@ public function waitForPageTitle($title) /** * Function to select Toolbar buttons in Joomla! Admin Toolbar Panel * - * @param string $button The full name of the button + * @param string $button The full name of the button * * @since __DEPLOY_VERSION__ * @@ -228,6 +235,12 @@ public function clickToolbarButton($button) case "featured": $I->click(['xpath' => "//div[@id='toolbar-featured']//button"]); break; + case "duplicate": + $I->click(['xpath' => "//div[@id='toolbar-copy']//button"]); + break; + case "check-in": + $I->click(['xpath' => "//div[@id='toolbar-checkin']//button"]); + break; } } @@ -251,8 +264,8 @@ public function checkAllResults() /** * Selects an option in a Chosen Selector based on its id * - * @param string $selectId The id of the element + * @param string $option The text in the