我们正在尝试在我们的实际网站上添加测试作为更新部署的一部分。我们上一次处理它们的测试运行得很好,这是一周后但现在所有这些都抛出了这个错误。我们已经试图找出它,但没有找到任何有价值的东西。
更新1:我们发现由于软件包更新而导致功能中断。以下是更新包的列表;
barryvdh/laravel-debugbar 2.0.6 -> 2.1.1
barryvdh/laravel-ide-helper 2.1.0 -> 2.1.2
codeception/codeception 2.1.4 -> 2.1.5
doctrine/cache 1.5.2 -> 1.6.0
laravel/framework 5.1.26 -> 5.1.28
league/flysystem 1.0.15 -> 1.0.16
maximebf/debugbar 1.10.5 -> 1.11.0
phpspec/phpspec 2.4.0 -> 2.4.1
phpunit/phpunit 4.8.20 -> 4.8.21
symfony/browser-kit 2.8.0 -> 2.8.1
symfony/class-loader 2.8.0 -> 2.8.1
symfony/console 2.7.7 -> 2.7.8
symfony/css-selector 2.7.7 -> 2.7.8
symfony/debug 2.7.7 -> 2.7.8
symfony/dom-crawler 2.7.7 -> 2.7.8
symfony/event-dispatcher 2.8.0 -> 2.8.1
symfony/finder 2.7.7 -> 2.7.8
symfony/http-foundation 2.7.7 -> 2.7.8
symfony/http-kernel 2.7.7 -> 2.7.8
symfony/polyfill-php56 1.0.0 -> 1.0.1
symfony/polyfill-util 1.0.0 -> 1.0.1
symfony/process 2.7.7 -> 2.7.8
symfony/routing 2.7.7 -> 2.7.8
symfony/translation 2.7.7 -> 2.7.8
symfony/var-dumper 2.7.7 -> 2.7.8
symfony/yaml 2.8.0 -> 3.0.1
更新2:我们尝试降级laravel和codeception,但无济于事。奇怪的是,即使它们被降级到代码2.1.0之前,已经更新过一次的机器总是会抛出该错误。通过所有测试的机器是在代码2.1.4和webdriver 1.1.0上。
更新3:安装selenium只是为了检查它的工作原理可能是它的phantomJS / ghost-driver有冲突。
示例测试
public function test(AcceptanceTester $I)
{
$I->amOnUrl('http://swaggable.com');
$I->canSeeCurrentUrlEquals('/');
}
示例输出
Failed to check correct credentials in _001PlatformSignupCest::checkCorrectCredentials (tests\acceptance\_001PlatformSIgnupCest.php)
[ModuleException] WebDriver: Current url is blank, no page was opened
Scenario Steps:
3. $I->canSeeCurrentUrlEquals("/signup")
2. $I->amOnUrl("http://platform.work.com/signup")
1. $I->resizeWindow(1280,720)
验收配置:
modules:
enabled:
- Asserts
- WebDriver:
url: http://platform.work.com
browser: firefox
http_proxy: direct
- \Helper\Acceptance
设定:
作曲
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"barryvdh/laravel-ide-helper": "^2.0",
"sboo/multiauth": "4.0.*",
"dingo/api": "0.10.*",
"doctrine/dbal": "2.3.*",
"rtconner/laravel-kint": "~2.0",
"factual/factual-php-driver": "dev-master",
"weblee/mandrill": "dev-master",
"barryvdh/laravel-debugbar": "^2.0",
"laravel/envoy": "~1.0",
"jeremeamia/superclosure": "~2.0",
"illuminate/html": "~5.0",
"predis/predis": "^1.0",
"guzzlehttp/guzzle": "~5.3|~6.0",
"laravelcollective/html": "5.1.*",
"exeu/apai-io": "dev-master",
"codeception/codeception": "*"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"fzaninotto/faker": "~1.0"
},
答案 0 :(得分:1)
您好我有同样的问题。
我已将phantomjs降级为1.9.7版本
...
"jonnyw/php-phantomjs": "3.*",
"site5/phantoman": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"PhantomInstaller\\Installer::installPhantomJS",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"PhantomInstaller\\Installer::installPhantomJS",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist",
"bin-dir": "bin"
}
}
它现在正在运行,但我知道是一种解决方法