-
Notifications
You must be signed in to change notification settings - Fork 763
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
Clean up keywords related to alerts #933
Comments
The current situation is so bad that I assign this tentatively to SL 3.0 scope. If there's too much work, it may slip to 3.1. In that case we should at least enhance the docs a little. |
My initial proposal for a list of alert keywords is below. It's based on the actions you actually can do with alerts and influenced also by the existing set of keywords and how they behave.
|
My proposal above would mean that many of the existing keywords would need to be deprecated and removed later. My proposed actions and reasoning is below. Notice that with term loud deprecation I mean emitting a deprecation warning right now and silent deprecation means documenting that keyword is deprecated but not yet emitting a warning. Loudly deprecated keywords could then be removed already in SL 3.1, and silently deprecated keywords could be loudly deprecated at that point.
|
How about instead of multiple new keywords, you add a single new keyword with a name like For example:
Another possible name might be
Note: "Click", "input text", "message should be" aren't keywords, though they could have the same as existing keywords I suppose. |
Examples by @boakley look nice but I see two problems with them in this context:
I wouldn't thus use this style here, but in some other context it could work really well. Also, I propose adding just one totally new keyword |
The name could be `with the current alert` instead of `with next alert`, to
satisfy your second concern. I certainly think it looks better in a test
than "Handle Alert", but I realize that's pretty subjective.
…On Thu, Sep 28, 2017 at 9:47 AM, Pekka Klärck ***@***.***> wrote:
Examples by @boakley <https://github.com/boakley> look nice but I see two
problems with them in this context:
- The style is inconsistent with other kws in this lib.
- It's a bit strange to say With next alert when the alert is likely
to have occurred at that point.
I wouldn't thus use this style here, but in some other context it could
work really well. Also, I propose adding just one totally new keyword Handle
Alert.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#933 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEmYuAn0CXOUIq4ky3M9y-lunHdYsQJks5sm7F8gaJpZM4Pm4aY>
.
|
Yeah, these examples look nice. But as I said, the style they use is totally different than what other keywords use and I really like consistency. Also, the keywords provided by this library aren't really meant to be used directly on the test case level. They should be used by higher level keywords created as Robot's user keyword or by higher level libraries. |
After some more investigation I noticed that some of the things I considered really strange were in fact repressions (#934). At the same time I found some new strange things, like |
The current alert related keywords are a mess. Biggest problems:
Selecting should the alert be dismissed by pressing
Ok
orCancel
needs to be done using separateChoose Ok/Cancel On Next Confirmation
keywords. I think there used to be a technical reason to do it this way, but looking at the current code this doesn't seem to be the case. Much better to just pass this information as a normal argument to keywords dismissing alerts.There are several keywords with same/similar functionality. In practice
Confirm Action
,Dismiss Alert
anGet Alert Message
all close the alert by default.Strange configuration options and default values. For example,
Dismiss Alert
actually accepts the alert by default and needs to be separately configured to dismiss it.If I've understood it correctly, there can be three kind of Javascript alerts:
window.alert
).window.confirm
)window.prompt
)We need to think what kind of a set of keywords are needed to handle these different alerts. The more we can keep backwards compatibility (i.e. keyword names) the better, but the most important goal is making the set of keywords consistent and easy to use.
The text was updated successfully, but these errors were encountered: