If I click on just one button in Casper, everything works perfectly. The code below passes the test.
casper.then(function() {
this.click('#loginB');
this.fill('#loginEmailField', {
'loginEmail': '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a2c3e2c38cc1cdcf">[email protected]</a>',
}, false);
this.fill('#loginPasswordField', {
'loginPassword': 'a',
}, false);
this.click('#loginClickButton');
this.click('#logoutB');
test.assertNotVisible('#logoutB', "logout item should not be visible");
test.assertNotVisible('#loggedInItem', "logged-in item should not show up");
test.assertVisible('#loginB', "login item should be visible");
});
This second check also passes:
casper.then(function() {
test.assertNotVisible('#loginModal', "login modal is not visible");
this.click('#loginB');
test.assertVisible('#loginModal', "login modal is visible now");
});
However, if a user clicks on the login button and then wishes to sign up, the signup module should appear. The tests below verify this but they fail:
casper.then(function() {
this.click('#loginB');
this.click('#signUpB');
test.assertVisible('#signUpModal', "signup modal should be visible after clicking");
test.assertVisible('#UsernameField', "Username field on the signup modal should also be visible");
test.assertNotVisible('#loginModal', "login modal should disappear after clicking");
});
I have tested the website manually and can confirm that the signup modal does appear. What could be causing these failures?