Php WebGuy编码概念

Php WebGuy编码概念,php,codeception,Php,Codeception,我刚开始使用codeception,我尝试做一个简单的测试:登录并检查里面的链接 我正在使用$I=newacceptancetester($scenario)在我的验收测试中,但我看到人们使用WebGuy($scenario)和我不知道WebGuy和AcceptanceTester之间的区别。 signancept.php代码: <?php //webLOG IN $I = new AcceptanceTester($scenario); $I->wantTo('Log in my

我刚开始使用codeception,我尝试做一个简单的测试:登录并检查里面的链接

我正在使用
$I=newacceptancetester($scenario)在我的验收测试中,但我看到人们使用
WebGuy($scenario)
我不知道WebGuy和AcceptanceTester之间的区别。

signancept.php代码:

<?php 
//webLOG IN
$I = new AcceptanceTester($scenario);
$I->wantTo('Log in my app mobile');
//$I->amOnUrl('192.168.X.X/app/mobile/');
$I->amOnPage('/');
$I->fillField('user','test');
$I->fillField('password','test1234');
$I->fillField('zone','01');
//$I->uncheckOption('input[type=checkbox]');
$I->seeCheckboxIsChecked('#rememberme');
$I->seeElement('input[name=submit]');
$I->click('input[type=submit]');

//succes
$I->wantTo('Check main page');
$I->amOnPage('/principal.php');
$I->seeLink('salir','salir.php');
[...]
?>
当我使用
$i=newwebguy($scenario)我得到这个:

C:\xampp\htdocs\public_html\codeception>php codecept.phar run acceptance --steps

Codeception PHP Testing Framework v2.0.9
Powered by PHPUnit 4.4.0 by Sebastian Bergmann.

Acceptance Tests (1) -----------------------------------------------------------
---------------------------------------
Trying to Log in App Mobile (SigninCept)

Scenario:
* I am on page "/"
* I fill field "user","test"
* I fill field "password","test1234"
* I fill field "zone","01"
* I see checkbox is checked "#rememberme"
* I see element "input[name=submit]"
* I click "input[type=submit]"
* I am on page "/principal.php"
* I see link "salir","salir.php"
[...]
PASSED
C:\xampp\htdocs\public_html\codeception>php codecept.phar run acceptance --steps

Codeception PHP Testing Framework v2.0.9
Powered by PHPUnit 4.4.0 by Sebastian Bergmann.

Acceptance Tests (1) -----------------------------------------------------------
---------------------------------------
Trying to Log in App mobile(SigninCept)

Scenario:

Fatal error: Class 'WebGuy' not found in C:\xampp\htdocs\public_html\codeception\tests\acceptance\SigninCept.php on line 3



FATAL ERROR. TESTS NOT FINISHED.
Class 'WebGuy' not found
在C:\xampp\htdocs\public\u html\codeception\tests\acceptance\signicept.php中:3

I have **WebGuy.php in my acceptance dir.**
如果我进行构建我会得到以下结果:

C:\xampp\htdocs\public_html\codeception>php codecept.phar build acceptance --steps



[RuntimeException]
Too many arguments.



build [-c|--config[="..."]]
“guy”的名称取决于套件的codeception配置(在您的情况下是验收套件):

运行
codecept build
时,将创建一个集成了您定义的模块的所有方法的guy类,然后CodeCeption将在运行测试时使用它。任何其他类都将被忽略


另请参阅build命令的帮助(
codecept help build
)以查看可以传递给它的选项(即通常不需要任何选项)。

Codeception 2.x仅使用AcceptanceTester

正如人们所说,男人们被重新命名为测试员。演员班和 助手按套件命名。例如,验收测试将开始 这一行:



请参见此处:

WebGuy
类只是从
AcceptanceTester
类扩展而来的自定义类。您可以实现自己的,并从
acceptance.suite.yml

class_name: AcceptanceTester ==> or  ==> WebGuy // here is the call of the class
modules:
   enabled: 
      - WebDriver:
         url: 'http://local.symmetryk.com/'
         browser: firefox
         window_size: maximize
         wait: 10
         capabilities:
             unexpectedAlertBehaviour: 'accept'

        env:
        chrome:
         modules:
            config:
                WebDriver:
                    browser: 'chrome'

      - Db:
希望这能帮助您理解:)

<?php
$I = new AcceptanceTester($scenario);
// and uses AcceptanceHelper
?>
class_name: AcceptanceTester ==> or  ==> WebGuy // here is the call of the class
modules:
   enabled: 
      - WebDriver:
         url: 'http://local.symmetryk.com/'
         browser: firefox
         window_size: maximize
         wait: 10
         capabilities:
             unexpectedAlertBehaviour: 'accept'

        env:
        chrome:
         modules:
            config:
                WebDriver:
                    browser: 'chrome'

      - Db: