codeception

Laravel 5 / Codeception not routing correctly

为君一笑 提交于 2019-12-08 15:04:20
问题 I'm trying to write an API test case for a controller function using codeception, and I'm hitting an issue where the route to the controller function does not appear to be evaluated correctly, and the evaluation seems to be different depending on what I have in my test case. Here is a code sample from my test case: use \ApiTester; class CustomerRegisterCest { // tests public function testGetRegister(ApiTester $I) { $I->sendGET('register'); $I->seeResponseCodeIs(200); } public function

Working with codeception and laravel

£可爱£侵袭症+ 提交于 2019-12-08 08:41:04
问题 I'm struggling a bit with codeception right now. I work on a laravel 4 project. From now on we used PhpUnit to uni test normally but we have too much Javascript in our pages to do acceptance tests with a simple DomCrawler it's a non sense. First i installed selenium + chrome on a vagrant VM. Took me some times but i managed to get it to work, meaning i can browse the Webdriver webpage (/wd/hub) then create a new session using chrome with success. Next i installed codeception via composer I

Installing Codeception over Composer to Yii2

淺唱寂寞╮ 提交于 2019-12-07 12:08:33
问题 I have problem with installation Codeception to my Yii2 project. 1) Downloaded composer to the Yii2 project: curl -sS https://getcomposer.org/installer | php 2) Trying install Codeception: php composer.phar require "codeception/codeception:*" Error: Your requirements could not be resolved to an installable set of packages. Problem 1 - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*

Select an option in a dynamic select with codeception?

倾然丶 夕夏残阳落幕 提交于 2019-12-06 18:35:18
问题 <select> <option value=''>-- Select an Option --</option> @foreach ($options as $option) <option value='{{ $option->value }}'>{{ $option->name }}</option> @endforeach </select> Select the first dynamic option 回答1: $option = $I->grabTextFrom('select option:nth-child(2)'); $I->selectOption("select", $option); $I->click("Submit"); 回答2: I've run into the same issue quite often when starting out with Codeception. Using the recommended answer, I created a helper function in my AcceptanceTester

Working with codeception and laravel

こ雲淡風輕ζ 提交于 2019-12-06 14:48:38
I'm struggling a bit with codeception right now. I work on a laravel 4 project. From now on we used PhpUnit to uni test normally but we have too much Javascript in our pages to do acceptance tests with a simple DomCrawler it's a non sense. First i installed selenium + chrome on a vagrant VM. Took me some times but i managed to get it to work, meaning i can browse the Webdriver webpage (/wd/hub) then create a new session using chrome with success. Next i installed codeception via composer I did codecept bootstrap I added Laravel4 as a module to acceptance.suite.yml class_name: AcceptanceTester

Switch IFrame with Codeception using ID

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 04:44:52
How can I switch to an IFrame with Codeception using ID? Actually I can use the name of the IFrame but not the ID -> Codeception SwitchToIFrame IFrame Example: <iframe id="iframeToolbar" src="link" frameborder="0" style="position: fixed; left: 0px; top: 0px; z-index: 998; width: 940px;" scrolling="no" width="100px" height="100%"></iframe> Codeception Example: <?php # switch to iframe $I->switchToIFrame("another_frame"); # switch to parent page $I->switchToIFrame(); Is it maybe a Codeception <-> Facebook Webdriver Connection Problem? EDIT: I reinstalled Codeception, followed the Quick Step

Laravel and Codeception - test fails on PUT forms

拈花ヽ惹草 提交于 2019-12-06 04:06:08
I have a resource controller in laravel to manage my users. This creates a route to update users info that takes a request with HTTP PUT method. This shows artisan route:list command output: +--------+--------------------------------+-----------------------------------------------------------+--------------------------------------+--------------------------------------------------------------------------------+------------+ | Domain | Method | URI | Name | Action | Middleware | +--------+--------------------------------+-----------------------------------------------------------+--------------

for each element with behat or codeception

爱⌒轻易说出口 提交于 2019-12-06 03:17:42
问题 I want to test a website which has a dynamic menustructure. I want to loop through all menuitems and run the same series of test on every page. We're talking about 100+ pages that change reguraly. I would like to do this with either behat or codeception. Does anybody have an idea about how to do this? 回答1: When using Behat with Mink, you can grab your menu items with findAll() and then iterate over it: /** * @When /^I run my test series for all menu items$/ */ public function

How to fill a rich text editor field for a Codeception Acceptance test

点点圈 提交于 2019-12-06 02:24:42
问题 I'm trying to fill a rich text editor field (TinyMCE) within my acceptance test in Codeception. Using the fillField() function doesn't work as this 'field' isn't really an input field. It's an iframe , styled to look like a fancy textarea. How can I set some text into the body of the TinyMCE box? I think I'm looking for the addition of a $I->setContent(xpathOrCSS) function. Or does something else already exist to do this? 回答1: It is best to do this by adding re-usable actions to your Actor

Installing Codeception over Composer to Yii2

不羁的心 提交于 2019-12-06 00:59:38
I have problem with installation Codeception to my Yii2 project. 1) Downloaded composer to the Yii2 project: curl -sS https://getcomposer.org/installer | php 2) Trying install Codeception: php composer.phar require "codeception/codeception:*" Error: Your requirements could not be resolved to an installable set of packages. Problem 1 - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - Installation request for yiisoft/yii2 == 2.0.2