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

Keyword to wait that windows is open #757

Closed
aaltat opened this issue Feb 8, 2017 · 3 comments
Closed

Keyword to wait that windows is open #757

aaltat opened this issue Feb 8, 2017 · 3 comments

Comments

@aaltat
Copy link
Contributor

aaltat commented Feb 8, 2017

Many cases, like #756, the selecting of a window may fail because the windows is not yet open. Then a common solution is to do this:

| Wait Until Keyword Succeeds | 5 | 1 | Select Window | window_title |

It would be better to create keyword that allow to wait a window is opened, example:

| Wait Until Window Is Open | window_title | timeout |
| Select Window | window_title |

Other option would be to enhance the Select Window to perform polling and add a timeout

| Select Window | window_title | timeout |
@pekkaklarck
Copy link
Member

I initially thought we should add Wait Until Window Is Open, but having just one keyword for waiting and selecting the window actually sounds even better. Adding optional timeout to Select Window might thus be a good idea. I guess it should work so that if no timeout is given there's no polling either. Would similar timeout functionality be useful also with other keywords?

@aaltat
Copy link
Contributor Author

aaltat commented Feb 9, 2017

For me also wait and select window sounds more realistic use case.

Having similar functionality could be useful in other keywords too. At least I usually build my UI facing libraries in such way that they poll and assert. Also if time out is zero it only performs assert, but I rarely use that because polling is usually the best option to build stable test.

There is at least one down side, if one is writing test by using Page Should * keywords, then test are not that readable than Wait Until * keywords. I actually used, with my poll and assert keywords, a Verify * prefix. For me it made understanding what the keyword does easier and it made writing the test more fluent.

@pekkaklarck
Copy link
Member

I agree. I actually think that Should keywords should rather get Wait counterparts than have an optional timeout. Like we already have Page Should Contain and Wait Until Page Contains. Having a timeout would be more useful in keywords that do something like Click Button example timeout=2s.

@aaltat aaltat modified the milestone: Future Release Feb 9, 2017
@aaltat aaltat added this to the v3.2.0 milestone Feb 15, 2018
@aaltat aaltat modified the milestones: v3.2.0, v3.3.0 Mar 6, 2018
@aaltat aaltat self-assigned this Jun 16, 2018
@aaltat aaltat added the rc 1 label Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants