Questions tagged [cypress-component-test-runner]

This tag should be used in questions related to running Cypress tests with Component Test Runner and the configuration or other issues with the Cypress Component Test Runner.

This tag should be used in questions related to running Cypress tests with Component Test Runner and the configuration or other issues with the Cypress Component Test Runner itself.

References:

Related tags:

180 questions
8
votes
1 answer

Cypress 10 shows "The 'task' event has not been registered in the setupNodeEvents method. You must register it before using cy.task()"

In the cypress.config.js , I'm trying to register tasks / plug in events and set my env configuration exactly as documented on their guide. However, when trying to use "on" inside setupNodeEvents I'm getting the error in the title about needing to…
7
votes
2 answers

How can I wrap a vue component during cypress component testing?

I am using component testing in Cypress on Vue. My project components use the vuetify plugin. Currently, tested components load with Vuetify: import DebuggingTemporaryComponent from "./DebuggingTemporaryComponent"; import {mount} from…
Rory
  • 2,175
  • 1
  • 27
  • 37
4
votes
1 answer

How do I use data-testid attribute with a React Component Test?

I am doing a Component Test on a simple react component, which I want to render and then do some tests on. The problem is that cy.get() does not seem to find the component based on a data-testid attribute. I tested it with a simple div and the div…
4
votes
1 answer

Cypress component testing intercept getServerSideProps requests

Can't figure out how to intercept the getServerSideProps when using cypress component testing. Did a lot of research and the best lead…
4
votes
3 answers

Running Cypress tests with TailwindCSS 3

I've been running my component tests via cypress open-ct for a while now, relying on importing /node_modules/tailwindcss/dist/tailwindcss.min.css. Since upgrading to Tailwind v3 some of my tests are failing as there is no prebuilt CSS file I can…
4
votes
1 answer

How to import CDN stylesheet link into Cypress component test runner

I have a vue-cli project. I've set successfully the cypress component test runner using the official documentation: https://docs.cypress.io/guides/component-testing/introduction. Now I have a problem using icon fonts that are delivered in my app…
Igor Moraru
  • 7,089
  • 1
  • 12
  • 24
3
votes
1 answer

cypress cy.tick not working in cypress component tests

Has anyone out there had any success in getting cy.tick() to work in cypress component tests. cy.clock() stops the time but tick will not move it forward in cypress component tests. If someone was able to get this working please give mean example…
me-me
  • 5,139
  • 13
  • 50
  • 91
3
votes
1 answer

Cypress Component Testing Angular Components spying on private service

I am trying to use Cypress's new Component Testing for Angular. Given the following test beforeEach(() => { mockService.ageRangeName = '0-5'; cy.viewport(1920, 1080); cy.mount(CategoryBuilderComponent, { componentProperties:…
Ken
  • 423
  • 6
  • 13
3
votes
1 answer

Cypress Component Testing Missing package.json

I have a React App that uses webpack and Cypress E2E testing. I'm trying to use Cypress component testing. I have written a simple test as follows: describe('Hello World Test', () => { it ('Button', () => { mount(
Przemek Lach
  • 1,348
  • 2
  • 19
  • 42
3
votes
1 answer

How to run the single test with different data set in parallel by using cypress on single machine

I just have the below Test.json file in the fixture folder: [ { "searchKeyword":"cypress" }, { "searchKeyword":"QA automation" }, { "searchKeyword":"stackoverflow" } ] The above file contains three…
3
votes
1 answer

Cypress component test with NextJS useRouter function

My Navbar component relies on the useRouter function provided by nextjs/router in order to style the active links. I'm trying to test this behavior using Cypress, but I'm unsure of how I'm supposed to organize it. Cypress doesn't seem to like…
Bonteq
  • 777
  • 7
  • 24
3
votes
1 answer

Cypress 7+ hanging in IC

After migrating to latest Cypress versions (7.0.1, 7.2.0, 7.3.0) using webpack-dev-server, I'm experiencing the same issue when running my React component tests in IC (Jenkins) using a Cypress cypress/browsers:node14.16.0-chrome89-ff86 docker image…
2
votes
1 answer

Angular Cypress Component tests not working with Tailwindcss

When running Tailwindcss in an Nx style monorepo (apps and libs folders) I have setup the Tailwind config as: content: ['./apps/**/*.{html,ts}', './libs/**/*.{html,ts}'], But it is not applying any Tailwindstyles and gives the error: "warn - No…
2
votes
1 answer

Cypress function mocking similar to jest.fn

Im trying out cypress component test in React and Im kinda confused on some basic stuff like how to assert click handlers. In Jest I can do something like const hideMock = jest.fn(); renderWithProviders(
blessanm86
  • 31,439
  • 14
  • 68
  • 79
2
votes
0 answers

cypress is not identifying a constructor

Hi there I am trying to run a script in cypress by following page object model. But when I am running my script cypress is throwing error that page's _HomePage.HomePage is not a constructor I am attaching my code below for reference. In…
1
2 3
11 12