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

Documentation for Assertion "contains" unclear #3640

Open
simonmeggle opened this issue Jun 9, 2024 · 7 comments
Open

Documentation for Assertion "contains" unclear #3640

simonmeggle opened this issue Jun 9, 2024 · 7 comments
Labels
bug Something isn't working priority: high

Comments

@simonmeggle
Copy link
Contributor

Regarding the docs for Get Element States, especially this line:

Get Element States id=disabled_elem contains visible disabled readonly

The documentation of assertion operators is unclear for me because the keyword returns a list, contains however is explained as “Checks if returned value contains expected value as substring.“.

This explanation leaves open whether the list is flattened as a string or if contains works different when it gets a list instead of a string to search in.

@aaltat
Copy link
Member

aaltat commented Jun 10, 2024

Would you have an idea how documentation should be improved? More text or perhaps better examples?

@allcontributors please add @simonmeggle for bugs

Copy link
Contributor

@aaltat

@simonmeggle already contributed before to bug

@aaltat aaltat added bug Something isn't working priority: high labels Jun 10, 2024
@simonmeggle
Copy link
Contributor Author

Would you have an idea how documentation should be improved? More text or perhaps better examples?

Well, the documentation of assertion operators does not mention at all how the operators work with lists returned from keywords like Get Element States instead of strings.

As written, it depends on the implementation of the assertions.

Suggestions I can make:

  • if operators can only be applied to a certain data type, a another column is needed which clearly states this
  • More Examples (the current 2 only show string handling)

@aaltat
Copy link
Member

aaltat commented Jun 11, 2024

Would you like to write better documentation as a PR?

@simonmeggle
Copy link
Contributor Author

Would you like to write better documentation as a PR?

Yes, I can do that. Can you @aaltat or someone else explain beforehand how it should work?

@aaltat
Copy link
Member

aaltat commented Jun 12, 2024

GitHub has good documentation about it: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

And we have some instructions how you setup the environment https://github.com/MarketSquare/robotframework-browser/blob/main/CONTRIBUTING.md after you have created your fork https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo and clone it in your disk.

Keywords documentation is in the source files example in here https://github.com/MarketSquare/robotframework-browser/blob/main/Browser/keywords/getters.py#L1346

The invoke command line tool can be used to generate the keyword documentation, all invoke commands can be listed with invoke -l option from cmd.

@Snooz82
Copy link
Member

Snooz82 commented Nov 3, 2024

@simonmeggle was imho asking about how the contains does work.

In this case, contains with lists does check if the expected value(s) are all existing in the returned list.
Internally it uses a "subset" comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high
Projects
None yet
Development

No branches or pull requests

3 participants