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

Add some primitive system tests #5316 #5590

Closed
wants to merge 1 commit into from

Conversation

Isssabel
Copy link

Fixes #5316
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

Hello,
I saw the issue #5316 which is to brainstorm a list of critical full-stack system tests we should add and thought that I would like to take a try and help on that. I wrote a few primitive tests (they should pass when run $rails test test/system/search_test.rb). I know that there are still a lot of room for improvements on the code, but any guidance and suggestion would be very much appreciated! Right now the tests are testing click events of the button, and I will keep updating it once I have found more advanced syntax and testing method.
Screen Shot 2019-04-22 at 7 59 52 PM

@welcome
Copy link

welcome bot commented Apr 23, 2019

Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help.
Dangerbot will test out your code and reply in a bit with some pointers and requests.
Also please refer here for installation help 💿
There may be some errors, but don't worry! We'll work through them with you! 👍🎉😄
It would be great if you can tell us your Twitter handle so we can thank you properly?

@plotsbot
Copy link
Collaborator

3 Messages
📖 @Isssabel 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.
📖 Your pull request is on the master branch. Please make a separate feature branch) with a descriptive name like new-blog-design while making PRs in the future.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progress’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

end
end

class LoginSingUpTest < ApplicationSystemTestCase
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo in class name.


assert_selector('h2', text: 'Sign up to join the Public Lab community')

fill_in("username-signup", with: "Bob")
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are no assertions below this point. Please remove them.


assert_selector('h4', text: 'View questions by topic')
fill_in("taginput", with: "sensor")
# expect(page).to have_content("sensor")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove commented out code :)


assert_selector('h2', text: 'Results for Canon')
end
test 'aske a question' do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix typo.

assert_selector('h2', text: 'Results for Canon')
end
test 'aske a question' do
visit '/questions'
Copy link
Collaborator

Choose a reason for hiding this comment

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

You've visited this URL already. All assertions should be made in the previous visit. Can you please move the assertions from there to the first one and delete everything below this point?

@jywarren
Copy link
Member

Oh thank you so much @Isssabel this is really great. Thanks for your input @siaw23 as well. Very excited for these tests. 👍 tell us if we can help out more!

@SidharthBansal
Copy link
Member

Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks!

@SidharthBansal
Copy link
Member

As the person is inactive for more than a month, I am closing the PR. In case you want to push changes please feel free to open a new PR OR reopen this PR and add additional changes to it.
Thanks for contributing on Public Lab

@SidharthBansal
Copy link
Member

@Uzay-G @VladimirMikulic some more work for you. These tests may help you to create a new pr quickly and get it merged

@VladimirMikulic
Copy link
Contributor

Thanks, I'll see what I can do.

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.

Brainstorm a list of critical full-stack system tests we should add
7 participants