diff --git a/spec/test/features/data/handler/error_itemnotfound.feature b/spec/test/features/data/handler/error_itemnotfound.feature index 2f38076..535ed11 100644 --- a/spec/test/features/data/handler/error_itemnotfound.feature +++ b/spec/test/features/data/handler/error_itemnotfound.feature @@ -1,4 +1,3 @@ -@wip Feature: Fail to retrieve nonexistent resource items in Kapow! server. If trying to access a nonexistent resource item then the server responds with a no content error. diff --git a/spec/test/features/data/handler/error_notfound.feature b/spec/test/features/data/handler/error_notfound.feature index 8a04294..33a0468 100644 --- a/spec/test/features/data/handler/error_notfound.feature +++ b/spec/test/features/data/handler/error_notfound.feature @@ -8,7 +8,7 @@ Feature: Fail to retrieve resources from nonexistent handler in Kapow! server. error. Given I have a running Kapow! server - When I get the resource "request/path" for the handler with id XXXXXXXXXX + When I get the resource "/request/path" for the handler with id "XXXXXXXXXX" Then I get 404 as response code And I get "Not Found" as response reason phrase @@ -19,6 +19,6 @@ Feature: Fail to retrieve resources from nonexistent handler in Kapow! server. invalid. Given I have a running Kapow! server - When I get the resource "invalid/path" for the handler with id XXXXXXXXXX + When I get the resource "/invalid/path" for the handler with id "XXXXXXXXXX" Then I get 404 as response code And I get "Not Found" as response reason phrase diff --git a/spec/test/features/data/handler/success.feature b/spec/test/features/data/handler/success.feature index cd1b9e0..1101048 100644 --- a/spec/test/features/data/handler/success.feature +++ b/spec/test/features/data/handler/success.feature @@ -12,7 +12,7 @@ Feature: Retrieve a resource from a handler in Kapow! server. | method | url_pattern | | GET | /listRootDir | When I send a request to the testing route "/listRootDir" - And I get the resource "request/path" + And I get the resource "/request/path" Then I get 200 as response code And I get "OK" as response reason phrase And I get the following response raw body: @@ -28,7 +28,7 @@ Feature: Retrieve a resource from a handler in Kapow! server. | method | url_pattern | | GET | /listRootDir | When I send a request to the testing route "/listRootDir" - And I get the resource "request/headers/Host" + And I get the resource "/request/headers/Host" Then I get 200 as response code And I get "OK" as response reason phrase And I get the following response raw body: diff --git a/spec/test/features/data/response/success.feature b/spec/test/features/data/response/success.feature index 36a7cec..3e00bd1 100644 --- a/spec/test/features/data/response/success.feature +++ b/spec/test/features/data/response/success.feature @@ -11,7 +11,7 @@ Feature: Setting values for handler response resources in Kapow! server. | method | url_pattern | | GET | /listRootDir | When I send a request to the testing route "/listRootDir" - And I set the resource "response/status" with value "418" + And I set the resource "/response/status" with value "418" And I release the testing request Then I get 418 as response code diff --git a/spec/test/features/steps/steps.py b/spec/test/features/steps/steps.py index 55422de..aaa000e 100644 --- a/spec/test/features/steps/steps.py +++ b/spec/test/features/steps/steps.py @@ -231,9 +231,13 @@ def step_impl(context, order): @when('I get the resource "{resource}"') -def step_impl(context, resource): +@when('I get the resource "{resource}" for the handler with id "{handler_id}"') +def step_impl(context, resource, handler_id=None): + if handler_id is None: + handler_id = context.testing_handler_id + context.response = requests.get( - f"{Env.KAPOW_DATAAPI_URL}/handlers/{context.testing_handler_id}{resource}") + f"{Env.KAPOW_DATAAPI_URL}/handlers/{handler_id}{resource}") @when('I set the resource "{resource}" with value "{value}"')