Phantomjs WebDriver:当前url为空,未打开任何页面
我们正在尝试添加测试,作为实时站点上更新部署的一部分。我们上一次进行测试时(一周前),测试运行良好,但现在所有测试都抛出了错误。我们试图找出答案,但没有找到任何值得的 更新1:我们发现,由于软件包更新,功能中断。以下是更新包的列表Phantomjs WebDriver:当前url为空,未打开任何页面,phantomjs,laravel-5.1,codeception,Phantomjs,Laravel 5.1,Codeception,我们正在尝试添加测试,作为实时站点上更新部署的一部分。我们上一次进行测试时(一周前),测试运行良好,但现在所有测试都抛出了错误。我们试图找出答案,但没有找到任何值得的 更新1:我们发现,由于软件包更新,功能中断。以下是更新包的列表 barryvdh/laravel-debugbar 2.0.6 -> 2.1.1 barryvdh/laravel-ide-helper 2.1.0 -> 2.1.2 codeception/codeceptio
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,但均无效。奇怪的是,更新过一次的机器总是会抛出这个错误,即使它们降级到codeception 2.1.0。而通过所有测试的机器是codeception 2.1.4和webdriver 1.1.0
更新3:安装selenium只是为了检查,它可以正常工作,所以可能是它的phantomJS/ghost驱动程序有冲突
示例测试
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)
示例输出
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
设置:
modules:
enabled:
- Asserts
- WebDriver:
url: http://platform.work.com
browser: firefox
http_proxy: direct
- \Helper\Acceptance
- 拉雷维尔5.1.28
- 联合概念2.1.5
- PhantomJS2.0.0
"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"
},
你好,我也有同样的问题 我已经将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"
}
}
现在可以了,但我知道这是一个解决办法