mardi 28 juillet 2020

Jasmine spec timed out. Resetting the WebDriver Control Flow. angular 9 testing

I am facing issue while E2E test case (earlier it was working..)

A Jasmine spec timed out. Resetting the WebDriver Control Flow.
    × when login is successful — user object should be set in storage
      - ScriptTimeoutError: script timeout
        (Session info: chrome=84.0.4147.89)
        (Driver info: chromedriver=84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}),platform=Windows NT 6.3.9600 x86_64)

and this is the test case

it("when login is successful — user object should be set in storage", async () => {
    await loginPage.fillCredentials(loginPage.credentials.correct);

    // wait until redirected to new page
    const EC = protractor.ExpectedConditions;
    const elm = await element(by.css(LOGIN_CSS.LOGO_TEXT));
    browser.wait(EC.presenceOf(elm), 40000);

    const _currentUser = await helperService.getLocalStorageObject("currentUser");
    console.log("_currentUser", _currentUser);

    expect(_currentUser).toBeDefined();

    const currentUser = JSON.parse(_currentUser);
    console.log("currentUser", currentUser);
    expect(currentUser.Id).toBeDefined();
    expect(currentUser.Name).toBeDefined();
});

In application, after login it redirects to the page and set user to local storage.

// wait till `LOGIN_CSS.LOGO_TEXT` is available on next page after login
const EC = protractor.ExpectedConditions;
const elm = await element(by.css(LOGIN_CSS.LOGO_TEXT));
browser.wait(EC.presenceOf(elm), 40000);

what can be the issue?

Aucun commentaire:

Enregistrer un commentaire