forked from angular/protractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cucumber): better support cucumber
add support coffee(flag) update version (-> 0.4.0) add example test for scenarion outline Closes angular#702
- Loading branch information
a.konovalov
committed
Apr 18, 2014
1 parent
7334e6c
commit 4ffa9ba
Showing
8 changed files
with
107 additions
and
4 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
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,45 @@ | ||
# Use the external Chai As Promised to deal with resolving promises in | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
# expectations. | ||
chai = require 'chai' | ||
chaiAsPromised = require 'chai-as-promised' | ||
chai.use(chaiAsPromised) | ||
|
||
expect = chai.expect | ||
|
||
g = | ||
protractor:protractor | ||
browser:browser | ||
by:`by` | ||
element:element | ||
'$':$ | ||
|
||
module.exports = -> | ||
|
||
@Given /^I run Cucumber with Protractor$/, (next) -> | ||
next() | ||
|
||
@Given /^I go on(?: the website)? "([^"]*)"$/, (url, next) -> | ||
browser.get(url) | ||
next() | ||
|
||
@Then /^it should still do normal tests$/, (next) -> | ||
expect(true).to.equal(true) | ||
next() | ||
|
||
@Then /^it should expose the correct global variables$/, (next) -> | ||
expect(protractor).to.exist | ||
expect(browser).to.exist | ||
expect(`by`).to.exist | ||
expect(element).to.exist | ||
expect($).to.exist | ||
next() | ||
|
||
|
||
@Then /^it should expose the correct global variable "([^"]*)"$/, (variable,next) -> | ||
expect(g[variable]).to.exist | ||
next() | ||
|
||
|
||
@Then /the title should equal "([^"]*)"$/, (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
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 |
---|---|---|
|
@@ -24,7 +24,6 @@ exports.config = { | |
|
||
cucumberOpts: { | ||
require: 'cucumber/stepDefinitions.js', | ||
tags: '@dev', | ||
format: 'summary' | ||
} | ||
}; |
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:' + (process.env.HTTP_PORT || '8000'), | ||
|
||
params: { | ||
login: { | ||
user: 'Jane', | ||
password: '1234' | ||
} | ||
}, | ||
|
||
cucumberOpts: { | ||
require: 'cucumber/stepDefinitions.coffee', | ||
format: 'summary', | ||
coffee: true | ||
} | ||
}; |
I don't think that we need a separate set of tests for cucumber in coffee. This should be tested by Cucumber. Let's trust that cucumber does the right then when it's the passed the --coffee flag and remove this and the related config file.