Resolve cucumber's scenario outline template parameters

Aperta
#2,778 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
testing

Direzione di ricerca

Nell'issue non sono indicati né un file sorgente né un test. Inizia individuando il rendering dei nomi di scenario-outline e la gestione esistente dei parametri del template, quindi confrontali con i nomi attesi mostrati qui. Il lavoro è completato quando i nomi degli scenari generati sostituiscono ogni parametro dell'outline con il valore corrispondente di Examples, con una copertura per più righe di esempi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What are you trying to achieve?

When using cucumber's scenario outlines, it's much easier to review your tests results when they don't all have the same name.
So cucumber supports converting the following

Scenario Outline: eating
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    |    12 |   5 |    7 |
    |    20 |   5 |   15 |

to instead look like

Scenario Outline: Having <start> cucumbers, and eating <eat> leaves <left>
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    |    12 |   5 |    7 |
    |    20 |   5 |   15 |

It was done here https://github.com/cucumber/cucumber-js/issues/267
The 2nd version of this test would produce scenarios with the following names:

  • Having 12 cucumbers, and eating 5 leaves 7
  • Having 20 cucumbers, and eating 5 leaves 15
What do you get instead?

Instead, it appears the template parameters are not resolved when printing the scenario name when the feature is run

Provide console output if related. Use --verbose mode for more details.
In my case my scenario name is User <userType> <id> should have correct credentails.
and I get
User <userType> <id> should have correct credentails. {"userType":"\"issuer_rep\"","id":"10","homePage":"\"landing/info\""}

Details
  • CodeceptJS version: CodeceptJS v3.0.4
  • NodeJS Version: v14.2.0
  • Operating System: Windows/Mac/Ubuntu
  • webdriverio
Lingua principale
JavaScript
Stelle
4.2k
Fork
756
Merge medio
2g 9h
PR unite (30g)
16

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codeceptjs/CodeceptJS

Tutte le issue di codeceptjs/CodeceptJS

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.