1
I have acceptance.suite.yml which looks like this.
class_name: AcceptanceTester
modules:
enabled:
- \Helper\Acceptance
- WebDriver:
url: https://staging.needhelp.com
env:
firefox:
modules:
config:
qa_user: [email protected]
WebDriver:
browser: 'firefox'
capabilities:
platform: Windows 7
chrome:
modules:
config:
qa_user: [email protected]
WebDriver:
browser: 'chrome'
capabilities:
platform: Windows 8.1
獲得環境和我是這樣運行測試用例:現在Codeception上測試運行
$ codecept run acceptance UserCest.php --env firefox --env chrome
,我想知道是否有一種方法在運行時間去測試本身內ENV。
class UserCest extends BaseAcceptance
{
public function login(AcceptanceTester $I)
{
$I->amOnPage("/");
$I->see('Sign In');
$env = $I->getConfig('env');
//something like this ?? which would return 'firefox' for the instance it is running as environment firefox.
$I->fillField($this->usernameField, $this->username);
$I->fillField($this->passwordField, $this->password);
}