Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

394
Vistas
TestCafe - How to have multiple regex for testGrep in testcaferc file

I'm trying to filter OUT some tests that we have been skipping. "test.skip" is the default way to skip tests, but TestCafe has had issues with runs freezing after skipping a test.

In the mean time, they have a filter option for their testcaferc file that I'd like to use to basically ignore the tests. Since the ignored tests don't show on the report using the filter option, I'm hoping it means that TestCafe won't freeze after ignoring the test.

Their documentation says how to use the filter to only run specified tests, but lacks the negative aspect of this:

https://testcafe.io/documentation/402638/reference/configuration-file#filter

I have been able to filter out a single test just fine, but we have multiple tests we need to ignore for now and when I attempt to add a new regex, the run stops and says "No tests match your filter."

I am looking for a way to have multiple regex so TestCafe knows to ignore multiple tests.

Here's what works:

"filter": {
        "testGrep":
            "^((?!user_is_able_to_add_a_section_column_row_and_element_to_editor).)*$"
}

Here's what doesn't work:

"filter": {
        "testGrep": [
            "^((?!user_is_able_to_add_a_section_column_row_and_element_to_editor).)*$",
            "^((?!pop_up_element_displays_during_page_preview).)*$"
        ]
    }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The testGrep configuration option only supports a single regex. You can specify a regex with alternation to ignore multiple tests:

"filter": {
    "testGrep": "^(?!.*(Test One|Test Two)).*$"
}

Another way is to use the JS configuration file instead of JSON. It allows you to specify a method in which you can filter tests in any way you want:

module.exports = {
    src: './tests/test.js',
    filter: (testName => !testName.includes('Test One') && !testName.includes('Test Two'))
}

This approach is similar to the Runner.filter method.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda