Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
Is it possible to run only specific tests on Cypress through support/index.js?

I am trying to run only specific test. Say I have 50 test files inside integration folder and want only 10 of them to run. I am trying to configure this from support/index.js file like:

import './commands'
import '../integration/login.spec.js'
import '../integration/admin.spec.js'
import '../integration/customer.spec.js'

I want to only display the selected files (login.spec.js, admin.spec.js and customer.spec.js) on the test runner of Cypress. I don't want other test files to display. But the above code is not working.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I would not bother using the support/index.js, just make a dummy spec and run that

// my-top-10-tests.spec.js

import './login.spec.js' 
import './admin.spec.js' 
import './customer.spec.js'
// and so on
about 4 years ago · Juan Pablo Isaza Relatório

0

As @Fody mentioned in the another answer, adding another dummy spec file approach does work.

Hence adding a detailed explanation on that approach in cypress 10.0.3, Windows OS

Lets's say below is your script folder structure

cypress
  e2e
    small-Run
      theDummytest.cy.js
    Module-A
      test-Module-A.cy.js
    Module-B
      SubModule-BB
        test-SubModule-BB.cy.js

And this is how, you implement the dummy test file approach

import '../Module-A/test-Module-A.cy.js'
import '../Module-B/SubModule-BB/test-SubModule-BB.cy.js'

And in you CLI/CI?CMD run, you would be using the below line to invoke that selective script tests

npx cypress run --spec cypress\e2e\small-Run\*.cy.js
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda