question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serenity/JS 3.0 - Test fails immediately and does not await `Wait` timeout if `Text` of a `PageElement` in a `List` can't be retrieved

See original GitHub issue

Based on this test I wrote the following one.

It will fail with the LogicError: Can't retrieve the first item from a list with 0 items: [ ] (as expected).

But it fails immediately, not as expected, after the Wait timeout, in this case 30 seconds:

it(`waits for x seconds if the text of an element is not present before fail`, () =>
    actorCalled('Peggy').attemptsTo(
        Wait.upTo(Duration.ofSeconds(30)).until(
            Text.of(
                parents()
                .where(Text.ofAll(children()), contain('tea'))
                .where(Text.ofAll(children()), contain('coffee'))
                .where(Text.ofAll(children()), contain('juice'))
                // there's no parent container with all the three items
                .first()
            ), includes('tea')
        ))
);

In my case, there are lists, I have to wait until some list get the expected content. As workaround I would have to work with explicit fixed wait timeouts, what is not very convenient.

see https://serenityjs-serenityjs-adtizt5mmv3.ws-eu71.gitpod.io/

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
viper3400commented, Nov 21, 2022

Solved with merge of #1355 and release of 3.0.0-rc.34. Thanks, @jan-molak

1reaction
viper3400commented, Nov 1, 2022

Yes, thanks. I will try to implement it asap and come back with the PR. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Report generation warnings Timeout exception #685 - GitHub
Hi, I am using CLI serenity-cli-2.3.31 . For some of my plans the tests takes a long time almost 4-5 hours. While writing...
Read more >
serenity-js/Contributors - Gitter
Hey Rodrigo! That's great news ☺️ It depends on the scope of the changes you're making; you can run tests of a specific...
Read more >
serenity js - increase timeout when running against remote grid
To start with, you might want to increase the overall timeout of all the tests (for Protractor 5.0.0 the default value is set...
Read more >
The trouble with test scripts | Serenity/JS
*TodoMVC$/); // duplicated code await element(by.css('.new-todo')).sendKeys( ...
Read more >
Handling Waits and Asynchronous Pages in Serenity BDD
Implicit Waits are used to ensure that Serenity does not fail a test if a web element is not immediately present on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found