Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into mseankelly-master

Conflicts:
	lib/adapter.js
	vendor/cucumber.js
  • Loading branch information
s9tpepper committed Apr 1, 2015
2 parents e2ad1d1 + 8009766 commit 7d20907
Show file tree
Hide file tree
Showing 7 changed files with 877 additions and 886 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Expand Up @@ -30,7 +30,7 @@ module.exports = function (grunt) {
jasmine: {
configFile: "karma.conf.js",
singleRun: true,
browsers: ["Chrome", "Firefox", "Safari"]
browsers: ["Chrome", "Firefox"]
},

cuke_once: {
Expand Down
2 changes: 1 addition & 1 deletion app.template
Expand Up @@ -7,5 +7,5 @@
$('.box').css('background-color', 'red');
});

startCucumberRun();
startCucumberRun({ tags: ["@test_tag"] });
</script>
8 changes: 7 additions & 1 deletion features/Testing.feature
@@ -1,7 +1,13 @@
Feature: A feature file for testing the Karma Cucumber adapter
A test feature file to run the Karma Cucumber adapter

Scenario: The green box is clicked on turning it red
Scenario: The green box is clicked on turning it red (non-tagged scenario)
Given the box in the page is green
When the user clicks on the box
Then the box turns red

@test_tag
Scenario: The green box is clicked on turning it red (tagged scenario)
Given the box in the page is green
When the user clicks on the box
Then the box turns red
10 changes: 5 additions & 5 deletions lib/adapter.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions source/adapter/cucumber_runner.js
Expand Up @@ -35,8 +35,10 @@
self.features.push([featureFilePath, fileContents]);
},

startCucumberRun: function startCucumberRun() {
var cucumber = CucumberRunner.Cucumber(self.features, self.stepDefinitionsFunction);
startCucumberRun: function startCucumberRun(options) {
options = options || {tags: []};

var cucumber = CucumberRunner.Cucumber(self.features, self.stepDefinitionsFunction, options);
cucumber.attachListener(CucumberRunner.HtmlListener());
cucumber.attachListener(CucumberRunner.KarmaListener(karma));
cucumber.attachListener(CucumberRunner.Cucumber.Listener.PrettyFormatter({
Expand Down
10 changes: 8 additions & 2 deletions spec/adapter/cucumber_runner_spec.js
Expand Up @@ -199,10 +199,16 @@ define(['source/adapter/cucumber_runner', 'spec/support/helper'], function (Cucu
});

describe('startCucumberRun()', function () {
it('starts a Cucumber with the loaded features and step definitions', function () {
it('starts a Cucumber with the loaded features, step definitions, and default options', function () {
cucumberRunner.startCucumberRun();

expect(CucumberRunner.Cucumber).toHaveBeenCalledWith(cucumberRunner.features, cucumberRunner.stepDefinitionsFunction)
expect(CucumberRunner.Cucumber).toHaveBeenCalledWith(cucumberRunner.features, cucumberRunner.stepDefinitionsFunction, {tags: []})
});

it('starts a Cucumber with the loaded features, step definitions, and options passed to it', function () {
cucumberRunner.startCucumberRun({tags: ["@my_tags"]});

expect(CucumberRunner.Cucumber).toHaveBeenCalledWith(cucumberRunner.features, cucumberRunner.stepDefinitionsFunction, {tags: ["@my_tags"]})
});

it('starts an HtmlListener to add to Cucumber', function () {
Expand Down

0 comments on commit 7d20907

Please sign in to comment.