jeudi 20 avril 2017

Codeception acceptance test to accept popup

I am currently using Codeception 2.2 in order to test an application. The steps I have so far are as below:

<?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');
?>

Currently I am using PHP with inline JS which is where the error happens. I am wondering how I can accept the window.alert in order to go to the next page. I have tried $I->click('OK') but that doesn't seem to work.

Thanks

Aucun commentaire:

Enregistrer un commentaire