I followed both the Codeception and general PHP instructions in our wiki when I set up my project in PhpStorm. It worked perfectly with both the ./vendor/bin/codecept run
and docker-compose run --rm codecept run ui_automation --env staging --debug
for over a day. Now, when I run the same project, it attempts the first test and just hangs at this part:
julie@Julies-MacBook-Pro qa-tests % ./vendor/bin/codecept run
Codeception PHP Testing Framework v4.1.9
Powered by PHPUnit 9.4.2 by Sebastian Bergmann and contributors.
Running with seed:
Ui_automation Tests (2) --------------------------------------------------------------------
------------------------------------------------------------------------
- LoginCest: Test login
My environment is as such:
- php 7.4.12
- Mac OS Catalina 10.15.6
- Composer 2.0.5
- Codecept 4.1.11
- Docker 19.03.13
And when I try to run it with the docker command I get this error. I was originally getting this error with the above command too but now I'm just getting it for the docker command:
julie@Julies-MacBook-Pro qa-tests % docker-compose run --rm codecept run ui_automation --
env staging --debug
Starting qa-end-to-end-tests_db_1 ... done
Creating qa-end-to-end-tests_codecept_run ... done
==== Redirecting to Composer-installed version in vendor/codeception. You can skip this
using --no-redirect ====
Command "run " is not defined.
I wasn't doing anything other than adding locators when this problem suddenly appeared. Also I used to verify the flow through a VNCView window and I can see there that my project is pulling up Chrome but not going to any page.
https://github.com/Codeception/Codeception/issues/5495 says about the redirect line in the error, "This redirect is here for a reason - it prevents odd errors when different versions of Codeception or dependencies are installed in vendor dir and external locations and some classes are loaded from one place and some - from another." But, it doesn't give tips on how to resolve this.
I initially was following two sets of instructions, I may have set up composer twice (once with wget and once with homebrew) and tried fixing from that angle. I also was setting up my mac in it's entirety the same day so it's possible I downloaded something else that is somehow conflicting.
I have tried the following:
- Using both PhpStorm and VSCode, both IDEs display the same behavior
- Running ./vendor/bin/codecept clean and .vendor/bin/codecept build
- Updating with "composer update" command
- restarting IDEs, computer
- Deleted composer according to these instructions: Remove composer
- Re-installed composer with homebrew only
- Uninstalled and reinstalled docker according to these instructions: https://nektony.com/how-to/uninstall-docker-on-mac
- Added
codeception/verify
andcodeception/specify
to my composer.json - Made sure the URL the page is supposed to go to is still in my yaml file under Webdriver, URL
- Noticed a "No CLI interpreter" in my Edit Configuration page in IntelliJ so re-added that and set PHP 7.4 to Interpreter). This was using the executable
/usr/local/Cellar/php/7.4.12/bin/php
- Looked in preferences and module settings, didn't see anything weird
- Ran in verbose mode (-vvv) didn't get hints from that
- Blew out my whole git repo and re-imported it
- Ran composer show, saw many codeception packages
- Ran autoload dump
- Ran Tools > Composer > Diagnose in both regular and verbose and got back "Composer diagnosed some issues in ./composer.json." but it doesn't tell me what those issues are and there is nothing lit up or red in composer.json
- Deleted the whole vendor folder and reinstalled composer
I now notice after the last step composer.phar is red! I have tried repeating the steps above but it is still red.
Right now I'd just like to get my project working through the regular ./vendor/bin/codecept run
bc I have SREs to help with the Docker stuff, although I'd be happy to skip straight to docker working as that's how they'd like us to run it.
My composer.json (without the specify, verify troubleshooting step):
{
"require-dev": {
"codeception/robo-paracept": "^0.4.2",
"codeception/codeception": "^4.1",
"codeception/module-phpbrowser": "^1.0.0",
"codeception/module-asserts": "^1.0.0",
"codeception/module-webdriver": "^1.1",
"codeception/verify": "2.1.0",
"codeception/specify": "1.4.0",
"phpunit/phpunit": "^9.4"
},
"require": {
"ext-zip": "^1.15",
"codeception/specify": "*",
"codeception/verify": "*"
},
"autoload": {
"psr-4": {
"Tests\\Support\\": "tests/_support",
"UiAutomationTester\\": "tests/_support/UiAutomation.php"
}
}
}
I updated composer to 4.1.11 and verified that ./vendor/bin/codecept run -V matched the version in composer.json composer -V says it's at Composer version 2.0.5
Results of composer-show:
codeception/lib-asserts 1.13.2 Assertion methods used by
Codeception core and Asserts module
codeception/lib-innerbrowser 1.3.4 Parent library for all Codeception framework modules and PhpBrowser
codeception/module-asserts 1.3.1 Codeception module containing various assertions
codeception/module-phpbrowser 1.0.2 Codeception module for testing web application over HTTP
codeception/module-webdriver 1.1.3 WebDriver module for Codeception
codeception/phpunit-wrapper 9.0.5 PHPUnit classes used by Codeception
codeception/robo-paracept 0.4.2 Codeception Parallel Execution Tasks via Robo Task Runner
codeception/stub 3.7.0 Flexible Stub wrapper for PHPUnit's Mock Builder
consolidation/annotated-command 4.2.3 Initialize Symfony Console commands from annotated command class methods.
consolidation/config 1.2.1 Provide configuration services for a commandline tool.
consolidation/log 2.0.1 Improved Psr-3 / Psr\Log logger based on Symfony Console components.
consolidation/output-formatters 4.1.1 Format text by applying transformations provided by plug-in formatters.
consolidation/robo 1.4.13 Modern task runner
consolidation/self-update 1.2.0 Provides a self:update command for Symfony Console applications.
container-interop/container-interop 1.2.0 Promoting the interoperability of container objects (DIC, SL, etc.)
dflydev/dot-access-data v1.1.0 Given a deep data structure, access data by dot notation.
doctrine/instantiator 1.3.1 A small, lightweight utility to instantiate objects in PHP without invoking their constr...
grasmash/expander 1.0.0 Expands internal property references in PHP arrays file.
grasmash/yaml-expander 1.4.0 Expands internal property references in a yaml file.
guzzlehttp/guzzle 7.2.0 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.4.0 Guzzle promises library
guzzlehttp/psr7 1.7.0 PSR-7 message implementation that also provides common utility methods
league/container 2.4.1 A fast and intuitive dependency injection container.
monolog/monolog 2.1.1 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy 1.10.1 Create deep copies (clones) of your objects
nikic/php-parser v4.10.2 A PHP parser written in PHP
phar-io/manifest 2.0.1 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 3.0.2 Library for handling version information and constraints
php-webdriver/webdriver 1.8.3 A PHP client for Selenium WebDriver. Previously facebook/webdriver.
phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 5.2.2 With this component, a library can provide support for annotations via DocBlocks or othe...
phpdocumentor/type-resolver 1.4.0 A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy 1.12.1 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 9.2.3 Library that provides collection, processing, and rendering functionality for PHP code c...
phpunit/php-file-iterator 3.0.5 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker 3.1.1 Invoke callables with a timeout
phpunit/php-text-template 2.0.4 Simple template engine.
phpunit/php-timer 5.0.3 Utility class for timing
phpunit/phpunit 9.4.2 The PHP Unit Testing framework.
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-client 1.0.1 Common interface for HTTP clients
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.1.3 Common interface for logging libraries
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
sebastian/cli-parser 1.0.1 Library for parsing CLI options
sebastian/code-unit 1.0.8 Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 2.0.3 Looks up which function or method a line of code belongs to
sebastian/comparator 4.0.6 Provides the functionality to compare PHP values for equality
sebastian/complexity 2.0.2 Library for calculating the complexity of PHP code units
sebastian/diff 4.0.4 Diff implementation
sebastian/environment 5.1.3 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 4.0.3 Provides the functionality to export PHP variables for visualization
sebastian/global-state 5.0.2 Snapshotting of global state
sebastian/lines-of-code 1.0.2 Library for counting the lines of code in PHP source code
sebastian/object-enumerator 4.0.4 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 2.0.4 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 4.0.4 Provides functionality to recursively process PHP variables
sebastian/resource-operations 3.0.3 Provides a list of PHP built-in functions that operate on resources
sebastian/type 2.3.1 Collection of value objects that represent the types of the PHP type system
sebastian/version 3.0.2 Library that helps with managing the version number of Git-hosted PHP projects
symfony/browser-kit v5.1.8 Symfony BrowserKit Component
symfony/console v4.4.16 Symfony Console Component
symfony/css-selector v5.1.8 Symfony CssSelector Component
symfony/dom-crawler v5.1.8 Symfony DomCrawler Component
symfony/event-dispatcher v4.4.16 Symfony EventDispatcher Component
symfony/event-dispatcher-contracts v1.1.9 Generic abstractions related to dispatching event
symfony/filesystem v4.4.16 Symfony Filesystem Component
symfony/finder v5.1.8 Symfony Finder Component
symfony/polyfill-ctype v1.20.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.20.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php73 v1.20.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80 v1.20.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process v4.4.16 Symfony Process Component
symfony/service-contracts v2.2.0 Generic abstractions related to writing services
symfony/yaml v4.4.16 Symfony Yaml Component
theseer/tokenizer 1.2.0 A small library for converting tokenized PHP source code into XML and potentially other ...
webmozart/assert 1.9.1 Assertions to validate method input/output with nice error messages.
I don't know much about PHP set up or Codeception, this is my first project in either. This is running on everyone else's machine in QA except mine!