この問題は、このhttps://github.com/angular/protractor/issues/4311の続きです。 分度器を使用してCucumberjsスクリプトを実行する方法に関する構文の変更について説明しています。
@wswebcreation https://github.com/wswebcreationからのリクエストに応じて、他の問題を閉じて、ここで新しい問題を開きました。
私が成功した実行の最後の記録は、2017年5月12日14:03でした。 正確にあなたの文書の日付。
タグに関するあなたの例は非常に単純です...それでは、3つのタグを呼び出す必要があります。2つは実行する必要があり、1つは無視されます。 5月12日以前は、これは正常に機能していましたが、現在は機能していません。
protractor ./FM_IntTest_UI_conf.js --disableChecks [email protected] --params.login.passw=mypassword --cucumberOpts.tags ~<strong i="13">@ignore</strong> --cucumberOpts.tags <strong i="14">@smoke</strong>,@sprint
あなたのドキュメントは、これでこのようになるはずだと言っていますが、機能せず、「チケット」で送信したのと同じエラーメッセージを返します。
protractor ./FM_IntTest_UI_conf.js --disableChecks [email protected] --params.login.passw=mypassword --cucumberOpts.tags '<strong i="18">@smoke</strong> or <strong i="19">@rt</strong>' --cucumberOpts.tags 'not <strong i="20">@ignore</strong>'
エラー:エラー:複数の構成ファイルが指定されました
C:\ Users \ echavez \ AppData \ Roaming \ npm \ node_modules \ protractor \ built \ cli.js:155:15
C:\ Users \ echavez \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ optimist \ index.js:307:21
Array.forEach(ネイティブ)で
parseArgsで(C:\ Users \ echavez \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ optimist \ index.js:305:16)
Object.Argv.self.parse(C:\ Users \ echavez \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ optimist \ index.js:140:16)
オブジェクトで。 (C:\ Users \ echavez \ AppData \ Roaming \ npm \ node_modules \ protractor \ built \ cli.js:158:21)
Module._compileで(module.js:571:32)
Object.Module._extensions..js(module.js:580:10)で
Module.load(module.js:488:32)で
tryModuleLoad(module.js:447:12)で
Cucumberドキュメントで、ステップ定義のコーディング構文も変更されていることがわかりますか? なぜ今それをもっと複雑にするのですか? 新しい構文では、シナリオごとにステップをグループ化する必要があるためです。 しかし、いくつかのシナリオで繰り返されるいくつかのステップがあります。したがって、各シナリオでコードを繰り返しますか? コードに冗長性が生じてしまいます。 どうして?
これが私のtest.spec.jsファイルに今あるもののスニペットです:
this.Given('I am testing my Widget Application', function (callback) {
edirp.edirejectwidgetlink.click().then(function(){
callback();
}).catch(function(reason) {
console.log('ERROR: Widget button not found');
callback(reason);
});
});
this.When('There are records in the Widget List', function() {
edirp.edigetrow.count().then(function(cnt){
if(cnt>0){
return recordsFound = cnt;
}else{
return recordsFound = 0;
}
});
});
this.Then('Header name of the Widget List is '(.+)'', function(header, callback) {
expect(po.headertext.getText()).to.eventually.equal(header).then(function(){
callback();
}).catch(function(reason) {
console.log('Warning: Incorrect Text.');
callback(reason);
});
});
これが「アップデート」として提案されたもののスニペットです...私にとってはダウングレードです:
var seleniumWebdriver = require('selenium-webdriver');
var {defineSupportCode} = require('cucumber');
defineSupportCode(function({Given, When, Then}) {
Given('I am testing my Widget Application', function (callback) {
edirp.edirejectwidgetlink.click().then(function(){
callback();
}).catch(function(reason) {
console.log('ERROR: Widget button not found');
callback(reason);
});
When('There are records in the Widget List', function() {
edirp.edigetrow.count().then(function(cnt){
if(cnt>0){
return recordsFound = cnt;
}else{
return recordsFound = 0;
}
});
Then('Header name of the Widget List is '(.+)'', function(header, callback) {
expect(po.headertext.getText()).to.eventually.equal(header).then(function(){
callback();
}).catch(function(reason) {
console.log('Warning: Incorrect Text.');
callback(reason);
});
});
シナリオに複数のGiven、When、Then ...がある場合、次のようにそれらをここに列挙する必要がありますか?:
defineSupportCode(function({Given、And、And、When、And、And、Then、And、And、And}){
それが本当なら...それで、私の機能の別のシナリオで「EDI拒否ウィジェットにレコードがある場合」のステップを再度使用したい場合、すべての関数を再度コーディングする必要がありますか?
必要なのは引数付きの答えだけです。 個人的に服用しないでください。
シナリオに複数のGiven、When、Then ...がある場合、次のようにそれらをここに列挙する必要がありますか?:
defineSupportCode(function({Given、And、And、When、And、And、Then、And、And、And}){
いいえ。 Given
、 When
、およびThen
は、複数回呼び出すことができる関数です(1.xのthis.Given
などと同様)。 And
は関数ではありません。 README.md
からリンクされているAPIリファレンスで、 defineSupportCode
によって渡されたすべての関数を確認できます。
Cucumberドキュメントで、ステップ定義のコーディング構文も変更されていることがわかりますか?
https://github.com/cucumber/cucumber-js/issues/679を参照して
なぜ今それをもっと複雑にするのですか? 新しい構文では、シナリオごとにステップをグループ化する必要があるためです。
それは真実ではありません
ありがとう、私はそれをチェックします!
説明してくれた@charlierudolphTnx!
このスレッドは、閉じられた後、最近のアクティビティがないため、自動的にロックされています。 関連するバグについては、新しい問題を開いてください。