Skip to content

Wait Until Page Contains add option Limit#1547

Closed
IlfirinPL wants to merge 12 commits intorobotframework:masterfrom
IlfirinPL:master
Closed

Wait Until Page Contains add option Limit#1547
IlfirinPL wants to merge 12 commits intorobotframework:masterfrom
IlfirinPL:master

Conversation

@IlfirinPL
Copy link
Copy Markdown
Contributor

#1543

Wait Until Page Contains add option Limit
Wait Until Page Not Contains add option Limit

wait_until_page_contains_element
wait_until_page_does_not_contain_element
@aaltat
Copy link
Copy Markdown
Contributor

aaltat commented Feb 3, 2020

Please write tests for the change, I think this would be best to be tested by acceptance tests. Perhaps this html page could work for in this case.

Copy link
Copy Markdown
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.

There are few things to consider.

Comment thread src/SeleniumLibrary/keywords/waiting.py Outdated
from SeleniumLibrary.base import LibraryComponent, keyword
from SeleniumLibrary.errors import ElementNotFound
from SeleniumLibrary.utils import is_noney, secs_to_timestr
from selenium.common.exceptions import StaleElementReferenceException
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you move this import back to original place, so that it follows pep.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I move into previous place, but using PyCharm default configuration it want to move it into different place

Comment thread src/SeleniumLibrary/keywords/waiting.py
Comment thread src/SeleniumLibrary/keywords/waiting.py Outdated
Comment thread src/SeleniumLibrary/keywords/waiting.py Outdated
Comment thread src/SeleniumLibrary/keywords/waiting.py
Comment thread src/SeleniumLibrary/keywords/waiting.py Outdated
@IlfirinPL
Copy link
Copy Markdown
Contributor Author

I have added some acceptance test cases, that use additional argument

@IlfirinPL IlfirinPL requested a review from aaltat February 6, 2020 14:24
Copy link
Copy Markdown
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.

Sorry that it took long to do the review but was busy with 4.3.0 release. This is a good start, but this enhancement would need more tests and splitting the test as separate tests.


Wait Until Page Contains Element Limit
[Documentation] Tests also that format characters (e.g. %c) are handled correctly in error messages
Wait Until Page Contains Element new div 2 seconds limit=1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. Using locator that matches more than one element could be better test.
  2. Testing with zero and negative value could be interesting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test cases added

Comment thread atest/acceptance/keywords/waiting.robot Outdated
... Wait Until Page Contains Element %cnon-existent 0.1 seconds
Run Keyword And Expect Error
... Element 'id:ääööåå' did not appear in 100 milliseconds.
... Wait Until Page Contains Element id:ääööåå 0.1 seconds
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. Split test Wait Until Page Contains Element keyword is used to separate tests.
  2. Limit argument is not used in on the error scenarios.
  3. The current error test are pretty similar and do not in this context provide extra value.
  4. Write test with custom error message.
  5. Test for plural_or_not is missing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added test cases also rise issue in RF related with plural_or_not

robotframework/robotframework#3460

Comment thread atest/acceptance/keywords/waiting.robot Outdated
... Custom Error ää ÖÖ
... Wait Until Page Does Not Contain Element content 0.1 seconds Custom Error ää ÖÖ

Wait Until Page Does Not Contain Element
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. Using locator that matches more than one element could be better test.
  2. Testing with zero value would be interesting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test cases added

Comment thread atest/acceptance/keywords/waiting.robot Outdated
Wait Until Page Does Not Contain Element
[Documentation] Tests also that format characters (e.g. %c) are handled correctly in error messages
Wait Until Page Does Not Contain Element not_present 2 seconds limit=1
Run Keyword And Expect Error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. Split test Wait Until Page Contains Element keyword is used to separate tests.
  2. Limit argument is not used in on the error scenarios.
  3. The current error test are pretty similar and do not in this context provide extra
  4. Write test with custom error
  5. Test for plural_or_not is missing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test cases added

@IlfirinPL
Copy link
Copy Markdown
Contributor Author

@aaltat
I have notice that test cases overall, are in old robot framework syntax using ..., maybe they all should be updated using tidy ?
Not in this pull requests but maybe should be done.

@IlfirinPL IlfirinPL requested a review from aaltat February 10, 2020 10:37
@aaltat
Copy link
Copy Markdown
Contributor

aaltat commented Feb 12, 2020

I am having flu and I will take a look when I feel better.

@IlfirinPL
Copy link
Copy Markdown
Contributor Author

No worries, code will wait :), and flu will pass :)

@IlfirinPL
Copy link
Copy Markdown
Contributor Author

@aaltat did you maybe had time to look into this pull request ?

@aaltat
Copy link
Copy Markdown
Contributor

aaltat commented Mar 20, 2020

Yes, I will try to find time for it in the next weekend.

@aaltat
Copy link
Copy Markdown
Contributor

aaltat commented Apr 18, 2020

Closing in favor of #1574

@aaltat aaltat closed this Apr 18, 2020
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.

2 participants