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

387
Visualizações
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 Respostas
Responde à pergunta

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 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