Skip to content

849 verify text case insensitive #1043

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

Merged
merged 12 commits into from
Feb 12, 2018
Merged

849 verify text case insensitive #1043

merged 12 commits into from
Feb 12, 2018

Conversation

rubygeek
Copy link
Contributor

@rubygeek rubygeek commented Feb 3, 2018

Added code and tests to resolve #849

Copy link
Contributor

@aaltat aaltat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code generally looks good, expect the code block which we do not usually use. But there should be few more test done before the PR can be merged.

actual = self.find_element(locator).text
actual = actual_before = self.find_element(locator).text
expected_before = expected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not in favor of code blocks. Please remove the empty line from this line and from lines 71 and 76.

@@ -56,35 +56,54 @@ def element_should_contain(self, locator, expected, message=None):
The ``message`` argument can be used to override the default error
message.

The ``ignore_case`` argument can be set to True to compare case
insensitive, default is False.

Use `Element Text Should Be` if you want to match the exact text,
not a substring.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In new line, add text: ignore_case argument is new in SeleniumLibrary 3.1.

Please fix in keywords where the new argument is added.

"""
actual = self.find_element(locator).text
expected_before = expected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not in favor of code blocks. Please remove the empty line from this line and from line 99.

Run Keyword And Expect Error
... The text of element 'some_id' should have been 'inside' but it was 'This text is inside an identified element'.
... Element Text Should Be some_id inside


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line here is not needed.

@@ -119,15 +119,20 @@ Page Should Not Contain Element With Disabling Source Logging

Element Should Contain
Element Should Contain some_id This text is inside an identified element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add line: | Element Should Contain | some_id | This text is inside an identified element | ignore_case=False |


Element Should Not Contain
Element Should Not Contain some_id This text is not inside an identified element
Element Should Not Contain some_id THIS TEXT is not inside an identified element ignore_case=False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please add line: Element Should Not Contain | some_id | This text is not inside an identified element | ignore_case=True |
  2. Please also add new test where Element Should Not Contain when ignore_caseargument is used with True and False values but the keyword fails. In the test use Run Keyword And Expect Errorto verify that correct error is raised.

@rubygeek
Copy link
Contributor Author

rubygeek commented Feb 12, 2018

I have fixed the code according to suggestions and ready for final review. @aaltat

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

Successfully merging this pull request may close these issues.

Verify string regardless of case
2 participants