What could be causing the test runner to not find the plugin?

I've been experimenting with Test Runner for running tests and attempting to utilize the sendKeys function.

Below is the test code, similar to what is provided on the website:

import { sendKeys } from '@web/test-runner-commands';

it('Sample test from test-runner', async () => {
  const input1 = document.createElement('input');
  const input2 = document.createElement('input');
  document.body.append(input1, input2);
  input1.focus();
  expect(document.activeElement).to.equal(input1);

  await sendKeys({
    press: 'Tab',
  });

  expect(document.activeElement).to.equal(input2);
  input1.remove();
  input2.remove();
});

The error message I'm encountering is:

Error: Error while executing command send-keys with payload {"press":"Tab"}: Unknown command send-keys. Did you install a plugin to handle this command?

I've tried various configurations to resolve this issue, including using @web/test-runner-chrome, -puppeteer, and -playwright.

Here is a snippet from my web-test-runner.config.mjs file:

import { esbuildPlugin } from '@web/dev-server-esbuild';
import { chromeLauncher } from '@web/test-runner';

export default {
    browsers: [chromeLauncher({ launchOptions: { args: ['--no-sandbox'] } })],
    coverage: true,
    nodeResolve: true,
    plugins: [esbuildPlugin({ ts: true })], // required for TS support
};

Any assistance on resolving this issue would be greatly appreciated.

Answer №1

Finally cracked the code!

All it took was updating

"@web/test-runner": "^0.13.1"
to
"@web/test-runner": "^0.13.5"
.

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

Show me a list of all the commands my bot has in discord.js

Recently, I developed a Discord bot using discord.js and attempted to create a help command that would display all available commands to the user. For example, one of the commands is avatar.js module.exports.run = async(bot, message, args) => { le ...

What is the process for switching a button on and off?

I am attempting to add a data to an array when a button is pressed, and then remove it from the array when the button is pressed again (while also changing the button's class). <button *ngFor="#color of colors" [class.selected]="color = ...

Discovering numbers within a JSON object and extracting them - a step-by-step guide

If I have a JSON object coming from a random dataset and want to search through it to manipulate the number values, how can I achieve this? Looping through the object using for...of allows me to get the keys, but I'm unsure how to access every key-val ...

Validating a particular value using Regex in React Formik

First, I need to ensure that the field is validated for any characters not included in this set: /[ùûüÿ€’“”«»–àâæçéèêëïîôœ]/. If a user enters a character outside of this set, I want Yup to trigger an error message. Secondly, I ...

Ensuring the Accuracy of POST Parameters Using Express-Validator

I've been working on adding parameter validation to my Node/Express API by utilizing express-validator. However, I encountered a situation where even though I sent a POST request with a missing "name" field using the curl command curl -X POST -d "foo= ...

What is the most efficient way to retrieve a document from pouchdb that includes the revision attribute?

I am currently developing an application using the electron framework and integrating pouchdb. As certain values in my database are dynamic and constantly changing, I am looking for a way to track these changes without having to create new documents for ea ...

Vue Router does not enforce redirects

I am currently facing an issue where the requireAuth() function is being called repeatedly, causing a loop. I only want to display pages when the user is logged in. This is the code snippet I am using: // Routes const routes = [ { path: &apos ...

Group an object by its name using Java Script/Vue.Js

I am looking to group objects by partial name and assign them to variables data = { SCHOOL-ADMISSION_YEAR: "2021" SCHOOL-SCHOOL_NAME: "ABC SCHOOL" SCHOOL-SCHOOL_LOCATION: "NEWYORK" ENROLLMENT-ADMISSION_YEAR: " ...

Having trouble with NPM installation? It seems like you encountered an error message: "error:0906D06C:PEM routines:PEM_read

While trying to install the expo package from npm, I encountered an error message, error:0906D06C:PEM routines:PEM_read_bio:no start line, multiple times during the installation process when fetching .tar.gz files, ultimately resulting in installation fail ...

Middleware that handles form post requests quickly became overwhelmed and resulted in a RangeError

Currently, I am working with a form using ejs templates to collect data. When accessing the "/" route, my application renders the "main" view and utilizes a middleware to handle the form data. However, I encountered an error stating "RangeError: Maximum ca ...

Having trouble with looping through subarrays using Javascript and JSON

I am attempting to iterate through a JSON object using Javascript (jQuery). Within the main JSON object, each object in the array contains embedded arrays of tags. My goal is to loop through all the files in the main object and simultaneously iterate thro ...

Deleting a record by sending an HTTP request and then removing the corresponding object from an array in Vue.js

After successfully solving this particular issue with the help of @nils, I have encountered a new question that I hope someone can assist me with! My current situation involves having a list of records from which I can select and remove items with just on ...

Preventing direct URL access with Angular redirects after refreshing the page

My website allows users to manage a list of users, with editing capabilities that redirect them to the /edit-user page where form information is preloaded. However, when users refresh the page with F5, the form reloads without the preloaded information. I ...

Matching stroke-dashoffset in SVG between two distinct paths

I am currently working on animating stroke-dashoffset for two different paths to create a drawing effect. There are buttons provided to adjust the stroke-dashoffset values. My goal is to ensure that the filled paths align vertically as they progress. Is t ...

The command 'DISABLE_ESLINT_PLUGIN' is not a valid internal or external command, executable program, or batch file

After downloading a React project from GitHub, I encountered an error when I tried to run "npm start". > @devias/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6805091c0d1a0109044503011c45181a07451a0d090b1c285c46594658">[ ...

Encountering difficulties in fetching data with formData in nextJS

Exploring the realm of NextJS and delving into server side actions. I'm facing a challenge with this specific request. import { revalidatePath } from "next/cache"; export async function submitIPCR(prevState: any, formData: FormData) { / ...

Is there a Node template engine similar to EJS that seamlessly integrates with HTML templates?

Is there a template engine for NodeJS similar to EJS that doesn't alter the original HTML template structure with its use of parentheses? In EJS, one might utilize the following code snippet to embed specific data into the HTML template: <script& ...

Require npm to fetch files from a secure registry

Within my nodejs project, I found myself in a situation where I needed to alter 4 of the node modules and then upload them to our company's private registry. This way, when the project is built, it will fetch the modified versions from our private reg ...

JavaScript Class experiencing issues with returning NAN when using the Multiplication method

Currently, I have a JavaScript Class with a multiplication method that aims to multiply all elements of an array excluding those that are undefined. To achieve this, I utilized a for loop to check the data type of each element (ensuring it is a number) and ...

Retrieve every video on React.js channel from YouTube

Currently, I am working on integrating react-youtube into my React App with the goal of accessing all videos from a specific YouTube channel. The challenge I am facing is that I need to display these videos as thumbnails, exactly how they are listed in the ...