Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Wait to accept Question, Resolution pairs. #50

Open
perrygoy opened this issue Feb 14, 2024 · 3 comments
Open

Add support for Wait to accept Question, Resolution pairs. #50

perrygoy opened this issue Feb 14, 2024 · 3 comments

Comments

@perrygoy
Copy link
Member

I keep finding myself wanting to say something like:

the_actor.will(
    Wait.until_the(Number.of(BALLOONS), IsEqualTo(5)
)

But it can't! I think it would be nice to add it.

Things we'd need to do:

  • Add new until and until_the methods to accept a Question and Resolution pair.
  • Add handling in the log_message property to properly describe what we're waiting for.
  • Add a check in the try block of perform_as to either do what it does now or pass the Question, Resolution pair to a Silently(Eventually(See(...))).
  • Add tests for that!
  • Add documentation for that!
@bandophahita
Copy link
Contributor

I'm super torn about the names of these.
I could see how someone fresh to screenpy could easily be confused by Wait vs WebDriverWait. That said, I like Wait.until because it makes the most sense to me.

@bandophahita
Copy link
Contributor

It feels proper to point out that the following two statements are functionally equivalent. (maybe in documentation?)

actor.will(Wait.until(Number.of(BALLOONS), IsEqualTo(5))
actor.will(Eventually(See(Number.of(BALLOONS), IsEqualTo(5))))

Though, I imagine we're going to want the output logging to look different.

@perrygoy
Copy link
Member Author

Yeah, i'm thinking about expanding the Wait Strategies section of the documentation with a bit talking about connotation of those two approaches. Plus i'm pretty sure behind the scenes the first will be doing the latter, haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants