From 6e839bcd22b719bc1e6e759d0411d3a9cf3de185 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Wed, 20 Jan 2021 16:02:40 +0100 Subject: [PATCH] test(e2e): delete test device after run --- features/Delete.feature | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 features/Delete.feature diff --git a/features/Delete.feature b/features/Delete.feature new file mode 100644 index 00000000..fd5875b5 --- /dev/null +++ b/features/Delete.feature @@ -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}" + } + """