Git Product home page Git Product logo

how-do-i-qa's Introduction

How do I QA?

Introduction to acceptance testing

FORK THE PROJECT!

(Forking is creating your own instance of the project, where you can make all the changes you want, and commit your specs without spoiling the fun to anyone else. To fork the project, look for Fork button at the top right corner of this page.)

Dependencies

Download and set these up first.

  1. MacOS up to date (older versions may not allow you to install Xcode)

  2. Xcode (download from AppStore, run and accept the T&C):

  • In OSX 10.9+ you may need to install xCode command tools to allow you to install libiconv. xcode-select --install
  1. Ruby 2.3.8
  • Install RVM (if you don't have it) \curl -sSL https://get.rvm.io | bash

  • Install Ruby 2.3.8 rvm install "ruby-2.3.8"

  1. Postgres (database)
  • Install Homebrew (package manager) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • Install Postgres using Homebrew brew install postgresql

  • Check if Postgres is running brew services list

If you see the message that postgresql has started (https://monosnap.com/file/cSP6KmYmNlVRRHTE1ylJMxlXfh5PCS) then you are ok to go. If not, run: brew services start postgresql

And check again.

  1. Libraries for nokogiri gem One of the gems - nokogiri - requires few libraries to be installed first:
  • Install libraries: brew install libxml2 libxslt libiconv

  • You may need to link libiconv brew link libiconv

Database setup

We're using postgres. Make sure it's running :) Then log in to template with this command line:

Ubuntu: sudo -u postgres psql template1 MacOS: psql template1

You will now be in psql command line. After that in the console run the development setup script - this script is already filled in with passwords, etc. If you want to change any of the information in there you will need to change it also in database.yml later!

In the pql console run: \i db/development_setup_script.sql (you can get the current path by typing pwd) Exit console by typing \q

Copy database.yml.sample to database.yml: cp config/database.yml.sample config/database.yml

Run bundle install to install all the needed gems (this step is complete once all gems listed by this command are green). Then rake db:reseed to populate development environment with example data. Load test database with rake db:test:load.

Troubleshooting

  1. Postgres user - in case you downloaded the Postgres app and created Super Admin here, remember the password you provided. If you cannot enter psql command line, run: psql --u postgres template1 and enter your Super Admin's password.

  2. If you cannot install nokogiri gem even after installing all libraries, try to install it by running: bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"

And then: bundle install

Credentials

Seeds have a user already created for you. [email protected] with password 12345678

Run server

rails s

To access the page, type http://localhost:3000/ in the browser address bar.

If you are getting an error about "Ignoring some gems" when running rails s (error: https://monosnap.com/file/zS6mWQeW0h7kMOAU2z0yjS9ansbxSA), try to run: gem pristine --all

Run specs (if any)

  • Run all specs: rspec spec

  • Run specific spec: rspec spec/features/nameOfSpec_spec.rb

Hints

  • To see the interface of Chrome browser add: js: true at the beginning of your spec, like this:

require 'rails_helper' feature 'my spec', js: true do end

  • To stop/freeze the spec running after the chosen step you can add: binding.pry which stops the spec and it lets you see what happened after the particular action. It also activates the rails/pry console in the terminal which you may use to debug your spec. REMEMBER to remove binding.pry after debugging the spec.

Change driver

In capybara.rb file (you can find it in spec/support/ folder) you can change driver to Headless (which means specs will run without running Chrome interface) by changing the line: Capybara.javascript_driver = :chrome to: Capybara.javascript_driver = :headless_chrome

how-do-i-qa's People

Contributors

mszweda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.