В настоящее время я использую Codeception 2.2 для тестирования приложения. Шаги, которые у меня есть до сих пор, приведены ниже:
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('perform actions and see result');
$I->amOnPage('/index.php');
$I->fillField('username', 'admin');
$I->fillField('password', 'password');
$I->click('Sign in');
$I->amOnPage('/index.php?module=CustomReports&view=Edit');
$I->fillField('relatedclient', '******');
$I->fillField('policynumber', '****');
$I->click('Save');
$I->see('You are being redirected to the clients isa report.');
$I->click('OK'); // This is where it fails
$I->see('Client ISA Statement');
?>
В настоящее время я использую PHP со встроенным JS, и именно здесь возникает ошибка. Мне интересно, как я могу принять window.alert, чтобы перейти на следующую страницу. Я пробовал $I->click('OK')
, но это не работает.
Спасибо