问题描述
在PHPStorm中设置项目时,我遵循了Wiki中的Codeception和常规PHP指令。在一天之内,它与./vendor/bin/codecept run
和docker-compose run --rm codecept run ui_automation --env staging --debug
都可以完美工作。现在,当我运行相同的项目时,它将尝试第一个测试,并且仅挂在这部分:
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
我的环境是这样的:
- PHP 7.4.12
- Mac OS Catalina 10.15.6
- Composer 2.0.5
- Codecept 4.1.11
- Docker 19.03.13
当我尝试使用docker命令运行它时,出现此错误。我最初也是通过上述命令遇到此错误,但现在我只是通过docker命令获取该错误:
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.
当这个问题突然出现时,我除了添加定位器外没有做任何其他事情。另外,我曾经通过VNCView窗口验证流程,并且在那里看到我的项目正在启动Chrome,但没有转到任何页面。
https://github.com/Codeception/Codeception/issues/5495关于错误中的重定向行说,“此重定向是有原因的-当在供应商目录和外部位置中安装了不同版本的Codeception或依赖项时,它可以防止出现奇怪的错误。从一个地方到另一个-从另一个地方。”但是,它没有提供解决方法的提示。
最初,我遵循两组指令,我可能已经设置了两次作曲器(一次使用wget,一次使用自制程序),并尝试从该角度进行修复。我还当天完成了整个Mac的设置,因此我可能下载了某种程度上有冲突的其他内容。
我尝试了以下操作:
- 同时使用PHPStorm和VSCode,两个IDE都显示相同的行为
- 运行./vendor/bin/codecept clean和.vendor / bin / codecept build
- 使用“ composer update”命令更新
- 重新启动计算机IDEs
- 已按照以下说明删除了作曲家:Remove composer
- 仅使用自制软件重新安装作曲家
- 根据以下说明卸载并重新安装docker:https://nektony.com/how-to/uninstall-docker-on-mac
- 在我的composer.json中添加了
codeception/verify
和codeception/specify
- 确保页面应访问的URL仍在Web驱动程序URL下的yaml文件中。
- 在IntelliJ的“编辑配置”页面中删除了“无CLI解释器”,因此重新添加了该名称,并将PHP 7.4设置为Interpreter。这是使用可执行文件
/usr/local/Cellar/PHP/7.4.12/bin/PHP
- 查看了偏好设置和模块设置,没有发现任何奇怪的地方
- 以冗长模式(-vvv)运行ran并没有得到提示
- 删除我的整个git repo,然后重新导入
- Ran作曲家表演,看到了许多编解码包
- 自动加载转储
- Ran工具> Composer>进行常规和详细诊断,然后返回:“ Composer诊断了./composer.json中的某些问题。但这并没有告诉我这些问题是什么,并且composer.json中没有亮起或显示红色
- 删除整个供应商文件夹,然后重新安装作曲家
我现在注意到最后一步之后composer.phar是红色的!我已经尝试过重复上述步骤,但是它仍然是红色的。
现在,我想让我的项目通过常规的./vendor/bin/codecept run
公元前工作,我有SRE来帮助处理Docker,尽管我很高兴直接跳过Docker的工作,因为这就是他们的方式希望我们运行它。
我的composer.json(没有指定,请验证故障排除步骤):
{
"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"
}
}
}
我将composer更新到4.1.11,并验证./vendor/bin/codecept run -V与composer.json中的版本匹配 composer -V表示它的版本为Composer 2.0.5
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.
我对PHP设置或Codeception不太了解,这是我的第一个项目。这个程序可以在质量检查人员以外的其他所有人的机器上运行!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)