可以Codeception同时使用PHPBrowser和其他人的一些测试和WebDriver吗?

问题描述 投票:1回答:3

这里有新的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中运行。如果不创建第二个代码套件,这可能吗?如果是这样,配置和/或测试是什么样的?

codeception
3个回答
2
投票

不,你必须使用单独的套房。


1
投票

我认为您可以将WebDriver与PhantomJS浏览器一起使用,如http://codeception.com/docs/modules/WebDriver的Codeception文档中所述。

您需要下载并运行PhantomJS,然后在代码配置文件中将browser值从firefox更改为phantomjs


1
投票

如果您需要WebDriver和PHPBrowser测试 - 创建一个单独的套件。

© www.soinside.com 2019 - 2024. All rights reserved.