Development Environment Configuration with VSCode, Ruby, Cucumber
Large projects come up with some challenges, and this shouldn’t be news to anyone. In many of these projects, the QA team has to be quick while testing. Setting aside the reasons behind this, how can we ensure that tests will be passed faster and more reliably without bugs?
The solution is running automated tests in addition to manual testing. Even though manual testing may be cheaper and more beneficial in the short term, automated testing will be more effective and quantifiable in the long term..
In this blog, I will go through setting up the environment for automated UI tests. The preferred methods differ according to the structure of the projects, kloia generally recommends using a stack of Ruby, cucumber, capybara trio.
Before talking about their core concepts, let’s prepare the environment.
Bundler helps you manage gem dependencies and Gemfile is where you declare versions of every gem.
# install bundler
$ gem install bundler
Step 4 - VSCode Configuration
VScode is a source code editor for Windows, Linux and macOS. It is free and includes support for debugging. Visit VSCode page (visit https://code.visualstudio.com) to download it. The installation is simple and straight-forward.
After installing the editor, we can go on with installing extensions.
Extension 1 - Ruby
Go to Extensions from left side bar. Search for “Ruby”. Then install it.
Extension 2 - Cucumber (Gherkin) Full Support
It adds support for Gherkin syntax in VSCode for writing Cucumber scenarios.
Extension 3 - Snippets and Syntax Highlight for Gherkin (Cucumber)
This extension makes it easier to create Cucumber scenarios by syntax highlighting and snippets.
Extension 4 - Gherkin Indent
It automatically sets indentation and applies coloring for .feature files.
Extension 5 - vscode-icons
It brings icons to your projects.
The most important key combination to know is ⇧⌘P, which brings up the Command Palette. Open Command Palette, then type "activate vscode-icons” and click on it.
You are set!
In this post I walked you through setting up the development environment for Cucumber with Ruby on VSCode editor. In my next post, I'm going to show how to create a Cucumber project, debug in step definitions and run scenarios using the terminal.
Follow us on Twitter and sign up for our mailing list to get the most recent news on DevOps and test automation.