-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: prettify cucumber tests (#706)
- Loading branch information
Showing
73 changed files
with
2,006 additions
and
1,252 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,44 @@ | ||
var { AutoScaling } = require('../../../clients/node/client-auto-scaling-node'); | ||
var { AutoScaling } = require("../../../clients/node/client-auto-scaling-node"); | ||
|
||
module.exports = function() { | ||
this.Before('@autoscaling', function (callback) { | ||
this.service = new AutoScaling({region: 'us-east-1'}); | ||
this.Before("@autoscaling", function(callback) { | ||
this.service = new AutoScaling({ region: "us-east-1" }); | ||
callback(); | ||
}); | ||
|
||
this.Given(/^I create a launch configuration with name "([^"]*)"$/, function(name, callback) { | ||
this.Given(/^I create a launch configuration with name "([^"]*)"$/, function( | ||
name, | ||
callback | ||
) { | ||
var params = { | ||
ImageId: 'ami-1624987f', | ||
InstanceType: 'm1.small', | ||
ImageId: "ami-1624987f", | ||
InstanceType: "m1.small", | ||
LaunchConfigurationName: name | ||
}; | ||
this.request(null, 'createLaunchConfiguration', params, callback, false); | ||
this.request(null, "createLaunchConfiguration", params, callback, false); | ||
}); | ||
|
||
this.Given(/^I describe launch configurations$/, function(callback) { | ||
this.request(null, 'describeLaunchConfigurations', {}, callback); | ||
this.request(null, "describeLaunchConfigurations", {}, callback); | ||
}); | ||
|
||
this.Then(/^the list should contain the launch configuration "([^"]*)"$/, function(name, callback) { | ||
this.assert.contains(this.data.LaunchConfigurations, function(configuration) { | ||
return configuration.LaunchConfigurationName === name; | ||
}); | ||
callback(); | ||
}); | ||
this.Then( | ||
/^the list should contain the launch configuration "([^"]*)"$/, | ||
function(name, callback) { | ||
this.assert.contains(this.data.LaunchConfigurations, function( | ||
configuration | ||
) { | ||
return configuration.LaunchConfigurationName === name; | ||
}); | ||
callback(); | ||
} | ||
); | ||
|
||
this.Then(/^I delete the launch configuration "([^"]*)"$/, function(name, callback) { | ||
var params = {LaunchConfigurationName: name}; | ||
this.request(null, 'deleteLaunchConfiguration', params, callback); | ||
this.Then(/^I delete the launch configuration "([^"]*)"$/, function( | ||
name, | ||
callback | ||
) { | ||
var params = { LaunchConfigurationName: name }; | ||
this.request(null, "deleteLaunchConfiguration", params, callback); | ||
}); | ||
}; |
24 changes: 16 additions & 8 deletions
24
features/cloudformation/step_definitions/cloudformation.js
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 |
---|---|---|
@@ -1,15 +1,23 @@ | ||
var { CloudFormation } = require('../../../clients/node/client-cloudformation-node'); | ||
var { | ||
CloudFormation | ||
} = require("../../../clients/node/client-cloudformation-node"); | ||
|
||
module.exports = function() { | ||
this.Before("@cloudformation", function (callback) { | ||
this.Before("@cloudformation", function(callback) { | ||
this.service = new CloudFormation({}); | ||
callback(); | ||
}); | ||
|
||
this.Given(/^I create a CloudFormation stack with name prefix "([^"]*)"$/, function(prefix, callback) { | ||
this.stackName = this.uniqueName(prefix); | ||
this.templateBody = '{"Resources":{"member":{"Type":"AWS::SQS::Queue"}}}'; | ||
var params = { TemplateBody: this.templateBody, StackName: this.stackName }; | ||
this.request(null, 'createStack', params, callback, false); | ||
}); | ||
this.Given( | ||
/^I create a CloudFormation stack with name prefix "([^"]*)"$/, | ||
function(prefix, callback) { | ||
this.stackName = this.uniqueName(prefix); | ||
this.templateBody = '{"Resources":{"member":{"Type":"AWS::SQS::Queue"}}}'; | ||
var params = { | ||
TemplateBody: this.templateBody, | ||
StackName: this.stackName | ||
}; | ||
this.request(null, "createStack", params, callback, false); | ||
} | ||
); | ||
}; |
38 changes: 20 additions & 18 deletions
38
features/cloudfront/step_definitions/cloudfront-latest.js
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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
module.exports = function() { | ||
this.Given(/^I create a CloudFront distribution with name prefix "([^"]*)"$/, function(prefix, callback) { | ||
this.cfName = this.uniqueName(prefix); | ||
this.cfCreateParams.CallerReference = this.cfName; | ||
this.cfCreateParams.Origins.Items[0].Id = (this.cfName === '' ? 'origin' : 'InvalidOrigin'); | ||
this.request(null, 'createDistribution', { DistributionConfig: this.cfCreateParams }, callback, false); | ||
}); | ||
this.Given( | ||
/^I create a CloudFront distribution with name prefix "([^"]*)"$/, | ||
function(prefix, callback) { | ||
this.cfName = this.uniqueName(prefix); | ||
this.cfCreateParams.CallerReference = this.cfName; | ||
this.cfCreateParams.Origins.Items[0].Id = | ||
this.cfName === "" ? "origin" : "InvalidOrigin"; | ||
this.request( | ||
null, | ||
"createDistribution", | ||
{ DistributionConfig: this.cfCreateParams }, | ||
callback, | ||
false | ||
); | ||
} | ||
); | ||
|
||
this.Given(/^I list CloudFront distributions$/, function(callback) { | ||
this.request(null, 'listDistributions', {}, callback); | ||
this.request(null, "listDistributions", {}, callback); | ||
}); | ||
|
||
}; |
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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
var { CloudSearch } = require('../../../clients/node/client-cloudsearch-node'); | ||
var { CloudSearch } = require("../../../clients/node/client-cloudsearch-node"); | ||
|
||
module.exports = function() { | ||
this.Before("@cloudsearch", function (callback) { | ||
this.Before("@cloudsearch", function(callback) { | ||
this.service = new CloudSearch({}); | ||
callback(); | ||
}); | ||
|
||
this.Given(/^I create a domain with name prefix "([^"]*)"$/, function(prefix, callback) { | ||
this.Given(/^I create a domain with name prefix "([^"]*)"$/, function( | ||
prefix, | ||
callback | ||
) { | ||
this.domainName = this.uniqueName(prefix); | ||
this.request(null, 'createDomain', {DomainName: this.domainName}, callback, false); | ||
this.request( | ||
null, | ||
"createDomain", | ||
{ DomainName: this.domainName }, | ||
callback, | ||
false | ||
); | ||
}); | ||
}; |
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
var { CloudTrail } = require('../../../clients/node/client-cloudtrail-node'); | ||
var { CloudTrail } = require("../../../clients/node/client-cloudtrail-node"); | ||
|
||
module.exports = function() { | ||
this.Before("@cloudtrail", function (callback) { | ||
this.Before("@cloudtrail", function(callback) { | ||
this.service = new CloudTrail({}); | ||
callback(); | ||
}); | ||
|
||
this.Given(/^I describe trails$/, function(callback) { | ||
this.request(null, 'describeTrails', {}, callback); | ||
this.request(null, "describeTrails", {}, callback); | ||
}); | ||
|
||
this.Given(/^I create a trail with an invalid name$/, function(callback) { | ||
this.request(null, 'createTrail', {Name: '', S3BucketName: ''}, callback, false); | ||
this.request( | ||
null, | ||
"createTrail", | ||
{ Name: "", S3BucketName: "" }, | ||
callback, | ||
false | ||
); | ||
}); | ||
}; |
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
6 changes: 4 additions & 2 deletions
6
features/cloudwatchevents/step_definitions/cloudwatchevents.js
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
Oops, something went wrong.