-
Notifications
You must be signed in to change notification settings - Fork 1
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
389 - Enhance Test Stability with Improved Wait Mechanisms #390
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3c2b0d9
Enhance Test Stability with Improved Wait Mechanisms
Janell-Huyck b65fa62
Look for selector after clicking edit
Janell-Huyck d5ffaae
Add more wait selectors for author vs artist labels spec
Janell-Huyck f9f3944
Use a 10-second wait on tests
Janell-Huyck 7f9824f
Add 10 second wait to support/helpers/feature_spec_helpers/author_man…
Janell-Huyck cc38db8
Rebase
Janell-Huyck da1de1a
Correct 'login_as_admin' to new method name
Janell-Huyck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
aaec | ||
aaec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@Janell-Huyck You still have these checks for 'Add Author' and 'Add Artist' in several places in this file even though your new
add_author_or_artist_and_verify_field
method also checks for them. Can you safely get rid of these expects?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.
Part of what I learned with this pr is that the statement
expect(page).to have_selector("input[name='book[author_first_name][]']"
has the side-effect of causing Capybara to wait until these elements are loaded before proceeding.The problems I was having have to do with Capybara proceeding to check things before pages have actually loaded. The best way I found to slow Capybara down is to add these checks in before I check what I'm actually needing to check.
Are you aware of another way to do this? I have tried to sprinkle this check in anywhere where Capybara might have been expected to either initially load or to reload a page due to some server-side Javascript actions. It will wait up to the
default_wait_time
for these things to load, but if they're there it proceeds immediately.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.
I was only referring to lines 62 & 63. They verify the "Add Author" or "Add Artist" buttons are there, but then right after that you call
add_author_or_artist_and_verify_field
, which does its own (second) check that "Add Author" or "Add Artist" are present.So I'm wondering if
expect(page).to have_content('Add Author')
andexpect(page).not_to have_content('Add Artist')
are redundant because ofadd_author_or_artist_and_verify_field
? Or are they needed to slow Capybara down?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.
Ah, I see what you're saying. The helper method is checking that there's only one type of button, but it doesn't really care which one is there. This test here is more about making that the correct button type is present. The "book" model should have "author", and if it had "artist" that should fail. The add_author_or_artist_and_verify_field method will pass for either one.
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.
Rebasing... hang on
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 for the explanation and the rebase. I'll merge when the build goes green. (might want to look into turning on parallel testing in CI)