Problem with launching test with an exact tag

Abierto
#4,340 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, node.js
Área
cli, testing-qa

Línea de trabajo

Empieza reproduciendo los dos comandos npx codeceptjs run --features --config=./codecept.conf.js --grep contra las etiquetas reportadas @cit-mit y @cit-mit-subseq, y después rastrea cómo la CLI gestiona --grep. Se considera terminado cuando se haya definido una opción o comportamiento para etiquetas exactas y esté cubierto por una prueba de regresión sin requerir futuros lookaheads negativos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

stale
What are you trying to achieve?

I have 2 tags in my tests file :

  • @cit-mit
  • @cit-mit-subseq

I'm trying to launch tests with @cit-mit tag only.

What do you get instead?

I have the @cit-mit tests launched, then the @cit-mit-subseq launched too.

Commands tested to launch test
npx codeceptjs run --features --config=./codecept.conf.js  --grep '@cit-mit'
npx codeceptjs run --features --config=./codecept.conf.js  --grep '(?=.*@cit-mit)'

I know I can play only @cit-mit tag with the grep (?=.*@cit-mit)^(?!.*@cit-mit-subseq), but in the next weeks I'll have more tests with @cit-mit "prefix" tag so I'll have to edit my grep and I don't want this.

It'll be nice if there is an exact keyword or something like this to lock the pattern to the only tag we provide, and not every tags starting with the one given.

Details
  • CodeceptJS version: 3.5.6
  • NodeJS Version: 18.18.0
  • Operating System: Debian 12.1
  • puppeteer || webdriverio || testcafe version (if related) /
  • Configuration file:
const { output } = require('codeceptjs')
require('dotenv').config({ path: '.env' })
if (process.env.ENV === undefined) {
    process.env['ENV'] = 'preprod'
}
require('dotenv').config({ path: 'codecept.' + process.env.ENV + '.env' })

exports.config = {
    output: './output',
    helpers: {
        REST: {
            endpoint: process.env.GATEWAY_URL,
            timeout: 60000,
        },
        WebDriver: {
            url: 'http://localhost',
            host: process.env.SELENIUM_HOST === undefined ? 'localhost' : process.env.SELENIUM_HOST,
            browser: 'chrome',
            desiredCapabilities: {
                chromeOptions: {
                    args: ['--headless', '--disable-gpu', '--no-sandbox'],
                },
            },
        },
        ChaiWrapper: {
            require: 'codeceptjs-chai',
        },
        JSONResponse: {},
        CustomWebDriver: {
            require: './lib/CustomWebDriver.js',
        },
    },
    include: {
        I: './steps_file.js',
        lib: './lib/index',
        context: './lib/contextAPI.js',
        inputOrder: './data/inputs/input.order.js',
        endpoints: './data/data.endpoints.js',
        mappings: './data/data.mappings.js',
        merchants: './data/data.merchants.js',
    },
    mocha: {},
    bootstrap: null,
    timeout: null,
    teardown: null,
    hooks: [],
    gherkin: {
        features: './features/**/*.feature',
        steps: [
            './step_definitions/_common.steps.js',
            './step_definitions/hpayment.steps.js',
            './step_definitions/order.steps.js',

            './step_definitions/hpayment/hpayment.nominal.steps.js',
            './step_definitions/order/order.cit-mit.steps.js',
            './step_definitions/order/order.nominal.steps.js',
            './step_definitions/order/order.sdd.steps.js',
            './step_definitions/order/order.given.steps.js',
            './step_definitions/order/sca.preference.steps.js',
        ],
    },
    plugins: {
        hook: {
            require: './plugins/gateway-qa-hooks.js',
            enabled: true,
        },
        screenshotOnFail: {
            enabled: true,
            uniqueScreenshotNames: true,
        },
        tryTo: {
            enabled: true,
        },
        retryFailedStep: {
            enabled: true,
        },
        retryTo: {
            enabled: true,
        },
        eachElement: {
            enabled: true,
        },
        pauseOnFail: {},
    },
    stepTimeout: 0,
    stepTimeoutOverride: [
        {
            pattern: 'wait.*',
            timeout: 0,
        },
        {
            pattern: 'amOnPage',
            timeout: 0,
        },
    ],
    tests: './tests/**/*.js',
    name: 'gateway-qa',
}

output.success(' ==================================== ')
output.success(' ENVIRONNEMENT: ' + process.env.ENV + ' ')
output.success(' GATEWAY_URL: ' + process.env.GATEWAY_URL + ' ')
output.success(' PCI_URL: ' + process.env.PCI_URL + ' ')
output.success(' ====================================')
Lenguaje dominante
JavaScript
Estrellas
4.2k
Forks
756
Merge medio
2 d 9 h
PR fusionados (30 d)
16

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codeceptjs/CodeceptJS

Todos los issues de codeceptjs/CodeceptJS

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.