The npm script for running Protractor is encountering an error

Currently, I am facing an issue while trying to execute the conf.js file using an npm script. The conf.js file is generated within the JSFilesRepo/config folder after running the tsc command as I am utilizing TypeScript in conjunction with protractor-jasmine.

When I navigate to the cmd at the package.json level and input the following command:

protractor JSFilesRepo/config/conf.js

it runs smoothly. However, when attempting to run it through an npm script (npm run test) from the package.json level, I encounter an error

"scripts": {   
    "test": "node_modules/.bin/protractor JSFilesRepo/config/conf.js",
  },

Error message: Error: Could not locate update-config.json. Please execute 'webdriver-manager update' to fetch binaries.

I have already updated webdriver-manager. My assumption is that there might be a path-related issue.

Answer №1

When you run 'protractor JSFilesRepo/config/conf.js', it utilizes the global protractor setup for which you have already executed 'webdriver-manager update'.

However, when you run 'node_modules/.bin/protractor JSFilesRepo/config/conf.js', it uses the local protractor version within your project, and it seems like you haven't yet run 'webdriver-manager update' specifically for this local instance.

To fix this, simply execute '

./node_modules/protractor/bin/webdriver-manager update
' from the root directory of your project.

Answer №2

Include the following script in your package.json:

"scripts": {   
    "WDupdate":"node node_modules/protractor/node_modules/webdriver-manager/bin/webdriver-manager update",
    "test": "node_modules/.bin/protractor JSFilesRepo/config/conf.js"
 }

To execute, first run WDupdate, then proceed with your test command.

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

Using Vue's $emit method within a Promise

I am currently working on an image upload feature that is based on a Promise. Within the "then" callback, I am attempting to $emit an event named 'success'. Although my VueDevTools shows me that the success event has been triggered, the associate ...

What is the process for updating the Vue template during runtime?

Currently, I am working on a CMS-based Vue page. Within this page, there is a root container that contains two child containers structured as follows: <div id="app"> <div class="above-the-fold">...</div> <di ...

The absence of color gradations in the TypeScript definition of MUI5 createTheme is worth noting

Seeking to personalize my theme colors in MUI5 using TypeScript, I am utilizing the createTheme function. This function requires a palette entry in its argument object, which TypeScript specifies should be of type PaletteOptions: https://i.stack.imgur.com ...

What is the correct method for installing webpack 4.19.1 on my system?

Currently, my system is equipped with webpack version 4.27.5, however I am in need of downgrading to an older version 4.19.1. This task needs to be performed on Ubuntu. I attempted to uninstall the current version by running the following command: npm uni ...

Tips for performing an integration test on a material UI <Slider /> component using either userEvent or fireEvent

I'm facing some challenges while trying to perform an integration test on a material UI component. I can locate the slider element, but have not been successful in moving the slider and retrieving the new value. Can you provide any guidance on how to ...

Is hard coding permissions in the frontend considered an effective approach?

I'm in the process of creating an inventory management system that allows admin users to adjust permissions for other employees. Some permissions rely on others to function properly, and I need to display different names for certain permissions on the ...

Is there a way to verify if the password entered by the user matches the input provided in the old password field?

I am trying to compare the user's password with the one entered in the "oldPassword" input field. The challenge is hashing the input from the "oldPassword" field for comparison. How can I achieve this? Please review my ejs file and suggest improvement ...

Implementing a 'Load More' button for a list in Vue.js

I am currently working on adding a load more button to my code. While I could achieve this using JavaScript, I am facing difficulties implementing it in Vue.js. Here is the Vue code I have been working with. I attempted to target the element with the compa ...

Creating an automated sequence of $http requests to sequentially retrieve JSON files with numbered filenames in Angular 1.2

I have a series of JSON files (page1.json, page2.json, etc.) that store the layout details for our website pages. Initially, I would load each page's data as needed and everything was functioning smoothly. However, it is now necessary for all page da ...

I encountered an issue with rate-limiter-flexible where I received an error stating that the Lua redis() command arguments need to be either

I have implemented rate limiting using the rate-limiter-flexible library const redis = require('redis'); const { RateLimiterRedis } = require('rate-limiter-flexible'); This is the code snippet I am working with // Create a Redis client ...

Using an external module in a Vue SFC: a beginner's guide

Recently delving into Vue, I'm working on constructing an app that incorporates Typescript and the vue-property-decorator. Venturing into using external modules within a Single File Component (SFC), my aim is to design a calendar component utilizing t ...

Every time I execute Grunt, I am met with this message: The local npm module "grunt-contrib-copy" cannot be found. Have you installed it?

Struggling to get Grunt up and running here. Every time I try to run grunt, it throws a bunch of warnings at me: Local Npm module "grunt-contrib-copy" not found. Is it installed? Local Npm module "grunt-contrib-uglify" not found. Is it installed? Local ...

Implementing a configuration file into a client-side web application using asynchronous methods

Currently, I am facing a challenge with an SPA that is being developed using various custom components from different sources. The main issue at hand is how to initialize certain settings (such as Endpoint URLs) using a settings file that can be configure ...

I am creating an HTML page that incorporates p5.js, and the text I'm rendering

It seems like the draw loop is continuously refreshing every x seconds, causing this behavior. Is there a way to slow down or disable the frame update without affecting the video refresh rate? I was thinking of adding an fps counter and implementing an i ...

Guide on how to bypass IDM when downloading a PDF file through a GET request

When I try to fetch a PDF by sending a GET request to the server and open it in a new tab, IDM interrupts my request and downloads the file instead. It changes the server response status to 204 and removes the headers. How can I prevent IDM from doing th ...

Show only the lower left quadrant within the img tag during the prepend operation

I'm attempting to add an <img> tag in front of a <div> similar to this example on JSFiddle. However, I have a specific requirement to only display the bottom left quarter of the image instead of the entire one. HTML Markup <div id="my ...

Changing the type of an object's property in TypeScript on the fly

I am working on a TypeScript function that is designed to dynamically modify the property of an object. Here is the function: const updateProperty = (value: any, key: keyof Type1, obj: Type1) => { obj[key] = value; } Below is the definition of "Typ ...

npm encountered a syntax error: unexpected word found (expected ")")

I am facing difficulties while attempting to set up the npm package "serialport" for use with Node.js on my Ubuntu system. My Node.js version is 4.3.1 Whenever I try to install it using sudo npm install serialport An error pops up as follows; /usr/local ...

The Heroku deployment encountered an error and ended with a message stating "npm ERR! 404 Not Found: [email protected]"

While attempting to deploy nodejs to Heroku (or Firebase), I am encountering a persistent error related to [email protected]. Despite updating to version 4.0.1, the issue persists. I have tried uninstalling and reinstalling, as well as deleting the no ...

Setting up package-lock.json as the definitive source of dependencies truth

I had a similar question to the one asked on Stack Overflow about package.json and package-lock.json (in summary; "what's the difference between package.json and package-lock.json?") and found some insightful answers there. However, I still have some ...