2016-09-24 4 views
0

以下は設定ファイルとステップ定義ファイルです。実行した後、それは言う 2のシナリオ(2渡された) 7段階(7合格) 0m00.001sconfig.jsファイルを実行している間にも結果は表示されますが、結果は完了するまでにナノ秒かかります。

E /ランチャー - '!アユシュこんにちは' 期待します「ハロー・ラフル!」と等しい プロセスは、コールバックを追加したり、ステップに戻りしようとすると、エラーコード199

var chai = require('chai'); 
 
var chaiAsPromised = require('chai-as-promised'); 
 

 
chai.use(chaiAsPromised); 
 
var expect = chai.expect; 
 

 
module.exports = function() { 
 
    this.Given(/^I go to "([^"]*)"$/, function(site) { 
 
    browser.get(site); 
 
    }); 
 

 
    this.When(/^I add "([^"]*)" in the task field$/, function(task) { 
 
    element(by.model('todoList.todoText')).sendKeys(task); 
 
    }); 
 

 
    this.When(/^I typed name in the field$/, function() { 
 
    element(by.model('yourName')).sendKeys('Ayush'); 
 
    }); 
 

 
    this.Then(/^I click the add button$/, function() { 
 
    var el = element(by.css('[value="add"]')); 
 
    el.click(); 
 
    }); 
 

 
    this.Then(/^I should see my new task in the list$/, function(callback) { 
 
    var todoList = element.all(by.repeater('todo in todoList.todos')); 
 
    expect(todoList.count()).to.eventually.equal(3); 
 
    expect(todoList.get(2).getText()).to.eventually.equal('Be Awesome'); 
 
    callback(); 
 
    }); 
 

 
    this.Then(/^The name should be displayed in the greeting$/, function() { 
 
    var greeting = element(by.binding('yourName')); 
 
    expect(greeting.getText()).to.eventually.equal('Hello Rahul!'); 
 
    //callback(); 
 
    }); 
 
};

exports.config = { 
 
    seleniumAddress: 'http://127.0.0.1:4444/wd/hub', 
 
    getPageTimeout: 60000, 
 
    allScriptsTimeout: 500000, 
 
    framework: 'custom', 
 
    // path relative to the current config file 
 
    frameworkPath: require.resolve('protractor-cucumber-framework'), 
 
    capabilities: { 
 
    'browserName': 'chrome' 
 
    }, 
 

 
    // Spec patterns are relative to this directory. 
 
    specs: [ 
 
    '/Users/viveka1/vivek_ayush_angular_ui/feature/login.feature' 
 
    ], 
 

 
    //baseURL: 'http://localhost:8080/', 
 
    baseURL: 'https://angularjs.org/', 
 

 
    cucumberOpts: { 
 
    require: '/Users/viveka1/vivek_ayush_angular_ui/step_definition/login.js', 
 
    tags: false, 
 
    format: 'summary', 
 
    profile: false, 
 
    'no-source': true 
 
    } 
 
};

+0

confi.jsファイルのSpecファイルパスをもう一度確認してください。 –

+0

@ suresh私はそれを確認しました..それは正しいです..まだ適切な問題を得ていない –

答えて

0

で終了しました。 like:

this.When(/^I add "([^"]*)" in the task field$/, function(task) { 
    return element(by.model('todoList.todoText')).sendKeys(task); }); 
関連する問題