Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

Commit

Permalink
test(e2e): delete test device after run
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jan 20, 2021
1 parent 6058b87 commit 6e839bc
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions features/Delete.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@Last
Feature: Delete the Cat Tracker

This deletes the test device

Background:

Given I am authenticated with AWS key "{env__AWS_ACCESS_KEY_ID}" and secret "{env__AWS_SECRET_ACCESS_KEY}"

Scenario: Delete the cat

When I execute "listThingPrincipals" of the AWS Iot SDK with
"""
{
"thingName": "{env__JOB_ID}"
}
"""
Then "$count(awsSdk.res.principals)" should equal 1
Given I store "awsSdk.res.principals[0]" into "certificateArn"
Given I store "$split(awsSdk.res.principals[0], '/')[1]" into "certificateId"
Given I execute "detachThingPrincipal" of the AWS Iot SDK with
"""
{
"thingName": "{env__JOB_ID}",
"principal": "{certificateArn}"
}
"""
And I execute "updateCertificate" of the AWS Iot SDK with
"""
{
"certificateId": "{certificateId}",
"newStatus": "INACTIVE"
}
"""
And I execute "deleteCertificate" of the AWS Iot SDK with
"""
{
"certificateId": "{certificateId}"
}
"""
And I execute "deleteThing" of the AWS Iot SDK with
"""
{
"thingName": "{env__JOB_ID}"
}
"""

0 comments on commit 6e839bc

Please sign in to comment.