这里有新的Codeception用户,所以提前为一个超级简单的问题道歉。是否有可能有一个代码项目,使用PhpBrowser
驱动程序运行一些验收测试,其他人使用selenium WebDriver
驱动程序?
也就是说,我有一个看起来像这样的acceptance.suite.yaml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://localhost/'
browser: firefox
window_size: 1024x768
wait: 10
capabilities:
unexpectedAlertBehaviour: 'accept'
并且测试看起来像这样
#File: tests/acceptance/Science.php
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('see Science word in title ');
$I->amOnPage('/');
$I->seeInTitle('Science');
我跑的时候
vendor/bin/codecept run
我的测试在selenium服务器上运行。 (是的!)然而,还有其他测试我想在普通的旧PhpBrowser
中运行。如果不创建第二个代码套件,这可能吗?如果是这样,配置和/或测试是什么样的?
不,你必须使用单独的套房。
我认为您可以将WebDriver与PhantomJS浏览器一起使用,如http://codeception.com/docs/modules/WebDriver的Codeception文档中所述。
您需要下载并运行PhantomJS,然后在代码配置文件中将browser
值从firefox
更改为phantomjs
。
如果您需要WebDriver和PHPBrowser测试 - 创建一个单独的套件。