OUR NEWS
Our News / Web application acceptance tests
5/11/2019

Web application acceptance tests

in gitlab-ci using codeception and selenium installed as docker container
Let's assume we are running acceptance tests of our application during the testing stage in gitlab-ci. The runner starts the container with our web app, and then executes codeception acceptance tests using the selenium server using the google chrome browser. We are using a local gitlab server with a registered runner to execute our tests..gitlab-ci.yml looks like this:

job:
  services:
  - name: postgres:alpine
  alias: postgres
  - name: redis:alpine
  alias: redis
  - name: selenium/standalone-chrome
  alias: chrome
  - name: tophfr/mailcatcher
  alias: smtp
What could possibly go wrong? Actually, everything could go wrong. The problem is that selenium is a service in gitlab-ci.yml and it does not know the runner's executor container IP address and cannot reach it by host name.
Indeed, if you check the executor's host file you will see something like this:

$ cat /etc/hosts
127.0.0.1 localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0   ip6-localnet
ff00::0   ip6-mcastprefix
ff02::1   ip6-allnodes
ff02::2   ip6-allrouters
172.17.0.8    chrome 9a7c560fcc81
172.17.0.9    tophfr__mailcatcher 47ca8ed9a04a
172.17.0.9    tophfr-mailcatcher 47ca8ed9a04a
172.17.0.9    smtp 47ca8ed9a04a
172.17.0.8    selenium__standalone-chrome 9a7c560fcc81
172.17.0.8    selenium-standalone-chrome 9a7c560fcc81
172.17.0.10   runner-fc308d01-project-17- concurrent-0
But, if we look in the host file of the selenium container you won't see any information about our web app container (runner-fc308d01-project-17-concurrent-0 with IP address 172.17.0.10)

127.0.0.1   localhost
::1         localhost ip6-localhost ip6-loopback
fe00::0	    ip6-localnet
ff00::0	    ip6-mcastprefix
ff02::1	    ip6-allnodes
ff02::2	    ip6-allrouters
172.17.0.8 	564756c8670d
This problem is something unexpected but, is not new. I have found a 2-year old issue on gitlab
https://gitlab.com/gitlab-org/gitlab-runner/issues/1042
However, container linking (including containers in the same network) is still not implementing in gitlab. So, the main container is able to call the service container, but the service container cannot call the main container.
One possible workaround can be the usage of environmental variables to deliver the container's IP address into the codeception config and test files.
We can grab the container's IP address from the main container's host file. It can be done directly in .gitlab-ci.yml

script:
- export WEB_APP_IP="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
# will set WEB_APP_IP environment variable to 172.17.0.10
- export SMTP_IP=$(grep 'smtp' /etc/hosts | awk '{print $1}')
# will set SMTP_IP environment variable to 172.17.0.9
Now we can use the WEP_APP_IP variable to set the page URL in the acceptance.suite.yml

class_name: AcceptanceTester

modules:
  enabled:
    - WebDriver:
        host: chrome
        port: 4444
        browser: chrome
        window_size: 1024x768
        url: 'http://%WEB_APP_IP%'
        capabilities:
          unexpectedAlertBehaviour: 'accept'
    - Asserts
don't forget to specify params: env in codeception.yml

namespace: frontend\tests
actor: Tester
paths:
  tests: tests
  log: tests/_output
  data: tests/_data
  helpers: tests/_support
settings:
  bootstrap: _bootstrap.php
  colors: true
  memory_limit: 1024M
modules:
  config:
    Yii2:
      configFile: 'config/test-local.php'
params: env
If you need to call one service container from another service container during your codeception test script MyCest.php, you can obtain the service container IP address from PHP
$this->mailClientURL = 'http://'.getenv('SMTP_IP');
OTHER NEWS
Moving Online Companies Offline For One Night
For the second year in a row, the Cappers team organized an event for our local clients and partners at the Oakville Towne Square Art Gallery. While our clients range from website ...
Our News
16
October2023
Workflow Automation: Streamlining Complex Employee Onboarding with Cappers' platform
See how Cappers' HIPAAtizer helped streamline a company's complex employee onboarding process.
Our News
17
July2023
Challenges and Solutions in Moving Psychological Assessments Online
As healthcare processes increasingly move online, many of our clients are looking to digitize their intake forms and related documents. Among the most challenging forms are psychological...
Blog
17
May2023
Cappers is HIPAA Compliant! Let Us Secure Your Healthcare-Related Websites
Over the last three years, we've seen an explosion in the demand for healthcare-related applications and websites.
Our News
10
April2023
Canada Post API Integration: Simplifying Shipping For Your E-Commerce Store
Reduce cart abandonment and manage your growing business by fully integrating your e-commerce site with Canada Post's API integration features.
Our Technologies
24
March2023
WordCamp Montclair
Cappers' team attended the first post-Covid in-person WordPress industry event. WordCamp 2022, Montclair, New Jersey.
Our News
8
July2022
HIPAAtizer and Technical Safeguards
Making your WordPress site HIPAA Compliant means meeting all the requirements set out by the Health and Human Service
Our News
1
July2022
Stripe Integration
Custom web application with Stripe Integration.
Our News
16
March2022
We announce the Year of 2022 is the Year of Integration
Cappers has declared 2022 to be the Year of IT Integration for Small and Medium businesses!
Our News
14
February2022
HIPAA COMPLIANT WEBSITE
Cappers Applications has developed a HIPAA compliant website for Family Dentistry of San Antonio. HIPAA is an act that regulates that all PHI (Protected Health Information) is secured. Any patient information like name, address, phone, date of birth, email or any medical record is considered to be PHI.
Blog
15
October2021
Cappers ranked as IOS app development agency
Cappers Applications has been recognized as Top 30 IOS app development companies in 2021 by DesignRush. Cappers Applications has been recognized as Top 30 IOS app…
Our News
14
October2021
Volunteer development - The rapid testing kit program page for BCC website
Cappers helped Burlington Chamber of Commerce to build a new page. The project was accomplished in just 2 days.Further, 47 appointments were booked, and 4,700+ kits were distributed before June 1.
Our News
9
June2021
Thinking about changing website content?
You can change your website content at anytime, without the help of Developers. The WordPress CMS development allows you to update posts, add new images and videos, on a daily basis. Capper's Customized Themes are user-friendly and easily adaptable for any user group which will provide an easier way in creating content for the website. Our Customized Theme structure has the ability to expand and incorporate professional or personal blogs on the websites.
Our News
16
April2021
Helpdesk feature
We have something NEW we want to share with all of you. We have created a Helpdesk feature to stay in touch and keep track of your technical needs. Inside this new feature, you can create a new support ticket, check your status, and call for support.
Our News
11
March2021
Revamp of a Pet Microchip Website
Our long term client approached us to update his website.
Our News
30
July2020
Opportunities to streamline processes and reduce costs
Have you had thoughts about how you can make changes to improve your business for our NEW normal? As small businesses are slowly reopening, this is still an unknown time.
Our News
21
May2020
Support in remote operations and ongoing projects
During COVID-19, we have been staying connected with our clients in support of improvement in remote operations and ongoing projects.
Our News
5
May2020
COVID-19: Maintaining the safety of our staff and clients.
Just like you, we have been doing our very best to navigate the COVID-19 crisis in a way that is both responsive and responsible, while maintaining the safety of our staff and clients.
Our News
31
March2020
FinTech Events in Chicago
Last week, I had the opportunity to attend the Digital Innovations and Challenges in FinTech & Financial Services event in Chicago.
Our News
4
March2020
IESE Alumni Event
Last week I had the pleasure to be a presenter at the IESE Alumni Event. It was great to meet peers from IESE Business School and exchange ideas about Innovation, AI, and Blockchain.
Our News
25
February2020
FinTech Mobile Application
We are happy to announce our most proudest project, FinTech mobile app. The app was developed to utilize the latest tech stack.
Our Technologies
24
January2020
REST Design Methodology
Here's a helpful tip, when developing an API, stick to the REST design methodology. Here we'll describe the requirements for the REST architecture.
Our News
19
December2019
API Contract
Ask any IT person, what's the stumbling block in the Web Application Development? Majority of the time, the answer is the contract between the front-end and back-end teams.
Our News
5
December2019
Pitch Club in Detroit
Last week, I had the opportunity to attend an event called Pitch Club in Detroit. We had 3 companies present and may the best company win, with their Pitch.
Our News
7
November2019
Small Business Week in Halton Region
It has been a busy yet productive week, coming back from the long Thanksgiving weekend. This week within our community, it was Official Small Business Week in Oakville and Burlington.
Our News
24
October2019
An easy way to update reviews on your website
Sign up for 11am.io today and have reviews not only on Google, FB and other platforms but also on your website, if the customer would like to leave a review directly.
Our Technologies
11
October2019
Had a great time at the Digital Summit in Detroit
Had a great time at the Digital Summit in Detroit. I listened, learned and connected with some great people. I wanted to share with everyone some of my personal take aways during the Summit.
Our News
1
October2019
Google Chrome extension for MDland
As the world evolves and your company expands, there are many difficult obstacles you can come across. One particular challenge is adding a new web application that seamlessly integrates with already existing programs.
Our Technologies
11
September2019
Online reputation management
Are you a Digital Agency or Digital Expert where you help to Small Businesses improve local SEO? Cappers Application has developed a new way to help Digital Agencies that work on local SEO for their clients. 11am.io
New Applications
5
September2019
Cappers Applications Inc.
Welcome to our new, lighter and faster website. With the use of Gatsby - JavaScript site generator, we are able to create a static website, which combines the latest technology, ReactJS and GraphQL.
Our News
11
August2019