Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented May 3, 2019

Re: #5229

@plotsbot
Copy link
Collaborator

plotsbot commented May 3, 2019

1 Message
📖 @jywarren Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.

Generated by 🚫 Danger

click_on "Log in"

visit Node.last.path
drop_in_dropzone 'public/images/pl.png'
Copy link
Member Author

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)

@jywarren
Copy link
Member Author

rails aborted!
SyntaxError: /app/test/system/comment_upload_test.rb:15: syntax error, unexpected ',', expecting ')'
t.to_s}/public/images/pl.png", false)

click_on "Log in"

visit Node.last.path
drop_in_dropzone("#{Rails.root.to_s}/public/images/pl.png", false)
Copy link
Member Author

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>'

Copy link
Member Author

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>'

Copy link
Member Author

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.

Copy link
Member Author

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

@jywarren
Copy link
Member Author

ERROR["test_uploading_by_dragging", #<Minitest::Reporters::Suite:0x0000556429c29060 @name="CommentUploadTest">, 75.03885131300001]
 test_uploading_by_dragging#CommentUploadTest (75.04s)
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:34:in `drop_in_dropzone'
            test/system/comment_upload_test.rb:17:in `block in <class:CommentUploadTest>'

@jywarren jywarren force-pushed the comment-upload-drag branch from d8197ea to 8bfea12 Compare May 22, 2019 02:46
@jywarren
Copy link
Member Author

OK, still not waiting to instantiate the function...

@VladimirMikulic
Copy link
Contributor

VladimirMikulic commented Jan 16, 2020

@jywarren this can be closed #7255 resolves this also. (image drag and drop)

@jywarren jywarren closed this Jan 16, 2020
@jywarren
Copy link
Member Author

Great!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants