LearnToCode

Learning Software Automation Testing Ruby from scratch using cucumber

Installation

How to Setup [MacOS]

  1. Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install RVM
curl -L get.rvm.io | bash -s stable
source ~/.bash_profile

Then run rvm requirements and follow the instructions

  1. Install Ruby 2.5.1
rvm install 2.5.1
  1. Install Dependencies
  • Configure display socket lock file (unfortunately this had to be run every time you restart your laptop, alternatives are listed below)
mkdir /tmp/.X11-unix
sudo chmod 1777 /tmp/.X11-unix
sudo chown root /tmp/.X11-unix/
  • Install libav/avconv
brew install libav
  • Install CMake
brew install cmake pkg-config && sudo ln -s /usr/local/bin/make /usr/local/bin/gmake
  • Install mysql
brew install mysql
  1. Install Git
brew install git
  1. Configure Git
git config --global user.name "Your Name Here"
git config --global user.email "your-github-email@example.com"
  1. Generate Public Key
ssh-keygen # then, just press enter
  1. Add key to Github
cat ~/.ssh/id_rsa.pub # copy the content to github
  1. Clone the project
git clone git@github.com:github/{your project name}.git
cd {path}
  1. Copy .env file
cp env.sample .env
  1. Install bundler
gem install bundler
  1. Run bundle install
bundle install # or `bundle` for simpler command
  1. Installing Firefox ESR
  • Download firefox esr here

run and add it into application

  1. Go back to the folder and run cucumber to make sure everything is installed
cucumber --tag @initiate

Common Errors

  • JSON 1.8.5 error when running bundle, update your XCode or run xcode-select --install

Folder Structure

For your convenient please put the file based on the folder structure.

├── features
│   ├── scenarios
│   │   └── Basic101
│   ├── step_definitions
│   │   └── 101basicconsepts
│   ├── support
|   |   └── env