-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
System test for drag to upload image in comment form #5655
Conversation
test/system/comment_upload_test.rb
Outdated
click_on "Log in" | ||
|
||
visit Node.last.path | ||
drop_in_dropzone 'public/images/pl.png' |
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.
Selenium::WebDriver::Error::UnknownError: Selenium::WebDriver::Error::UnknownError: unknown error: path is not absolute: public/images/pl.png
(Session info: headless chrome=74.0.3729.157)
|
click_on "Log in" | ||
|
||
visit Node.last.path | ||
drop_in_dropzone("#{Rails.root.to_s}/public/images/pl.png", false) |
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.
ERROR["test_uploading_by_dragging", #<Minitest::Reporters::Suite:0x0000560da661a738 @name="CommentUploadTest">, 367.67084992700006]
test_uploading_by_dragging#CommentUploadTest (367.67s)
Selenium::WebDriver::Error::JavascriptError: Selenium::WebDriver::Error::JavascriptError: javascript error: fileList is not defined
(Session info: headless chrome=74.0.3729.157)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.4.0-101-generic x86_64)
test/system/comment_upload_test.rb:35:in `drop_in_dropzone'
test/system/comment_upload_test.rb:15:in `block in <class:CommentUploadTest>'
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.
hmm, now:
FAIL["test_viewing_the_dashboard", #<Minitest::Reporters::Suite:0x000055d036d2a5f8 @name="DashboardTest">, 322.3365901269999]
test_viewing_the_dashboard#DashboardTest (322.34s)
expected to find visible css ".row.header > h1" with text "Dashboard" but there were no matches. Also found "Community research", which matched the selector but not all filters.
test/system/dashboard_test.rb:19:in `block in <class:DashboardTest>'
[Screenshot]: tmp/screenshots/failures_test_uploading_by_dragging.png
ERROR["test_uploading_by_dragging", #<Minitest::Reporters::Suite:0x00007ffaf958f5b0 @name="CommentUploadTest">, 325.9385120889999]
test_uploading_by_dragging#CommentUploadTest (325.94s)
Selenium::WebDriver::Error::JavascriptError: Selenium::WebDriver::Error::JavascriptError: javascript error: Cannot read property 'listeners' of undefined
(Session info: headless chrome=74.0.3729.157)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.4.0-101-generic x86_64)
test/system/comment_upload_test.rb:32:in `drop_in_dropzone'
test/system/comment_upload_test.rb:15:in `block in <class:CommentUploadTest>'
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 think this is actually because JavaScript methods aren't waiting for selectors to find things... so i'm going to insert a assert_selector()
to get it to wait.
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.
If this doesn't work, we might try to do a jQuery.ready(...
kind of thing
|
d8197ea
to
8bfea12
Compare
OK, still not waiting to instantiate the function... |
Great!!! |
Re: #5229