Cucumber-js: "cucumberOpts" λ§€κ°œλ³€μˆ˜λŠ” μ–΄λ–»κ²Œ λ˜μ—ˆμŠ΅λ‹ˆκΉŒ? 더 이상 μ§€μ›λ˜μ§€ μ•ŠμŠ΅λ‹ˆκΉŒ?

에 λ§Œλ“  2017λ…„ 06μ›” 06일  Β·  5μ½”λ©˜νŠΈ  Β·  좜처: cucumber/cucumber-js

이 λ¬Έμ œλŠ” https://github.com/angular/protractor/issues/4311 의 μ—°μ†μž…λ‹ˆλ‹€. Cucumberjs 슀크립트λ₯Ό μ‹€ν–‰ν•˜κΈ° μœ„ν•΄ 각도기λ₯Ό μ‚¬μš©ν•˜λŠ” 방법에 λŒ€ν•œ ꡬ문의 λ³€κ²½ 사항에 λŒ€ν•΄ λ…Όμ˜ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

@wswebcreation https://github.com/wswebcreation μ—μ„œ μš”μ²­ν•œ λŒ€λ‘œ λ‹€λ₯Έ 문제λ₯Ό λ‹«κ³  μ—¬κΈ°μ—μ„œ μƒˆ 문제λ₯Ό μ—΄μ—ˆμŠ΅λ‹ˆλ‹€.

κ·Έλž˜μ„œ 제 λ§ˆμ§€λ§‰ λŒ“κΈ€μ€ μ΄λž¬μŠ΅λ‹ˆλ‹€....

성곡적인 싀행에 λŒ€ν•œ λ§ˆμ§€λ§‰ 기둝은 2017λ…„ 5μ›” 12일 14μ‹œ 3λΆ„μ΄μ—ˆμŠ΅λ‹ˆλ‹€. λ¬Έμ„œμ˜ μ •ν™•ν•œ λ‚ μ§œ.

νƒœκ·Έμ— λŒ€ν•œ κ·€ν•˜μ˜ μ˜ˆλŠ” 맀우 κ°„λ‹¨ν•©λ‹ˆλ‹€... κ·Έλ ‡λ‹€λ©΄ 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);
    });
});

λ‹€μŒμ€ "μ—…λ°μ΄νŠΈ"둜 μ œμ•ˆλœ λ‚΄μš©μ˜ μΌλΆ€μž…λ‹ˆλ‹€... μ €μ—κ²Œ μžˆμ–΄ DOWNGRADEλŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

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-Rejects μœ„μ ―μ— λ ˆμ½”λ“œκ°€ μžˆμ„ λ•Œ" 단계λ₯Ό λ‹€μ‹œ μ‚¬μš©ν•˜λ €λ©΄ λͺ¨λ“  κΈ°λŠ₯을 λ‹€μ‹œ μ½”λ”©ν•΄μ•Ό ν•©λ‹ˆκΉŒ?

λ‚΄κ°€ ν•„μš”ν•œ 것은 λ…ΌμŸμ΄ μžˆλŠ” λ‹΅λ³€λΏμž…λ‹ˆλ‹€. 개인적으둜 받아듀이지 λ§ˆμ‹­μ‹œμ˜€.

λͺ¨λ“  5 λŒ“κΈ€

μ‹œλ‚˜λ¦¬μ˜€μ— μ—¬λŸ¬ Given, When, Then...이 μžˆλŠ” 경우 λ‹€μŒκ³Ό 같이 여기에 μ—΄κ±°ν•΄μ•Ό ν•©λ‹ˆκΉŒ?
defineSupportCode(function({Given, And, And, When, And, And, Then, And, And, And}) {

μ•„λ‹ˆμš”. Given , When 및 Then λŠ” μ—¬λŸ¬ 번 ν˜ΈμΆœν•  수 μžˆλŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€(1.x의 this.Given λ“±κ³Ό μœ μ‚¬). And λŠ” ν•¨μˆ˜κ°€ μ•„λ‹™λ‹ˆλ‹€. 당신은 ν†΅κ³Όν•˜λŠ” λͺ¨λ“  κΈ°λŠ₯을 λ³Ό 수 defineSupportCode 에 API μ°Έμ‘° λ‘œλΆ€ν„° μ—°κ²°λ˜μ–΄ README.md

Cucumber λ¬Έμ„œμ—μ„œ 단계 μ •μ˜μ— λŒ€ν•œ μ½”λ”© ꡬ문도 λ³€κ²½λœ 것을 λ³Ό 수 μžˆμŠ΅λ‹ˆκΉŒ?

https://github.com/cucumber/cucumber-js/issues/679 μ°Έμ‘°

μ™œ μ§€κΈˆ 더 λ³΅μž‘ν•˜κ²Œ λ§Œλ“œλŠ”κ°€? μƒˆ ꡬ문을 μ‚¬μš©ν•˜λ©΄ μ‹œλ‚˜λ¦¬μ˜€λ³„λ‘œ 단계λ₯Ό κ·Έλ£Ήν™”ν•΄μ•Ό ν•˜κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€.

그건 사싀이 μ•„λ‹ˆμ•Ό

κ°μ‚¬ν•©λ‹ˆλ‹€ ν™•μΈν•˜κ² μŠ΅λ‹ˆλ‹€!

@charlierudolph Tnx μ„€λͺ…!

이 μŠ€λ ˆλ“œλŠ” λ‹«νžŒ ν›„ 졜근 ν™œλ™μ΄ μ—†μ—ˆκΈ° λ•Œλ¬Έμ— μžλ™μœΌλ‘œ μž κ²ΌμŠ΅λ‹ˆλ‹€. κ΄€λ ¨ 버그에 λŒ€ν•œ μƒˆ 문제λ₯Ό μ—¬μ‹­μ‹œμ˜€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰