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

Implemented steps showing undefined and errors not thrown. #4351

Closed
ayeshasid opened this issue Jun 22, 2017 · 2 comments
Closed

Implemented steps showing undefined and errors not thrown. #4351

ayeshasid opened this issue Jun 22, 2017 · 2 comments

Comments

@ayeshasid
Copy link

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();
});

}

@wswebcreation
Copy link
Contributor

Hi there!

Because your question is about a third party framework it is better to ask it on StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help.

From the the getting help section of the README:

Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)

There are enough tutorials / questions on SO. So please ask your question there and close this issue.

Thanks!

@wswebcreation
Copy link
Contributor

Going to close the issue now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants