codeception

Testing action with redirect gives uexpectable behavior in yii2

一个人想着一个人 提交于 2019-12-13 05:51:15
问题 I try to test my app with codeception, but all LoginCept.php breaks on this aciton class SiteController extends Controller { public function actionIndex() { $this->redirect('journal'); } } As I can see in the php-buildin-server's logs, after in-app redirect it comes to actual entry point index.php instead of index-test.php [Thu Jun 9 20:54:00 2016] 127.0.0.1:40472 [302]: /index-test.php/login [Thu Jun 9 20:54:00 2016] 127.0.0.1:40496 [302]: /index-test.php << in-app redirect [Thu Jun 9 20:54

error “[PHPUnit\Framework\Exception] Undefined index: ELEMENT” when running codeception with WebDriver

允我心安 提交于 2019-12-13 04:38:44
问题 I am trying to get codeceptions acceptance tests running with WebDriver. My current setup is the following: Arch Linux Chromium: Chromium 75.0.3770.80 Arch Linux The included chromedriver-version: ChromeDriver 75.0.3770.80 (9a9aa15057b6b2cc0909bdcf638c0b65ecd516f2-refs/branch-heads/3770@{#948}) Selenium Server: Selenium server version: 3.14.0, revision: aacccce0 I am executing selenium by running env webdriver.chrome.driver="chromedriver" java -jar /usr/share/selenium-server/selenium-server

PHPUnit_Framework_Exception when trying to run Codeception / Selenium with Internet Explorer 11 / IE11

落花浮王杯 提交于 2019-12-13 02:56:44
问题 When I try to run my Codeception tests with Internet Explorer 11, I get the following error: [PHPUnit_Framework_Exception] Undefined index: ELEMENT 回答1: This problem was resolved by re-starting Selenium with a passthru flag. java -jar selenium-server-standalone-3.5.3.jar -enablePassThrough false 来源: https://stackoverflow.com/questions/48799845/phpunit-framework-exception-when-trying-to-run-codeception-selenium-with-inter

Codeception URL regex

痞子三分冷 提交于 2019-12-13 02:18:12
问题 So the official documentation says absolutely nothing about the tilde sign ( ~ ) used in regexp patterns, for example as in the seeCurrentUrlMatches() function. Yet, it is used extensively in the documentation. In the exmample, the regexp looks like this: $I->seeCurrentUrlMatches('~$/users/(\d+)~'); Without the tilde sign, it gives an error. eg. grabFromCurrentUrl('(\d+)') returns: " (\d+)" Fail Nothing to grab. A regex parameter required. The end-of-string regexp operator's ( $ ) position

Codeception ignores CURLOPT_TIMEOUT

穿精又带淫゛_ 提交于 2019-12-13 01:19:31
问题 This is the content of the acceptance.suite.yml class_name: AcceptanceTester modules: enabled: - PhpBrowser: url: http://reoc.lo/ curl: CURLOPT_TIMEOUT: 50000 # timeout in seconds - \Helper\Acceptance I did this following this question: How to change codeception phpbrowser/mink timeout but it doesn't work for me as it skips this setting and it's timing out on 30 seconds which is the default. Are there any other settings to override default CURLOPT_TIMEOUT? 回答1: Alright, now to answer your

PhpStorm v2017.3.4 & Codeception v2.4.0 incompatibility

痴心易碎 提交于 2019-12-12 12:22:02
问题 I'm struggling to make codeception work with PhpStorm. I have setup CLI Interpreter: I have also setup Codeception: And here is the configuration of Codeception: And when I run the tests from PhpStorm I receive the following: On the left: and the text on the right: Testing started at 00:06 ... /Applications/MAMP/bin/php/php7.2.1/bin/php /private/var/folders/3g/xng_tnzj6797frqqk20r69mw0000gn/T/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi

Codeception PhpBrowser grabAttributeFrom throws Exception DOMDocument::loadXML()

末鹿安然 提交于 2019-12-12 05:17:51
问题 I updated my tests from Codeception 2.0.9 to 2.1.5. Everything works fine except the PhpBrowser::grabAttributeFrom() method. I'll get a PHPUnit exception like this: [PHPUnit_Framework_Exception] DOMDocument::loadXML(): Entity 'nbsp' not defined in Entity, line: 3 or [PHPUnit_Framework_Exception] DOMDocument::loadXML(): Opening and ending tag mismatch: img line 141 and a in Entity, line: 142 It seems, that the grabAttributeFrom is very strict with HTML-DOM parsing. I googled the message and

Codeception REST timeout issue

拈花ヽ惹草 提交于 2019-12-12 04:30:55
问题 I'm trying to increase the Codeception REST timeout, but it doesn't seem to be working. That's what I have class_name: ApiTester modules: enabled: - \Helper\Api: - REST: depends: PhpBrowser timeout: 90 Timeout error I'm getting [GuzzleHttp\Exception\ConnectException] cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received What am I doing wrong? 回答1: I had this problem too. This was my Fix in acceptance.suite.yml # Codeception Test Suite Configuration # suite for

Site Authentication webdriver codeception

人盡茶涼 提交于 2019-12-12 04:26:02
问题 I am writing some automation tests, and the site my test needs to connect to requires a site authentication. I'm not sure how to handle this pop-up in order to provide the username & password. If the dialogue box is closed then the site can not be reached .. e.g. unauthorised access. I have tried using passing the credentials through the url, but that doesn't work. Any suggestions appreciated. acceptance.suite.yml actor: AcceptanceTester modules: enabled: - WebDriver: browser: chrome url:

load fixture data for acceptance tests - Codeception

感情迁移 提交于 2019-12-12 04:08:43
问题 Hope Everyone is doing great. I have a problem. I need to get my fixtures loaded in db before running acceptance test in codception in my Yii2 Application. here is teh detail for it. Target : Load fixtures in database so that I can run acceptance tests on them. Problem : Despite of my a at most efforts, I am still I am unable to achieve this affect Here is the data that I got to share with you: common\modules\myCustomModule\tests\acceptance\models\DashboardCest ``` class ResumeDashboardCest {