lundi 25 juin 2018

Testcafe tests crash after login (corporate website redirection fails)

I am having this issue since a couple of days. I started using testcafe but i can't login properly. Here is my first test :

const role = Role('https://mywebsite.com', async t => {

    await t.typeText(authenticationPage.loginInputBox, user.login)
    .typeText(authenticationPage.passwordInputBox, user.password)
    .click(authenticationPage.signInButton);
}, { preserveUrl: true });

export default async () => {
    await navigate_as();
};

async function navigate_as() {
    await t
            .setTestSpeed(0.1)
            .useRole(role)
            .navigateTo("https://mywebsite.com/#/dashboard");
    await t
            .click(portfolioPage.navigateAs)
            .typeText(portfolioPage.navigateAsInput, "John Doe")
            .expect(portfolioPage.navigateAsAutocomplete.exists).notOk({timeout: 10000});
}

The problem is that the server usually redirects to the dashboard, but with testcafe after the first login redirection to the dashboard, it stays here 1 second and redirects to an error page. It says 502 bad gateway like below (so the tests crash after that) :

enter image description here

Is there anyone who had this problem and could tell me what's happening ? Is it something I can do with testcafe configuration to work around this ?

Thank you,

Aucun commentaire:

Enregistrer un commentaire