Hi, I just set up my first codeception WebDriver with Chrome and wrote my first tests. I got a click on a link and test for the newly loaded page work, but I can't get it to work, when there is a login with a button in between. I have tried two different ways, but I always end up back at superlogin.php
html, if successful should take me to index.html
<form method="post" id="superlogin">
<input type="text" name="username" placeholder="User">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="bt_md" value="Login">Login</button>
</form>
codeception
$I->amGoingTo('log in correctly');
$I->amOnPage('/superlogin.php');
$I->submitForm('#superlogin', [
'username' => 'name',
'password' => 'somepassword'
]);
// $I->fillField('username','name');
// $I->fillField('password','somepassword');
// $I->click(['xpath' => "//form[@id='superlogin']/button[@type='submit']"]);
$I->wait(5);
$I->seeCurrentUrlEquals('/index.php');
but the last aways states that the test didn't work and that I am still on superlogin.php
by the way, if I do a screenshot after fillField, should I see the text in the fields? Because I do not. A check of the fields with seeInField
passes.
Thanks