codeceptjs / codeceptjs/CodeceptJS

[Enhancement] Add namespace definition for helper

Aperta
#2,638 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
4.2k
Fork
757
Merge medio
2g 9h
PR unite (30g)
16

Descrizione

#### What are you trying to achieve?
Can we try to add namespace definition for helper. Because when we are writing helpers, there might be the same action for different scenarios. For example, I want to. add something to my favorite in desktop version or mobile version. But I don't want to write 2 different methods with different name like `addFavoriteInDesktop` and `addFavoriteInMobile`. I hope that I can have `addFavorite` methods in both `favorite_helper.js` in `desktop` folder and `favorite_helper.js` in `mobile` folder. But they have different namespace like
```
class FavoriteHelper extends Helper {
_namespace() {
return 'desktop';
}

addFavorite(something) {...}
}
```

Then I can use it in the test case like
```
Namespace('desktop');
Feature('Favorite');
Scenario('Add something to my favorite', (I) => {
I.addFavorite(something);
.....
}
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Review the proposed favorite_helper.js files in the desktop and mobile folders, along with the Helper and Namespace entry points referenced by the issue. Determine how _namespace() and Namespace('desktop') should interact with feature scenarios, then define tests showing that identical helper methods can be selected by namespace. Done means both desktop and mobile helpers remain independently callable as addFavorite.

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

Valutazione

Stack tecnologico
javascript
Ambito
testing-qa
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.