Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Implemented steps showing undefined and errors not thrown. #4351

Closed
@ayeshasid

Description

@ayeshasid

Hi,
I ve been trying to run my protractor script but the implemented steps are showing undefined. i tried making an another basic project but its still the same.

Also, the errors are not displayed on the console.

Bug report:

(node:11260) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[14:52:47] I/launcher - Running 1 instances of WebDriver
[14:52:47] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
Feature: Running Cucumber with Protractor

As a user of Protractor
I should be able to use Cucumber
In order to run my E2E tests

Scenario: Protractor and Cucumber Test
? Given I go to "https://angularjs.org/"
? When I add "Be Awesome" in the task field
? And I click the add button
? Then I should see my new task in the list

Warnings:

[14:52:51] I/launcher - 0 instance(s) of WebDriver still running
[14:52:51] I/launcher - chrome #1 passed

  • Node Version: ``v8.1.2

  • Protractor Version: ``5.1.2

  • Browser(s): ``chrome

  • Operating System and Version ``windows 10

  • Protractor configuration file:
    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: [
    'features/test.feature'
    ],

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

    cucumberOpts: {
    require: ['features/step_definitions/*.js'],
    tags: false,
    format: 'pretty',
    profile: false,
    'no-source': true
    }
    };

  • Step defination:
    "use strict";

module.exports = function() {

this.Given(/^I go to (.*)$/, function () {
    browser.get("https://angularjs.org/");
});

this.When(/^I add "Be Awesome" in the task field$/, function () {
    var textBox = element(by.css('.ng-prisbtine.ng-valid.ng-empty.ng-touched'));
    textBox.sendKeys("Be Awesome");
});

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

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions