mercredi 9 septembre 2020

How can I redirect to another page using testcafe after logging with TestCafe

I am trying to redirect to another page after a login with testCafe, but after the login that other page remains blank, that is, it never loads, or at other times it simply closes the session without entering. The fact is that it does not let me go to the main page after login. I use a VPN connection. Do you know what it could be, a login token or VPN problem? How can I solve it?

This my code

import { Selector } from 'testcafe';
import { Role } from 'testcafe'

const role = Role('login_page', async t => {
    await t
      .wait(10000)

      .click(Selector('button.btn.btn-dark.btn-lg.btn-block'))
      .typeText('input[name="loginfmt"]', 'my_user')
      .pressKey('enter')
      .typeText('input[name="Password"]', 'my_password')
      .click('span[id="submitButton"]')
      .click('input[id="idSIButton9"]')

}, { preserveUrl: true });

fixture `My Fixture`;

test('My test', async t => {
    await t
        .navigateTo('home_page_after_login')
        .useRole(role);
});

Aucun commentaire:

Enregistrer un commentaire