DevOps Testing with Ruby RSpec Selenium and Capybara using Docker-Compose

I watched LinkedIn training “DevOps Foundations” with Carlos Nunez instructor. In section 3 he shows the use of RSpec and Capibara. I’ll extend a little bit as that section assumes a lot of things from the instructor side.

Step number 1 launches a Docker container with the Nginx web server. That is ok. Then he starts a second container which is Selenium.

Both containers use docker-compose. Nginx is launched with a Docker file. Selenium is not, instead just a raw image is downloaded.

Instructor launches a third container, which contains Rspec and Capybara. This container is specified again with a docker file

What is omitted is an explanation of Selenium, Capybara and RSpec. So let’s start.

Selenium is a web browser instance with an API tailored to be run from a container. The image used here also has a VNC server which is useful when using containers.

Capybara is a Test Framework with support to multiple languages.

RSpec is the ruby DSL.

Why we are using this combo is not explained.

Let’s see my containerfs launched with docker-compose:


Customize your terminal with Oh-my-zsh for Fedora

I have customized my Linux Terminals. Terminals I use are Terminator and Terminology. I use zsh Shell and Oh-My-Zsh framework to add some cool functionality.

For instance, a cool prompt with git integration. I see a git notification in the prompt telling me that 1 file was modified and 11 files are not tracked. It is a summary from git status.

Cool command line plus git integration.

Nice Icons showing folders and file types …

Cool icons associated to files

Tab completion. Type tab key to complete path. You can use arrow keys to navigate files and folders.

Tab completion and navigation.

Command line Fuzzy finder. Type Ctrl-r in terminal then type command to look for. You will get a list of previous commands typed before associated to search.

Type Ctrl-r then pattern. You have option to navigate with arrow keys

Plugins. The git plugin, for instance, shows me all the options for git when typing git then Tab Tab.

Git plugin shows git sub commands.

Use it with tmux!

Tmux adds nice footer

Quick steps to achieve this setup.

Install zsh

Install nerd and awesome fonts

Install oh-my-zsh

Install powerlevel10k

Install syntax highlighting and autosuggestion

install fzf then run install

More about fzf here:h