-
Notifications
You must be signed in to change notification settings - Fork 62
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 feature specs #910
fix feature specs #910
Conversation
@@ -31,6 +31,7 @@ | |||
Capybara.server = :puma | |||
Capybara.javascript_driver = :selenium_chrome_headless | |||
Capybara.enable_aria_label = true | |||
Capybara.disable_animation = true |
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.
This should make the weird timing problems in admin/action_creation_spec go away. I didnt remove everything in there but it should remove the need for sleeps.
end | ||
|
||
def next_section | ||
click_on "Next" | ||
sleep 0.05 | ||
end | ||
|
||
def skip_banner_selection | ||
expect(page).to have_selector("#images", visible: true, wait: 5) |
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.
Doing an expect like this is a better way to make sure a page is settled before calling actions that will error if an element isnt visible. Even though I'm waiting for potentially 5 seconds it will automatically continue as soon as it resolves true. You also know that the element isnt available which is a more useful error than what shows if it cant fill in an input.
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.
oh, that's a great pattern!!
end | ||
|
||
def next_section | ||
click_on "Next" | ||
sleep 0.05 | ||
end | ||
|
||
def skip_banner_selection | ||
expect(page).to have_selector("#images", visible: true, wait: 5) |
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.
oh, that's a great pattern!!
This change to database cleaner config fixed a failing testing in features/action_pages/call_action_spec for me.
We should consider removing it as DatabaseCleaner is not usually necessary in new rails versions.