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 Tests] Comment Reply on Questions #8845

Merged
merged 5 commits into from Dec 14, 2020

Conversation

noi5e
Copy link
Contributor

@noi5e noi5e commented Dec 14, 2020

Prerequisite: Merge #8801 First!

  • Add new fixtures for testing question comments (already exists in prerequisite PR):
    • node.yml
    • comment.yml
    • revision.yml
    • node_tags.yml
    • tags.yml
  • New test:
    • find first comment ID (the new comment fixture)
    • POST new comment with addComment
    • assert that comment text exists
  test 'question page: respond to existing comment with addComment' do
    visit "/questions/jeff/12-07-2020/can-i-post-comments-here"

    # find comment ID of the first comment on page
    parent_id = "#" + page.find('#comments-list').first('.comment')[:id]
    parent_id_num = /c(\d+)/.match(parent_id)[1] # eg. comment ID format is id="c9834"

    # addComment(comment text, submitURL, comment's parent ID)
    page.evaluate_script("addComment(\"no you can't\", '/comment/create/37', #{parent_id_num})")

    # check for comment text
    assert_selector("#{parent_id} .comment .comment-body p", text: 'no you can\'t')
  end

(This PR is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)

@gitpod-io
Copy link

gitpod-io bot commented Dec 14, 2020

@noi5e noi5e added outreachy testing issues are usually for adding unit tests, integration tests or any other tests for a feature labels Dec 14, 2020
Copy link
Contributor

@Sagarpreet Sagarpreet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome simple test 🎉
Can you paste screenshot also after running test in gitpod if possible?

@noi5e
Copy link
Contributor Author

noi5e commented Dec 14, 2020

@Sagarpreet thank you! I will test in GitPod as soon as it gets back up and running.

@cesswairimu said she was working on getting it back up.

@jywarren
Copy link
Member

In the short term if you can confirm no new test failures due to this (in comparison to main) we should be good to bypass Travis for now. Thank you!!! #8801 is merged, too!

@noi5e
Copy link
Contributor Author

noi5e commented Dec 14, 2020

@jywarren Thanks, ran the tests locally again. They look normal. Also resolved the conflicts.

@codeclimate
Copy link

codeclimate bot commented Dec 14, 2020

Code Climate has analyzed commit 2c432ae and detected 0 issues on this pull request.

View more on Code Climate.

@jywarren jywarren merged commit 1afa0a1 into publiclab:main Dec 14, 2020
@jywarren
Copy link
Member

Awesome!!!!

@noi5e noi5e deleted the test/question-comment-response branch December 14, 2020 22:50
@noi5e noi5e changed the title [Outreachy Comment Editor] New Test: Respond to Question Comment Testing: Comment Reply on Questions Dec 27, 2020
@noi5e noi5e changed the title Testing: Comment Reply on Questions [System Tests] Comment Reply on Questions Jan 23, 2021
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
…liclab#8845)

* create new question fixture

* new fixtures to tag node as question

* new comment fixture to test comment replies

* add new test: respond to question comment
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
…liclab#8845)

* create new question fixture

* new fixtures to tag node as question

* new comment fixture to test comment replies

* add new test: respond to question comment
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
…liclab#8845)

* create new question fixture

* new fixtures to tag node as question

* new comment fixture to test comment replies

* add new test: respond to question comment
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
…liclab#8845)

* create new question fixture

* new fixtures to tag node as question

* new comment fixture to test comment replies

* add new test: respond to question comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outreachy testing issues are usually for adding unit tests, integration tests or any other tests for a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants