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

Try system testing image upload in comments #5526

Closed
wants to merge 18 commits into from
Closed

Conversation

jywarren
Copy link
Member

Re: #4515

@plotsbot
Copy link
Collaborator

plotsbot commented Apr 18, 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

@jywarren
Copy link
Member Author


ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x0000563e36b25938 @name="SearchTest">, 172.45404957999995]
 test_adding_an_image_into_a_comment_box#SearchTest (172.45s)
Capybara::FileNotFound:         Capybara::FileNotFound: cannot attach file, /public/images/pl.png does not exist
            test/system/comment_test.rb:12:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

OK, seeing this in #5525,


ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x0000558e1c3aa778 @name="SearchTest">, 51.962133810999944]
 test_adding_an_image_into_a_comment_box#SearchTest (51.96s)
Selenium::WebDriver::Error::SessionNotCreatedError:         Selenium::WebDriver::Error::SessionNotCreatedError: session not created: Chrome version must be between 70 and 73
          (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.4.0-101-generic x86_64)
            test/system/comment_test.rb:8:in `block in <class:SearchTest>'
ERROR["test_searching_an_item_from_the_homepage", #<Minitest::Reporters::Suite:0x0000558e1c3693e0 @name="SearchTest">, 52.75852011400002]
 test_searching_an_item_from_the_homepage#SearchTest (52.76s)
Selenium::WebDriver::Error::SessionNotCreatedError:         Selenium::WebDriver::Error::SessionNotCreatedError: session not created: Chrome version must be between 70 and 73
          (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.4.0-101-generic x86_64)
            test/system/search_test.rb:6:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author


ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x0000558019b01b18 @name="SearchTest">, 23.429040612999984]
 test_adding_an_image_into_a_comment_box#SearchTest (23.43s)
Authlogic::Session::Activation::NotActivatedError:         Authlogic::Session::Activation::NotActivatedError: You must activate the Authlogic::Session::Base.controller with a controller object before creating objects
            test/system/comment_test.rb:6:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

Nice,

ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x000055ef9a3407a8 @name="SearchTest">, 144.26856237699997]
 test_adding_an_image_into_a_comment_box#SearchTest (144.27s)
Capybara::ElementNotFound:         Capybara::ElementNotFound: Unable to find file field "Image" that is not disabled
            test/system/comment_test.rb:17:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

OK, here's what we have to work with:

 
  | <!-- http://stackoverflow.com/questions/11235206/twitter-bootstrap-form-file-element-upload-button -->
  | <label id="input_label" class="" for="fileinput">
  | <input id="fileinput" type="file" name="image[photo]" style="display:none;" />
  | <a onClick="handleClick()" class="hidden-xs">choose one</a>
  | <span class="visible-xs">
  | <i class="fa fa-upload"></i>
  | <a>Upload image</a>
  | </span>
  | </label>
 ```

@jywarren
Copy link
Member Author

Ah, this probably needs us to log in!

@jywarren
Copy link
Member Author

Just like in #5605

@jywarren
Copy link
Member Author

jywarren commented May 1, 2019

oooo getting closer:

[Screenshot]: tmp/screenshots/failures_test_adding_an_image_into_a_comment_box.png
ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x000055e52d05d918 @name="SearchTest">, 8.986399215000006]
 test_adding_an_image_into_a_comment_box#SearchTest (8.99s)
Capybara::ElementNotFound:         Capybara::ElementNotFound: Unable to find visible file field "fileinput" that is not disabled
            test/system/comment_test.rb:23:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

jywarren commented May 1, 2019

Yes!!

ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x000055f776b09bb8 @name="SearchTest">, 66.17287086900001]
 test_adding_an_image_into_a_comment_box#SearchTest (66.17s)
Capybara::ElementNotFound:         Capybara::ElementNotFound: Unable to find css "comment-form"
            test/system/comment_test.rb:23:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

jywarren commented May 7, 2019


ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x0000564b84e473b8 @name="SearchTest">, 113.30305907000002]
 test_adding_an_image_into_a_comment_box#SearchTest (113.30s)
Capybara::ElementNotFound:         Capybara::ElementNotFound: Unable to find file field "#fileinput" that is not disabled
        Note: It appears you may be passing a CSS selector or XPath expression rather than a locator. Please see the documentation for acceptable locator values.
        
        
            test/system/comment_test.rb:24:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

jywarren commented May 8, 2019

Hmm, back

ERROR["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x000055bace623f98 @name="SearchTest">, 361.415172644]
 test_adding_an_image_into_a_comment_box#SearchTest (361.42s)
Capybara::ElementNotFound:         Capybara::ElementNotFound: Unable to find visible file field "image[photo]" that is not disabled
            test/system/comment_test.rb:29:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

jywarren commented May 8, 2019

Oh! I think we hide the file field to make it look nicer. We should confirm then check we can set it to visible: false maybe?

@jywarren
Copy link
Member Author

jywarren commented May 8, 2019

Yeah!!!!

image

@jywarren
Copy link
Member Author

jywarren commented May 8, 2019

yay!


 test_adding_an_image_into_a_comment_box#SearchTest (35.82s)
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.131)
          (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_test.rb:31:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

jywarren commented May 8, 2019

 test_adding_an_image_into_a_comment_box#SearchTest (425.54s)
        expected to find css "h1" but there were no matches
        test/system/comment_test.rb:19:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

jywarren commented May 9, 2019

Yeah!!

test_adding_an_image_into_a_comment_box#SearchTest (280.69s)
        expected to find css ".comment-form textarea#textinput" but there were no matches
        test/system/comment_test.rb:39:in `block in <class:SearchTest>'
[Screenshot]: 

@jywarren
Copy link
Member Author

jywarren commented May 9, 2019

 FAIL["test_posting_from_the_editor", #<Minitest::Reporters::Suite:0x00007fa4466582a8 @name="PostTest">, 15.851468299999965]
 test_posting_from_the_editor#PostTest (15.85s)
        expected to find visible css "h1" with text "My new post" but there were no matches. Also found "<<ERROR>>", which matched the selector but not all filters. 
        test/system/post_test.rb:28:in `block (2 levels) in <class:PostTest>'
        test/system/post_test.rb:40:in `assert_page_reloads'
        test/system/post_test.rb:25:in `block in <class:PostTest>'

[Screenshot]: tmp/screenshots/failures_test_adding_an_image_into_a_comment_box.png
 FAIL["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x00007fa446dfa358 @name="SearchTest">, 280.68496794200007]
 test_adding_an_image_into_a_comment_box#SearchTest (280.69s)
        expected to find css ".comment-form textarea#textinput" but there were no matches
        test/system/comment_test.rb:39:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

Hmm, looks like we aren't logged in?

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

@jywarren
Copy link
Member Author

 FAIL["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x00005653a520c700 @name="SearchTest">, 359.68991953500006]
 test_adding_an_image_into_a_comment_box#SearchTest (359.69s)
        expected to find css "textarea#textinput" but there were no matches
        test/system/comment_test.rb:39:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

 FAIL["test_adding_an_image_into_a_comment_box", #<Minitest::Reporters::Suite:0x00007f32e5f175d8 @name="SearchTest">, 68.09862459699997]
 test_adding_an_image_into_a_comment_box#SearchTest (68.10s)
        expected to find visible css "textarea#text-input" with text "![](/some/imageid.png)" but there were no matches. Also found " ", which matched the selector but not all filters. 
        test/system/comment_test.rb:39:in `block in <class:SearchTest>'

@jywarren
Copy link
Member Author

OK! So the test is working, almost! I think perhaps we have to wait longer for the image to come back down?

@jywarren
Copy link
Member Author

Solved in #7255 !!!

@jywarren jywarren closed this Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants