Giter Site home page Giter Site logo

rohanbaraskar / protractor-jasmine-cucumber Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dealerdotcom/protractor-jasmine-cucumber

0.0 2.0 0.0 191 KB

cucumber like api for BDD styles test using jasmine and protractor

License: Apache License 2.0

JavaScript 100.00%

protractor-jasmine-cucumber's Introduction

protractor-jasmine-cucumber

Deprecated at Dealer.com

Given minimal adoption of this package at Dealer.com we have decided to deprecate it. We are embracing cucumberjs and finding it to be good enough.

If you would like to continue this repo, let us know and we can link to your fork and give you access to publish to it on npm.

Getting Started

npm install protractor-jasmine-cucumber --save-dev

Require at the top of your protractor.conf.js file

var cucumber = require('protractor-jasmine-cucumber');	

And use the helper function to inject the runner into your suites

suites: {
    suite1 : cucumber.injectFiles('*-specs.js', '*-steps*.js')
}

Create a feature file

var feature = require('protractor-jasmine-cucumber').feature;

feature('IM9 Navigation: Navigation and Context Switching')
.scenario('should be able to navigate to the LLP')
    .when('I choose "Lifecycles" in the navigation')
    .then('the url hash should be "/lifecycle"')
    .and('the active tab should be "Lifecycles"')

And a steps file

var featureSteps = require('protractor-jasmine-cucumber').featureSteps;

featureSteps('IM9 Navigation:')
.when('I choose "(Lifecycles|Vehicles)" in the navigation', function(navThing){
    var index = navThing === 'Lifecycles' ? 0 : 1;
    element.all(by.repeater('ctx in contexts')).get(index).$('a').click();
})
.then('the url hash should be "(.*)"', function(expectedHash){
	expect(browser.getCurrentUrl()).toContain(expectedHash);
})
.then('the active tab should be "(.*)"', function(expextedTabText){
    expect(element(by.css('.context-tabs li.active a')).getText()).toBe(expextedTabText);
})

Note: this steps file assumes that the onprepare in protractor.conf.js already got the browser to the app.

See jasmine-cucumber for more about how to use jasmine-cucumber.

Also see karma-jasmine-cucumber for use with karma.

protractor-jasmine-cucumber's People

Contributors

jhoguet avatar narigua avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.