-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
[fix] Fixed flaky test: test_input_filters #436
[fix] Fixed flaky test: test_input_filters #436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @youhaveme9, please see my comments below.
tests/test_project/tests/utils.py
Outdated
@@ -125,7 +126,10 @@ def _get_menu_backdrop(self): | |||
return self.web_driver.find_element(By.CSS_SELECTOR, '.menu-backdrop') | |||
|
|||
def _get_simple_input_filter(self): | |||
return self.web_driver.find_element(By.CSS_SELECTOR, 'input[name=shelf]') | |||
self.open(reverse('admin:test_project_shelf_changelist')) | |||
return WebDriverWait(self.web_driver, 15).until( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we waiting 15 seconds? Why so much? Totally unnecessary!
2 seconds should be a lot more than enough..
tests/test_project/tests/utils.py
Outdated
@@ -125,7 +126,10 @@ def _get_menu_backdrop(self): | |||
return self.web_driver.find_element(By.CSS_SELECTOR, '.menu-backdrop') | |||
|
|||
def _get_simple_input_filter(self): | |||
return self.web_driver.find_element(By.CSS_SELECTOR, 'input[name=shelf]') | |||
self.open(reverse('admin:test_project_shelf_changelist')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method used only once? If so, please move this code to the test method, this separation isn't necessary and makes the code less readable with no benefits.
@@ -590,7 +590,9 @@ def test_input_filters(self): | |||
input_field.send_keys('Horror') | |||
self._get_filter_button().click() | |||
# Horror shelf is present | |||
self.web_driver.find_element(By.XPATH, horror_result_xpath) | |||
WebDriverWait(self.web_driver, 10).until( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that 10 seconds again?
"Bitstream Vera Sans", Verdana, Arial, sans-serif; | ||
--font-family-primary: | ||
"Roboto", "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, | ||
Arial, sans-serif; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change necessary? Who's causing this? Is it prettier or what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, idk why it was skipped before
hey @nemesifier I have done the required changes but for that I have to make some workaround which I think can be improved in test_selenium.py line 530 Please suggest or give a hint for improving this PR |
Checklist
Reference to Existing Issue
Closes #431
Description of Changes
Fixes flaky test in
test_input_filer
observed in CI.