2

If in casper, I only click on one button, then everything works fine. The following code passes the test.

casper.then(function() {
    this.click('#loginB');
    this.fill('#loginEmailField', {
        'loginEmail':    '[email protected]',
    }, false);
    this.fill('#loginPasswordField', {
        'loginPassword':    'a',
    }, false);
    this.click('#loginClickButton');
    this.click('#logoutB');
    test.assertNotVisible('#logoutB', "logout item should not show");
    test.assertNotVisible('#loggedInItem', "loggedin item should not show");
    test.assertVisible('#loginB', "login item should show");
});

This also passes:

casper.then(function() {
    test.assertNotVisible('#loginModal', "login modal not visible");
    this.click('#loginB');
    test.assertVisible('#loginModal', "login modal visible");
});

Then, if after click on the login button, the user wants to sign up, then the sign up module should show up. The following tests whether it shows up but the test fail:

casper.then(function() {
    this.click('#loginB');
    this.click('#signUpB');
    test.assertVisible('#signUpModal', "signup modal is visible after click");
    test.assertVisible('#UsernameField', "Username field on the signup modal should be visible too");
    test.assertNotVisible('#loginModal', "login modal should be invisible after click");
});

I manually tried the website and I am sure it shows up. How can I solve this?