MarketSquare/robotframework-browser

Documentation for Assertion "contains" unclear

simonmeggle opened this issue · 6 comments

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.

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

@allcontributors please add @simonmeggle for bugs

@aaltat

@simonmeggle already contributed before to bug

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)

Would you like to write better documentation as a PR?

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?

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.