无法用黄瓜进行量角器

时间:2017-09-18 11:49:28

标签: protractor cucumber

我是非常新的黄瓜框架,我开始用量角器编写黄瓜脚本,当我尝试运行黄瓜时。 conf.js文件,我看到以下错误消息

  

[17:07:35] I / launcher - 运行WebDriver的1个实例

     

[17:07:35]我/托管 - 在http://127.0.0.1:4444/wd/hub使用selenium服务器   UUUUU

警告:

1) Scenario: Login with valid userid and password # feature\test.feature:4
   ? Given I should be at the login page
       Undefined. Implement with the following snippet:

         Given('I should be at the login page', function (callback) {
           // Write code here that turns the phrase above into concrete actions
           callback(null, 'pending');
         });

   ? And I provide valid userid and password
       Undefined. Implement with the following snippet:

         Given('I provide valid userid and password', function (callback) {
           // Write code here that turns the phrase above into concrete actions
           callback(null, 'pending');
         });

   ? When I click on login button
       Undefined. Implement with the following snippet:

         When('I click on login button', function (callback) {
           // Write code here that turns the phrase above into concrete actions
           callback(null, 'pending');
         });

   ? Then I should be able to login inside the Gmail
       Undefined. Implement with the following snippet:

         Then('I should be able to login inside the Gmail', function (callback) {
           // Write code here that turns the phrase above into concrete actions
           callback(null, 'pending');
         });

   ? And The title of web page should be Gmail main page
       Undefined. Implement with the following snippet:

         Then('The title of web page should be Gmail main page', function (callback) {
           // Write code here that turns the phrase above into concrete actions
           callback(null, 'pending');
         });


1 scenario (1 undefined)
5 steps (5 undefined)
0m00.000s
[17:08:31] I/launcher - 0 instance(s) of WebDriver still running
[17:08:31] I/launcher - chrome #01 failed 1 test(s)
[17:08:31] I/launcher - overall: 1 failed spec(s)
[17:08:31] E/launcher - Process exited with error code 1

my conf.js file is

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'),
    frameworkPath: require.resolve('protractor-cucumber-framework'),
    capabilities: {
        'browserName': 'chrome'
    },

    // Spec patterns are relative to this directory.
    specs: [
        '../feature/test.feature',
    ],

    baseURL: 'http://localhost:8080/',

    cucumberOpts: {
        require: ['../feature/step_definitions/stepDefinitions.js'],
        tags: false,
        strict: true,
        format: ["pretty"],
        dryRun: false,
        compiler: []
    },

    onPrepare: function () {
        browser.manage().window().maximize();
    }
};

如果有人遇到此问题,请建议我如何解决此问题。

0 个答案:

没有答案