codeception

Tricky “password” field in WordPress install script using CodeCeption

陌路散爱 提交于 2019-12-12 04:04:42
问题 I'm trying to use WordPress CodeCeption to run a script to install WordPress. I'm using PHPBrowser which is a headless browser. Here is my script: <?php $I = new AcceptanceTester($scenario); $I->wantTo('Setup WordPress'); $I->amOnPage("/wp-admin/setup-config.php?step=1"); $I->see("Below you should enter your database connection details."); $I->fillField('dbname', 'wordpress_unit_test'); $I->fillField('uname', 'wordpressuser'); $I->click('.button'); $I->click('.button'); $I->fillField('weblog

Call to undefined method AcceptanceTester::getModule

自古美人都是妖i 提交于 2019-12-12 03:37:51
问题 Here is my code - <?php class ClassiDescCest{ public function desc(AcceptanceTester $I){ $classifications = $this->getModule('WebDriver')->_findElements('/html/body/div[1]/div/section/div/div/div/div/div[2]/div[2]/div[1]/div/div/span/a/span'); echo $classifications.size(); } } Here is the error that I am getting - Error for undefined method 回答1: $this->getModule() can't be used in the Cest file, _findElements is a hidden method and can only be used in helpers as documented in http:/

codeception error after inserting laravel5 module

瘦欲@ 提交于 2019-12-12 03:36:24
问题 i have installed codeception globally. it works fine when i run codecept run functional command. when i insert laravel5 module into functional.suite.yml as per instruction from codeception website documentation, it gives me error like this. when i remove laravel5 module codecept run works normally. anyone knows how to tackle that error? should i install codeception locally instead of globally? Note : i don't use homestead/vagrant 回答1: This error doesn't seem to be related to Laravel5 module.

Codeception how to grab entities by values in array

我只是一个虾纸丫 提交于 2019-12-11 19:16:14
问题 I need to grab many entities by values in array. Method bellow: $arrayOfIds = [1,2,3,4,5]; $I->grabEntitiesFromRepository(Product::class, ['id' => $arrayOfIds]); Return: [Doctrine\DBAL\Exception\SyntaxErrorException] An exception occurred while executing 'SELECT p0_.id AS id_2, p0_.created_at AS created_at_3, p0_.updated_at AS updated_at_4 FROM product p0_ WHERE p0_.id = ?, ?, ?, ?, ?' with params [1, 2, 3, 4, 5]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in

PHPUnit 7.2 and Codeception 2.4 are incompatible

扶醉桌前 提交于 2019-12-11 19:13:58
问题 Trying to install CodeCeption with Laravel framework 5.6 I am getting this error. Steps i followed to install are 1. composer require codeception/codeception --dev 2. php ./vendor/bin/codecept bootstrap The error i am getting is Fatal error: Declaration of Codeception\Test\Unit::getDependencies() must be compatible with PHPUnit\Framework\TestCase::getDependencies(): array in /vendor/codeception/codeception/src/Codeception/Test/Unit.php on line 14 Can someone tell how to fix this or downgrade

Selenium with Webdriver - Switch to child window without name

♀尐吖头ヾ 提交于 2019-12-11 14:13:27
问题 I'm performing acceptance testing with webdriver and codeception. I'm a bit new to it, so please bear with me. I am trying to switch to a child window that is generated after clicking a button: <input class="submit_btn" type="button" onclick="openHAWin(this.form.purchase_clinic.value)" value="add" name="add_ha"> As there is no name for this page embedded in the code, nor on the target page itself, I attempted to use the following recommended code to switch to the child page: $I-

Class PhpStorm_Codeception_ReportPrinter does not exist

荒凉一梦 提交于 2019-12-11 14:07:53
问题 I am attempting to run Codeception functional tests within PhpStorm and keep receiving an error that says a class is missing. I've scoured the internet and found nothing available for this problem except for one post https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000646104-Running-codeCeption-test-runner-causes-excpetion?sort_by=created_at . Other posts talk about how to set the argument. I have both a phar of Codeception 2.4.1 and a composer install of it. It is using PHP

How can i use external class in Codeception?

早过忘川 提交于 2019-12-11 09:59:21
问题 i created an external class called StringHelper and i putted the require into the _bootstrap.php. I used it into my acceptance test and it didn't work: <?php class StringHelper { public static function getString($length) { return "Hello World"; } } _bootstrap.php require_once 'components/StringHelper.php'; My LoginCest.php <?php use \AcceptanceTester; class LoginCest { public function test01(AcceptanceTester $I) { $I->wantTo('Try to access without permission'); $I->amOnPage('#/list'); $I-

Symfony - CSRF token is invalid - FosRestBundle

最后都变了- 提交于 2019-12-11 05:15:00
问题 I'm using Symfony and FosRestBundle. When I want to simply test my rest api, I got this : The CSRF token is invalid. Please try to resubmit the form. /** * @example ["titre", "short description", "description", "2016-10-10", 200, "with complete data"] * @example ["titre", "short description", "description", "2016-10-31", 200, "with complete data"] */ public function editNewsTest(ApiTester $I, Example $example) { $I->wantTo('edit a news (' . $example[5] . ')'); $I->haveHttpHeader('Content-Type

Laravel 5.2 Codeception functional test issue with PUT / PATCH requests

流过昼夜 提交于 2019-12-11 01:47:12
问题 I have a problem on the update treatment processed into my functional tests on Codeception : I systematically have a 404 error. Here are the details. Everything is going well for every other simulated http requests but when codeception tries to execute the update method on a put HTTP request (POST request with a "_method" param having the value "PUT") is never executed by my controller, which lead codeception on the update url without the redirection that should happen after the treatment in