- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试设置 Codeception 来对我的 Web 应用程序进行验收和功能测试。以下是我的文件:
docker-compose.yml
version: '3.7'
services:
# nginx - web server
nginx:
build:
context: ./docker-config/nginx
dockerfile: ./Dockerfile
env_file: &env
- ./cms/.env
init: true
ports:
- "8000:80"
volumes:
- cpresources:/var/www/project/cms/web/cpresources
- ./cms/web:/var/www/project/cms/web:cached
networks:
mmc-network:
aliases:
- mmc.nginx
# php - run php-fpm
php:
build: &php-build
context: ./docker-config/php-prod-craft
dockerfile: ./Dockerfile
depends_on:
- "mysql"
- "redis"
env_file:
*env
expose:
- "9000"
init: true
volumes: &php-volumes
- some volumes............
networks:
mmc-network:
aliases:
- mmc.php
# mysql - database
mysql:
build:
context: ./docker-config/mysql
dockerfile: ./Dockerfile
cap_add:
- SYS_NICE # CAP_SYS_NICE
env_file:
*env
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: project
MYSQL_USER: project
MYSQL_PASSWORD: project
init: true
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
- ./db-seed/:/docker-entrypoint-initdb.d
networks:
- MMC-network
# redis - key/value database for caching & php sessions
redis:
build:
context: ./docker-config/redis
dockerfile: ./Dockerfile
expose:
- "6379"
init: true
networks:
- mmc-network
# webpack - frontend build system
webpack:
build:
context: ./docker-config/node-dev-webpack
dockerfile: ./Dockerfile
env_file:
*env
init: true
ports:
- "8080:8080"
volumes:
- some volumes..........
networks:
- mmc-network
# selenium - web driver for codeception testing
selenium:
container_name: mmc-selenium
ports:
- "4444:4444"
volumes:
- ./cms:/data
build:
context: ./docker-config/selenium
dockerfile: ./Dockerfile
networks:
mmc-network:
aliases:
- mmc.selenium
volumes:
db-data:
cpresources:
storage:
networks:
mmc-network:
accept.suite.dist.yml:
actor: AcceptanceTester
extensions:
enabled:
- Codeception\Extension\RunFailed
- Codeception\Extension\Recorder
modules:
error_level: "E_ALL"
enabled:
- WebDriver:
url: 'http://mmc.nginx'
host: mmc.selenium
port: '4444'
window_size: 1920x1200
browser: 'chrome'
wait: 60
capabilities:
os: Windows
os_version: 10
browserstack.local: true
- \Helper\Acceptance
NavigationCept.php
<?php
$I = new AcceptanceTester($scenario);
# define purpose of the test
$I->wantTo("check that navigation is functional.");
# check all menu items
$I->amOnPage('/');
$I->see('Search');
***现在,请注意,
Codeception
已经安装在我的 PHP 容器中并且运行良好。
url
,例如,
https://google.com
它只是连接良好,一切都成功了。我在这里做错了吗?是我的
url
参数不正确?如果可以,请帮帮我。提前致谢。
最佳答案
我之前在 Codeception + Selenium 中看到过这样的异常。我没有那个项目配置文件与你分享。
我强烈的猜测是 此错误可能是由于 Codeception-ChromeDriver-Selenium 版本的冲突引起的
关于php - Docker PHP7.x Codeception Selenium WebDriver 抛出 net::ERR_CONNECTION_REFUSED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68005504/
我的表单包含一个隐藏字段 csrf 并且我的 Controller 有一个方法来检查 CSRF 攻击。在我的功能测试中,我尝试通过fillField 来检查我的Controller 的方法 如果有人t
我正在 docker 容器中进行 Codeception 验收测试。我可以运行整个项目,但不能运行单个测试或类。是否有任何配置选项或参数来解决这个问题? 这有效(运行所有测试): codecept -
我正在使用 Codeception 运行验收测试,我需要计算带有“.remove”类的按钮在一页中出现的次数。此类按钮位于 html 表内,计数取决于购物车中的商品数量。 下面是我尝试使用的代码:
就像我们在 codecetion 中从命令提示符传递浏览器名称和其他详细信息一样,我们可以从命令提示符传递可以在脚本中使用的任何变量吗? 最佳答案 我没有在文档和其他提要中找到任何方法。 我为此能力添
在 PHP Codeception test framework ,我希望能够一次运行多个套件。 我可以像这样运行它们: codecept run 或者我可以像这样运行单个套件: codecept r
我正在使用 codeception,当我尝试检查 dbconnection 时它显示错误: > DEPRECATION: Calling the > "Symfony\Component\EventD
$I->fillField("username", "test"); 在运行验收测试时,收到以下错误: 抱歉,我无法填写字段“用户名”、“测试”: ErrorException: DOMXPath::
我有 API 端点: [GET] /car/:carId 这实际上是一个 Controller Action (CarController::car( $carId ) ): public funct
我有一个 PHP 应用程序,我们正在使用 Codeception 添加测试。我们尝试将 Specify(和 Verify)添加到我们的套件中,但未被识别。您如何正确设置 Specify 以与 Code
我正在尝试为使用 Codeception 的 Paypal Express Checkout 付款编写验收测试。问题是上下文窗口。当我没有窗口名称时,如何切换到那个窗口来填写字段?感谢您的帮助。 最佳
我正在编写一个测试,但它没有像我预期的那样工作。 我需要使用一些抓取器,然后在测试运行时转储到屏幕上。 我该怎么做?如何回显,而不是用户抓取器如何;我可以使用抓取器,但我不知道如何在测试运行时回显。
-- Select an Option -- @foreach ($options as $option) value }}'>{{ $option->name }}
刚开始使用 codeception 2.0.9 并安装了 phantomjs 并运行了一些示例测试。 Codeception 在最后给出了一个简洁的 html 报告,用红色和绿色总结了通过的测试,这很
我正在使用 Codeception 运行验收测试,我需要计算带有“.remove”类的按钮在一页中出现了多少次。此类按钮位于 html 表格内,计数取决于购物车中的商品数量。 以下是我尝试使用的代码:
使用 Codeception 测试框架和 Selenium 2 模块来测试一个网站,我最终点击了一个超链接,该超链接打开了一个没有名称的新窗口。结果, switchToWindow() 函数将无法工作
亲爱的 Stackoverflow 用户,您好 目前我正在使用 Selenium 作为 WebDriver 模块使用 Codeception 编写验收测试。在我检查我们的子导航是否存在、是否完整并且有
我在 Yii2 中使用 Codeception 进行验收测试,但无法访问我的模型,因为命名空间不适用于这些测试。 我在我的测试/_bootstrap.php 中有这个 require(__DIR__
我一直在使用 Codeception 编写一些单元测试,并且我的数据库已被测试数据过度运行。在阅读文档时,我发现它说: Database will be cleaned and populated a
有没有办法断言某个元素(例如输入或链接)具有键盘焦点?我正在将 Codeception 与 Selenium 结合使用。在 http://codeception.com/docs/modules/We
我无法通过代码接收复制 ajax 调用。 例如: $I->sendAjaxPostRequest('login/verify', array('name' => 'name', 'password'
我是一名优秀的程序员,十分优秀!