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

React Native encountered an unexpected issue during the execution of com.android.build.gradle.internal.tasks.Workers$ActionFacade

Error: Resource android:attr/IStar not found Everything was working fine last week, but all of a sudden this error popped up. https://i.stack.imgur.com/w2567.png I've tried several solutions to fix it without any success. Here are the methods I att ...

What seems to be the issue with this Discord.js kick command code? It's not

Okay, so I'm in the process of creating a kick command for my Discord bot. The issue I'm encountering is that when no reason is specified or if a user is not mentioned to be kicked, the bot responds correctly but does not actually kick the user. ...

Struggling to connect to Node/Express Backend

I have developed a backend service using Node and Express. However, I am encountering an issue where none of the routes for this application are being accessed. Despite expecting to see an error message in the console if the routes were misconfigured, no s ...

invoke two JavaScript functions without displaying any message

I'm facing an issue with Ajax as it's not displaying the message I intend to show. Let me elaborate. Within my PHP code, there is an input tag: <input type="submit" id="login_button_add" name="submit" value="Add" onclick="add_building(); sho ...

Tap to reveal additional information with the power of Jquery and ajax

I have a question regarding the popup slide functionality. I would like to achieve the following: Currently, I am using the following code to display post details upon clicking: function getPostDetails(id){ var infoBox = document.getElementById("in ...

Encountering an error when trying to use `gulp -v`

I have installed gulp on my Vagrant machine (Ubuntu box) using the following commands: sudo apt-get install nodejs npm sudo npm install -g gulp After running gulp -v, I encountered the following error: vagrant@laravel:/var/www$ gulp -v node.js:201 ...

Learn how to set up a personalized command to execute my npm package

Recently, I developed an npm package called chat in nodejs. As of now, it is not yet available on npm. The package consists of two main files - server.js and client.js. Previously, I used to execute node server.js and node client.js separately to run these ...

React Native ScrollView ref issue resolved successfully

I'm trying to automatically scroll to the bottom of a flatlist, so here's what I have: const scrollViewRef = useRef(); //my scroll view <ScrollView ref={scrollViewRef} onContentSizeChange={() => { scrollViewRef.current.scr ...

Encountering issues with npm installation when running `eb create` on Node version 6.2.2

Is anyone else encountering this problem? 1620 verbose unsafe-perm in lifecycle false 1621 info <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="385a4d5e5e5d4a4d4c51547809160a1609">[email protected]</a> Failed to ...

Having difficulty completing the text field and submitting it automatically

My goal is to automatically fill in the "Reason for Access" text box with the word "TEST" using Tampermonkey. I am new to using Tampermonkey and UserScript, so I appreciate your patience. Currently, I am facing an issue where the "Reason for Access" field ...

Tips for formatting input boxes on the client side

Q: How can I format my textbox so that when a user enters a number, such as one, it will be displayed as 0000001? The goal is to have any number entered be shown in 7-digit format. ...

Refresh the current page with jQuery Mobile when it is clicked

I have a multi page template in jQuery Mobile. How can I refresh the current page when clicking on a hyperlink or button? I am using JQM version 1.4.5 Despite trying the code suggested in how to refresh(reload) page when click button in jQuery Mobile, it ...

What is React.js's approach to managing CSS files?

Currently, I am enrolled in Bootcamp at Scrimba where they utilize an online platform for teaching various courses. One of the topics covered is React and involves working with CSS files. When working on my local machine, I typically use the index.css file ...

ReactJS - Error: Attempting to access the property 'raw' of an undefined variable

I'm currently facing an issue where I am trying to extract specific data from a particular part of an api. Surprisingly, I can view all the data in the console. { "id":"DszAeHV8zfQ", "created_at":"2020-01-28T19:41:06-05:00", "updated_at":"2020 ...

The process of organizing and arranging the content that appears on a webpage is in

Seeking a solution to achieve a similar effect like this example. Wanting the sections to transition nicely when clicked on. Should I use a Jquery plugin or implement it with CSS? ...

How can I dynamically insert a variable string into a link tag using React and TypeScript?

I am just starting out with javascript and typescript, and I need to generate a link based on certain variables. I am currently facing an issue trying to insert that link into <a href="Some Link"> Some Text </a> Both the "Some Text" and "Som ...

Typescript error: Cannot access property "status" on type "never".ts(2339)

Currently, I have a method that utilizes nextjs/auth to sign in with credentials from a form. However, I am encountering a type checking error Object is possibly 'undefined'.ts(2532) const doStuff = async (values: any) => { const result: S ...

Why are imported modules unable to reach global variables in Node?

As I delve deeper into using ES6 and organizing my code across multiple files for better readability and version control, I've encountered an issue that has me puzzled. In one of my scenarios, I have a class defined in a separate file called class.js, ...

Angular Controller encounters issue with event handler functionality ceasing

One of my Angular controllers has the following line. The event handler works when the initial page loads, but it stops working when navigating to a different item with the same controller and template. document.getElementById('item-details-v ...

Determine whether either of these elements has the mouse hovering over it using jQuery

In my DOM, I have two separate elements that need to change when either one is hovered over. If the link is hovered over, not only does the image src need to change (which is easy), but also the link color needs to change. Similarly, if the image is hovere ...