Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "feat(runner): add adapter for cucumber.js""
This reverts commit 21e52a9.
- Loading branch information
Showing
6 changed files
with
142 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Running Cucumber with Protractor | ||
As a user of Protractor | ||
I should be able to use Cucumber | ||
to run my E2E tests | ||
|
||
@dev | ||
Scenario: Running Cucumber with Protractor | ||
Given I run Cucumber with Protractor | ||
Then it should still do normal tests | ||
Then it should expose the correct global variables | ||
|
||
@dev | ||
Scenario: Wrapping WebDriver | ||
Given I go on "index.html" | ||
Then the title should equal "My AngularJS App" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Use the external Chai As Promised to deal with resolving promises in | ||
// expectations. | ||
var chai = require('chai'); | ||
var chaiAsPromised = require('chai-as-promised'); | ||
chai.use(chaiAsPromised); | ||
|
||
var expect = chai.expect; | ||
|
||
module.exports = function() { | ||
|
||
this.Given(/^I run Cucumber with Protractor$/, function(next) { | ||
next(); | ||
}); | ||
|
||
this.Given(/^I go on(?: the website)? "([^"]*)"$/, function(url, next) { | ||
browser.get(url); | ||
next(); | ||
}); | ||
|
||
this.Then(/^it should still do normal tests$/, function(next) { | ||
expect(true).to.equal(true); | ||
next(); | ||
}); | ||
|
||
this.Then(/^it should expose the correct global variables$/, function(next) { | ||
expect(protractor).to.exist; | ||
expect(browser).to.exist; | ||
expect(by).to.exist; | ||
expect(element).to.exist; | ||
expect($).to.exist; | ||
next(); | ||
}); | ||
|
||
this.Then(/the title should equal "([^"]*)"$/, function(text, next) { | ||
expect(browser.getTitle()).to.eventually.equal(text).and.notify(next); | ||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// A small suite to make sure the cucumber framework works. | ||
exports.config = { | ||
seleniumAddress: 'http://localhost:4444/wd/hub', | ||
|
||
framework: 'cucumber', | ||
|
||
// Spec patterns are relative to this directory. | ||
specs: [ | ||
'cucumber/*.feature' | ||
], | ||
|
||
capabilities: { | ||
'browserName': 'chrome' | ||
}, | ||
|
||
baseUrl: 'http://localhost:8000', | ||
|
||
params: { | ||
login: { | ||
user: 'Jane', | ||
password: '1234' | ||
} | ||
}, | ||
|
||
cucumberOpts: { | ||
require: 'cucumber/stepDefinitions.js', | ||
tags: '@dev', | ||
format: 'summary' | ||
} | ||
}; |