防止清除cookie codeception webdriver
Prevent clear cookies codeception webdriver
我必须测试单页 JavaScript 应用程序。完成测试操作后,看起来像 WebDriver 清除 cookie。有可能阻止它吗?我需要 运行 个彼此不隔离的测试。
我的测试文件:
<?php
class ClientGroenCest
{
protected $selectors = [
'clientTableElements' => '.b-content__clients > div:first-child > div:first-child .b-table-v2.b-table__clients tbody .nano tr',
'clientTableFirstElement' => '.b-content__clients > div:first-child > div:first-child .b-table-v2.b-table__clients tbody .nano tr:first-child',
];
public function _before(AcceptanceTester $I)
{
}
public function _after(AcceptanceTester $I)
{
}
// tests
public function login(AcceptanceTester $I)
{
$I->amOnPage('/');
$I->fillField('#loginform-email', 'test2@test.ru');
$I->fillField('#loginform-password', 'qweewq');
$I->wait(1);
$I->click('button[type="submit"]');
$I->dontSeeCurrentUrlEquals('/login');
$I->dontSeeCurrentUrlEquals('/site/login');
$I->dontSeeCurrentUrlEquals('/');
}
public function checkNumberOfClients(AcceptanceTester $I)
{
$I->click($this->selectors['clientTableFirstElement']);
$I->wait(5);
}
acceptance.suite.yml:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: https://crm.loc
browser: chrome
delay: 5000
window_size: maximize
capabilities:
acceptSslCerts: true
trustAllSSLCertificates: true
- \Helper\Acceptance
- Yii2:
configFile: 'config/test.php'
part: ORM # allow to use AR methods
cleanup: false # don't wrap test in transaction
entryScript: index-test.php
需要使用clear_cookies来保存动作状态。
我必须测试单页 JavaScript 应用程序。完成测试操作后,看起来像 WebDriver 清除 cookie。有可能阻止它吗?我需要 运行 个彼此不隔离的测试。
我的测试文件:
<?php
class ClientGroenCest
{
protected $selectors = [
'clientTableElements' => '.b-content__clients > div:first-child > div:first-child .b-table-v2.b-table__clients tbody .nano tr',
'clientTableFirstElement' => '.b-content__clients > div:first-child > div:first-child .b-table-v2.b-table__clients tbody .nano tr:first-child',
];
public function _before(AcceptanceTester $I)
{
}
public function _after(AcceptanceTester $I)
{
}
// tests
public function login(AcceptanceTester $I)
{
$I->amOnPage('/');
$I->fillField('#loginform-email', 'test2@test.ru');
$I->fillField('#loginform-password', 'qweewq');
$I->wait(1);
$I->click('button[type="submit"]');
$I->dontSeeCurrentUrlEquals('/login');
$I->dontSeeCurrentUrlEquals('/site/login');
$I->dontSeeCurrentUrlEquals('/');
}
public function checkNumberOfClients(AcceptanceTester $I)
{
$I->click($this->selectors['clientTableFirstElement']);
$I->wait(5);
}
acceptance.suite.yml:
class_name: AcceptanceTester
modules:
enabled:
- WebDriver:
url: https://crm.loc
browser: chrome
delay: 5000
window_size: maximize
capabilities:
acceptSslCerts: true
trustAllSSLCertificates: true
- \Helper\Acceptance
- Yii2:
configFile: 'config/test.php'
part: ORM # allow to use AR methods
cleanup: false # don't wrap test in transaction
entryScript: index-test.php
需要使用clear_cookies来保存动作状态。