Issue encountered while running the TestCafe Docker Image within a GitLab CI job. Attempting to run automated end-to-end tests on BrowserStack

We are currently attempting to execute end-to-end tests using testcafe on BrowserStack triggered by a gitlab CI job. Unfortunately, an error keeps appearing:

Error: spawn /home/user/.browserstack/BrowserStackLocal ENOENT

Our approach involves implementing Option 1 - Utilizing the TestCafe Docker Image as outlined at , which incorporates an end-to-end testing job into our .gitlab-ci.yml file. In this process, we have set up a job base named .base_e2e, utilized in the e2e_dev job (refer to below)

Additionally, we rely on the

testcafe-browser-provider-browserstack
npm dependency to enable the execution of testcafe end-to-end tests on BrowserStack, mentioned here:

Here is a snippet showing the gitlab CI job error encountered:

Running with gitlab-runner 11.7.0 (8bb608ff)
  on ec2-docker-runner 1c5ac6dc
Using Docker executor with image testcafe/testcafe ...
Pulling docker image testcafe/testcafe ...
Using docker image sha256:f4d0d6abb93c9 for testcafe/testcafe ...
Running on runner-1c5ac6dc-project-7261073-concurrent-0 via ip-10-250-5-194...
Fetching changes...
Removing build/
Removing coverage/
Removing node_modules/
Removing stats.json
HEAD is now at 8574401 Add space before script property
Checking out 8574401c as feature/e2e-on-pipeline...
Skipping Git submodules setup
Downloading artifacts for install_dependencies (150115951)...
Downloading artifacts from coordinator... ok        id=150115951 responseStatus=200 OK token=yMPpwZa1
Downloading artifacts for test (150115953)...
Downloading artifacts from coordinator... ok        id=150115953 responseStatus=200 OK token=pjsisESV

$ /opt/testcafe/docker/testcafe-docker.sh "browserstack:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="87c4eff5e8eae2c7b2b4a9b7">[email protected]</a>:Windows 10" tests/e2e

....

The complete.gitlab-ci.yml file

image: node:8-alpine

stages:
- e2e

#############
# Job Bases #
#############
.base_e2e:
  stage: e2e
  image:
    name: testcafe/testcafe
    entrypoint: ["/bin/sh", "-c"]
  script:
    - /opt/testcafe/docker/testcafe-docker.sh "browserstack:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b9fad1cbd6d4dcf98c8a9789">[email protected]</a>:Windows 10" tests/e2e

#############
# Jobs      #
#############
e2e_dev:
  extends: .base_e2e
  variables:
    ENVIRONMENT: dev
    TEST_E2E_APP_URL: https://$ENVIRONMENT.example.com
  only:
    - /^feature/.*$/
    - /^fix/.*$/
    - /^bug/.*$/
  when: manual

Additional details

When running the command yarn i.e yarn test:e2e_pipeline, the end-to-end test gets executed flawlessly and a video recording of the automation uploads to BrowserStack without issues.

"scripts": {
    "test:e2e_all": "testcafe 'chrome,firefox' tests/e2e",
    "test:e2e_pipeline": "testcafe 'browserstack:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2d6e455f4240486d181e031d">[email protected]</a>:Windows 10' tests/e2e"
  },

Our package.json contains the following devDependencies

"devDependencies": {
    "testcafe": "^0.23.3",
    "testcafe-browser-provider-browserstack": "^1.7.0",
}

Answer №1

Unfortunately, using BrowserStack Local with the official TestCafe docker image is not possible. The TestCafe docker image is built on the alpine:edge image, which is not compatible with BrowserStack Local. The team behind BrowserStack Local has no plans to support Alpine Linux at this time. For more information and discussion on this issue, please refer to this thread: https://github.com/browserstack/browserstack-local-nodejs/issues/32. As a workaround, you may consider creating your own custom docker image based on an operating system supported by BrowserStack Local.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide to making a Grid element interactive using the Link component

PostsList component is responsible for rendering a list of posts. The goal is to enable users to click on a post item and be redirected to the specific post's link. const PostsListView = ({ posts, setError, isloggedin }) => { const [redirectCre ...

Steps to dynamically update a dropdown list with the value of another field

I am currently working on a dropdown list featuring all countries. Here is the code snippet: <select id="Country" onchange="country();"> <option id="3">Japan</option> <option id="4">Canada</option> <option id="5"> ...

Avoid using the JavaScript 'Sys.WebForms..' function if there is no ScriptManager present on the page

Currently, I am using a single JavaScript binding in the Master Page for my entire project. However, the Master Page does not include a ScriptManager. This means that some pages have Ajax components, such as UpdatePanel, while others do not. The 'Sys. ...

What are the benefits of using Lifery Ajax URLs?

I'm currently using the Grails portlets plugin and I'm exploring how to properly route AJAX methods. It seems like <portlet:actionURL> is only able to map to methods that return models for GSPs, while <portlet:resourceURL> doesn&apos ...

The function .play() cannot be executed on document.getElementById(...) - it is not a

There is an error in the console indicating that document.getElementById(...).play is not a valid function. import React from 'react'; const musicComponent=(props)=>{ const style={background:props.color} return( <div classN ...

What is the best way to disengage a loop of elements within an internship?

In my scenario, the DOM structure is as follows: <table id="campaigns"> <tr> <th>Name</th> <th>Status</th> </tr> <tr> <td>first data</td> </tr> <tr data- ...

Using jQuery, you can utilize the $.when() function with both a single deferred object and an

In my current jquery setup, I am working with two variables. trackFeatures - representing a single ajax request, and artistRequests - an array of ajax requests. I am looking for a way to create a condition that triggers when both trackFeatures and artist ...

How to use JavaScript and regex to control the state of a disabled submit button

I have a challenge where I need to activate or deactivate a submission button in a form called btn-vote using JavaScript. The button will only be activated if one of the 10 radio buttons is selected. Additionally, if the person-10 radio button is chosen, t ...

Having trouble updating attribute through ajax requests

How can I set attribute values using ajax-jquery? Here are some snippets of code: HTML_CODE ========================================================================== <div class="col"> <ul class="nav nav-pills justify-content-end& ...

Arrangement of 'const' variables within React Stateless Components

Consider a scenario where I have a straightforward React stateless component: const myComponent = () => { const doStuff = () => { let number = 4; return doubleNumber(number); }; const doubleNumber = number => { ...

Client-side sorting in jqGrid

I'm working with a tree-grid that has autoloading rows. My objective is to sort the grid by the tree column directly on the client side. However, every time I click on the column header to sort, it triggers an unnecessary Ajax call for sorting, when ...

jasmine and protractor test failing due to use of byID

My HTML markup is all set and valid. While using WebStorm to debug my test cases, I am able to view this specific element without any issues... <a id="privacyPolicy1234" on-tap="goPrivacyPolicy()" class="disable-user-behavior">Privacy Policy</a&g ...

Tips on utilizing React and Node to upload text as a file to Google Drive

Are you wondering how to incorporate React.js as the frontend and Node.js as the backend for uploading/reading files from Google Drive? In my attempts, I've tried writing a string as a text file and then uploading it to Google Drive by following this ...

Understanding the specific purpose and functionality of the "next()" parameter in express.js

As a newcomer to express.js, I have been diving into the documentation to understand its nuances. One particular aspect that caught my attention is the next parameter in express middleware, which supposedly triggers the following middleware function for th ...

attempting to link to an external style sheet hosted on Amazon S3

I am working on creating a widget or snippet of a website that can easily be added to another webpage by including a script tag for my JavaScript file hosted on Amazon S3 and a div element where content will be inserted. Even though I have uploaded the C ...

Creating a dynamic pulse effect using jQuery to manipulate CSS box-shadow

My goal is to create a pulsating effect using CSS box-shadow through jQuery. Despite my best efforts, the code I attempted failed to produce the desired smooth pulse effect with box-shadow. The code snippet I experimented with: <div class="one"> &l ...

The success function within the Ajax code is malfunctioning

I am currently utilizing express, node.js, and MySQL. The issue I am facing is that the success function inside my Ajax code is not working as expected. Below is the snippet of the Ajax code in question: function GetData_1(){ var state = $("#dpState_1"). ...

How to toggle the selection of all checkboxes in an AngularJS ng-repeat object array

Check out this Fiddle Example In my table, each row contains a checkbox and there is also a checkbox to check all rows and send the ID of the selected/all rows as JSON object. I have an array of objects from the server-side response (with pagination enab ...

I'm struggling to make this script replace the values within the table

I am struggling with a script that I want to use for replacing values in a google doc template with data from a google sheet. The script is able to recognize the variables and generate unique file names based on the information from the google sheet. Howev ...

transferring data between react components

I am currently working on breaking down code into smaller components, starting with the snippet below from Rows.jsx. I am struggling to grasp how props are passed between parent and child components. Despite reading several guides and articles, I remain un ...