diff --git a/.apigentools-info b/.apigentools-info index dbfbf16c0d..6f4b00f219 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-04 15:23:38.044155", - "spec_repo_commit": "fe4f848e" + "regenerated": "2024-09-04 17:12:33.836340", + "spec_repo_commit": "8e0507d2" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-04 15:23:38.061137", - "spec_repo_commit": "fe4f848e" + "regenerated": "2024-09-04 17:12:33.853825", + "spec_repo_commit": "8e0507d2" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index ab04f89cbe..507a26a653 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13873,6 +13873,7 @@ components: - $ref: '#/components/schemas/SyntheticsAssertionJSONPathTarget' - $ref: '#/components/schemas/SyntheticsAssertionJSONSchemaTarget' - $ref: '#/components/schemas/SyntheticsAssertionXPathTarget' + - $ref: '#/components/schemas/SyntheticsAssertionJavascript' SyntheticsAssertionBodyHashOperator: description: Assertion operator to apply. enum: @@ -13989,6 +13990,27 @@ components: metaSchema: $ref: '#/components/schemas/SyntheticsAssertionJSONSchemaMetaSchema' type: object + SyntheticsAssertionJavascript: + description: A JavaScript assertion. + properties: + code: + description: The JavaScript code that performs the assertions. + example: dd.expect(dd.response.statusCode).to.equal(200); + type: string + type: + $ref: '#/components/schemas/SyntheticsAssertionJavascriptType' + required: + - type + - code + type: object + SyntheticsAssertionJavascriptType: + description: Type of the assertion. + enum: + - javascript + example: javascript + type: string + x-enum-varnames: + - JAVASCRIPT SyntheticsAssertionOperator: description: Assertion operator to apply. enum: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 1f79d7d684..5145c74389 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -3910,6 +3910,20 @@ datadog\_api\_client.v1.model.synthetics\_assertion\_body\_hash\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.synthetics\_assertion\_javascript module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.synthetics_assertion_javascript + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.synthetics\_assertion\_javascript\_type module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.synthetics_assertion_javascript_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.synthetics\_assertion\_json\_path\_operator module -------------------------------------------------------------------------------- diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py b/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py index 3c2ee73d0e..a313a8cbcd 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py @@ -10,6 +10,8 @@ from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import SyntheticsAssertionBodyHashOperator from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType +from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript +from datadog_api_client.v1.model.synthetics_assertion_javascript_type import SyntheticsAssertionJavascriptType from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import ( @@ -103,6 +105,10 @@ target="a", type=SyntheticsAssertionBodyHashType.BODY_HASH, ), + SyntheticsAssertionJavascript( + code="const hello = 'world';", + type=SyntheticsAssertionJavascriptType.JAVASCRIPT, + ), ], config_variables=[ SyntheticsConfigVariable( diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py b/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py index f6a5bea69f..ed99a75625 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py @@ -10,6 +10,8 @@ from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import SyntheticsAssertionBodyHashOperator from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType +from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript +from datadog_api_client.v1.model.synthetics_assertion_javascript_type import SyntheticsAssertionJavascriptType from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import ( @@ -103,6 +105,10 @@ target="a", type=SyntheticsAssertionBodyHashType.BODY_HASH, ), + SyntheticsAssertionJavascript( + code="const hello = 'world';", + type=SyntheticsAssertionJavascriptType.JAVASCRIPT, + ), ], config_variables=[ SyntheticsConfigVariable( diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_config.py b/src/datadog_api_client/v1/model/synthetics_api_test_config.py index 98823c7ec6..65e74f8f21 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_config.py @@ -23,6 +23,7 @@ from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import SyntheticsAssertionJSONSchemaTarget from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget + from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep @@ -62,6 +63,7 @@ def __init__( SyntheticsAssertionJSONPathTarget, SyntheticsAssertionJSONSchemaTarget, SyntheticsAssertionXPathTarget, + SyntheticsAssertionJavascript, ] ], UnsetType, diff --git a/src/datadog_api_client/v1/model/synthetics_assertion.py b/src/datadog_api_client/v1/model/synthetics_assertion.py index 0767a415b5..46f208fe98 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion.py @@ -30,6 +30,9 @@ def __init__(self, **kwargs): :param type: Type of the assertion. :type type: SyntheticsAssertionType + + :param code: The JavaScript code that performs the assertions. + :type code: str """ super().__init__(kwargs) @@ -49,6 +52,7 @@ def _composed_schemas(_): SyntheticsAssertionJSONSchemaTarget, ) from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget + from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript return { "oneOf": [ @@ -57,5 +61,6 @@ def _composed_schemas(_): SyntheticsAssertionJSONPathTarget, SyntheticsAssertionJSONSchemaTarget, SyntheticsAssertionXPathTarget, + SyntheticsAssertionJavascript, ], } diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_javascript.py b/src/datadog_api_client/v1/model/synthetics_assertion_javascript.py new file mode 100644 index 0000000000..4416c65cfb --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_assertion_javascript.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.synthetics_assertion_javascript_type import SyntheticsAssertionJavascriptType + + +class SyntheticsAssertionJavascript(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.synthetics_assertion_javascript_type import SyntheticsAssertionJavascriptType + + return { + "code": (str,), + "type": (SyntheticsAssertionJavascriptType,), + } + + attribute_map = { + "code": "code", + "type": "type", + } + + def __init__(self_, code: str, type: SyntheticsAssertionJavascriptType, **kwargs): + """ + A JavaScript assertion. + + :param code: The JavaScript code that performs the assertions. + :type code: str + + :param type: Type of the assertion. + :type type: SyntheticsAssertionJavascriptType + """ + super().__init__(kwargs) + + self_.code = code + self_.type = type diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_javascript_type.py b/src/datadog_api_client/v1/model/synthetics_assertion_javascript_type.py new file mode 100644 index 0000000000..5bfafb1ee0 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_assertion_javascript_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsAssertionJavascriptType(ModelSimple): + """ + Type of the assertion. + + :param value: If omitted defaults to "javascript". Must be one of ["javascript"]. + :type value: str + """ + + allowed_values = { + "javascript", + } + JAVASCRIPT: ClassVar["SyntheticsAssertionJavascriptType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsAssertionJavascriptType.JAVASCRIPT = SyntheticsAssertionJavascriptType("javascript") diff --git a/src/datadog_api_client/v1/model/synthetics_test_config.py b/src/datadog_api_client/v1/model/synthetics_test_config.py index 28fd45a058..ff7de89b19 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_test_config.py @@ -23,6 +23,7 @@ from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import SyntheticsAssertionJSONSchemaTarget from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget + from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript class SyntheticsTestConfig(ModelNormal): @@ -58,6 +59,7 @@ def __init__( SyntheticsAssertionJSONPathTarget, SyntheticsAssertionJSONSchemaTarget, SyntheticsAssertionXPathTarget, + SyntheticsAssertionJavascript, ] ], UnsetType, diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index bfb8a2a2c2..03c821a1bf 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -641,6 +641,8 @@ from datadog_api_client.v1.model.synthetics_assertion_json_schema_target_target import ( SyntheticsAssertionJSONSchemaTargetTarget, ) +from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript +from datadog_api_client.v1.model.synthetics_assertion_javascript_type import SyntheticsAssertionJavascriptType from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget from datadog_api_client.v1.model.synthetics_assertion_timings_scope import SyntheticsAssertionTimingsScope @@ -1557,6 +1559,8 @@ "SyntheticsAssertionJSONSchemaOperator", "SyntheticsAssertionJSONSchemaTarget", "SyntheticsAssertionJSONSchemaTargetTarget", + "SyntheticsAssertionJavascript", + "SyntheticsAssertionJavascriptType", "SyntheticsAssertionOperator", "SyntheticsAssertionTarget", "SyntheticsAssertionTimingsScope", diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen index cbbd739ef9..e9272dcbf7 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen @@ -1 +1 @@ -2024-06-14T14:40:25.126Z \ No newline at end of file +2024-08-05T15:40:27.317Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml index efa8dcc6af..6f0082bd3a 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptesthasbodyhashfilledout1718376025"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718376025","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718376025","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptesthasbodyhashfilledout1722872427"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1722872427","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1722872427","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"xtt-2y8-fcx","name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718376025","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T14:40:25.693877+00:00","modified_at":"2024-06-14T14:40:25.693877+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"rnn-mpb-3w9","name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1722872427","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-05T15:40:27.974869+00:00","modified_at":"2024-08-05T15:40:27.974869+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptesthasbodyhashfilledout1718376025"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718376025","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147123918,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptesthasbodyhashfilledout1722872427"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1722872427","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150596447,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -23,7 +25,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["xtt-2y8-fcx"]}' + body: '{"public_ids":["rnn-mpb-3w9"]}' headers: accept: - application/json @@ -33,7 +35,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"xtt-2y8-fcx","deleted_at":"2024-06-14T14:40:26.443538+00:00"}]} + string: '{"deleted_tests":[{"public_id":"rnn-mpb-3w9","deleted_at":"2024-08-05T15:40:28.861853+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen index bf0c13ee94..3bd4c52310 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen @@ -1 +1 @@ -2024-06-14T13:54:40.785Z \ No newline at end of file +2024-08-05T15:40:13.862Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml index 5b7253381e..992ab21e1c 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1718373280"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1718373280","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1718373280","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1722872413"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1722872413","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1722872413","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"yii-sbp-va9","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1718373280","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T13:54:41.406061+00:00","modified_at":"2024-06-14T13:54:41.406061+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"8wt-aya-663","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1722872413","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-05T15:40:14.528146+00:00","modified_at":"2024-08-05T15:40:14.528146+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1718373280"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1718373280","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147119987,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1722872413"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1722872413","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150596415,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -23,7 +25,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["yii-sbp-va9"]}' + body: '{"public_ids":["8wt-aya-663"]}' headers: accept: - application/json @@ -33,7 +35,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"yii-sbp-va9","deleted_at":"2024-06-14T13:54:42.878475+00:00"}]} + string: '{"deleted_tests":[{"public_id":"8wt-aya-663","deleted_at":"2024-08-05T15:40:15.441085+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen index f012842d6a..634b6c41f5 100644 --- a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen @@ -1 +1 @@ -2024-06-14T15:20:34.634Z \ No newline at end of file +2024-08-06T12:04:08.273Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml index 495ca9ed4d..522ff8a00e 100644 --- a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1718378434"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1718378434","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1718378434","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1722945848"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1722945848","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1722945848","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"trj-yx7-u72","name":"Test-Edit_an_API_test_returns_OK_response-1718378434","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T15:20:35.233519+00:00","modified_at":"2024-06-14T15:20:35.233519+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"id6-nrj-7e6","name":"Test-Edit_an_API_test_returns_OK_response-1722945848","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-06T12:04:08.988907+00:00","modified_at":"2024-08-06T12:04:08.988907+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1718378434"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1718378434","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147128243,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1722945848"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1722945848","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150677881,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -24,21 +26,21 @@ interactions: message: OK - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1718378434"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1718378434-updated","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"status":"live","subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1722945848"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1722945848-updated","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"status":"live","subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json content-type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v1/synthetics/tests/api/trj-yx7-u72 + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api/id6-nrj-7e6 response: body: - string: '{"public_id":"trj-yx7-u72","name":"Test-Edit_an_API_test_returns_OK_response-1718378434-updated","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T15:20:35.233519+00:00","modified_at":"2024-06-14T15:20:36.567938+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"id6-nrj-7e6","name":"Test-Edit_an_API_test_returns_OK_response-1722945848-updated","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-06T12:04:08.988907+00:00","modified_at":"2024-08-06T12:04:10.449074+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1718378434"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"message":"BDD - test payload: synthetics_api_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147128243,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"overall_state":2,"overall_state_modified":"2024-06-14T15:20:36.622813+00:00"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1722945848"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"message":"BDD + test payload: synthetics_api_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150677881,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"overall_state":2,"overall_state_modified":"2024-08-06T12:04:10.507109+00:00"}' headers: content-type: - application/json @@ -46,7 +48,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["trj-yx7-u72"]}' + body: '{"public_ids":["id6-nrj-7e6"]}' headers: accept: - application/json @@ -56,7 +58,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"trj-yx7-u72","deleted_at":"2024-06-14T15:20:37.970715+00:00"}]} + string: '{"deleted_tests":[{"public_id":"id6-nrj-7e6","deleted_at":"2024-08-06T12:04:11.994871+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen index 731c5145c9..a375d33a12 100644 --- a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen +++ b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen @@ -1 +1 @@ -2024-06-14T15:19:35.860Z \ No newline at end of file +2024-08-06T12:03:16.833Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml index 894ccfc2a4..8ca2758d5e 100644 --- a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml +++ b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1718378375"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Get_a_synthetics_monitor_s_details-1718378375","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1718378375","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1722945796"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Get_a_synthetics_monitor_s_details-1722945796","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1722945796","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"8xz-6uh-7qb","name":"Test-Get_a_synthetics_monitor_s_details-1718378375","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T15:19:36.457734+00:00","modified_at":"2024-06-14T15:19:36.457734+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"4c7-n7j-xbv","name":"Test-Get_a_synthetics_monitor_s_details-1722945796","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-06T12:03:17.509325+00:00","modified_at":"2024-08-06T12:03:17.509325+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1718378375"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1718378375","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147128145,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1722945796"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1722945796","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150677868,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -28,11 +30,11 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/147128145 + uri: https://api.datadoghq.com/api/v1/monitor/150677868 response: body: - string: '{"id":147128145,"org_id":321813,"type":"synthetics alert","name":"Test-Get_a_synthetics_monitor_s_details-1718378375","message":"BDD - test payload: synthetics_api_http_test_payload.json","tags":["testing:api","probe_dc:aws:us-east-2","check_type:api","check_status:live","ci_execution_rule:blocking"],"query":"no_query","options":{"on_missing_data":"show_no_data","notify_audit":false,"new_host_delay":300,"include_tags":true,"synthetics_check_id":"8xz-6uh-7qb","silenced":{}},"multi":false,"created_at":1718378376000,"created":"2024-06-14T15:19:36.431746+00:00","modified":"2024-06-14T15:19:36.431746+00:00","deleted":null,"restricted_roles":null,"priority":5,"overall_state_modified":null,"overall_state":"No + string: '{"id":150677868,"org_id":321813,"type":"synthetics alert","name":"Test-Get_a_synthetics_monitor_s_details-1722945796","message":"BDD + test payload: synthetics_api_http_test_payload.json","tags":["testing:api","probe_dc:aws:us-east-2","check_type:api","check_status:live","ci_execution_rule:blocking"],"query":"no_query","options":{"on_missing_data":"show_no_data","notify_audit":false,"new_host_delay":300,"include_tags":true,"synthetics_check_id":"4c7-n7j-xbv","silenced":{}},"multi":false,"created_at":1722945797000,"created":"2024-08-06T12:03:17.451148+00:00","modified":"2024-08-06T12:03:17.451148+00:00","deleted":null,"restricted_roles":null,"priority":5,"overall_state_modified":null,"overall_state":"No Data","creator":{"name":null,"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","id":1445416}} ' @@ -43,7 +45,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["8xz-6uh-7qb"]}' + body: '{"public_ids":["4c7-n7j-xbv"]}' headers: accept: - application/json @@ -53,7 +55,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"8xz-6uh-7qb","deleted_at":"2024-06-14T15:19:38.234242+00:00"}]} + string: '{"deleted_tests":[{"public_id":"4c7-n7j-xbv","deleted_at":"2024-08-06T12:03:18.946796+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen index fc3d0f97df..877f06441e 100644 --- a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen @@ -1 +1 @@ -2024-06-14T15:20:59.099Z \ No newline at end of file +2024-08-06T12:04:27.724Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml index 23eee2bb59..21776a43a2 100644 --- a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1718378459"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1718378459","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1718378459","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1722945867"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1722945867","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1722945867","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"tmq-dz3-gvf","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1718378459","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T15:20:59.669335+00:00","modified_at":"2024-06-14T15:20:59.669335+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"jvr-sxa-dek","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1722945867","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-06T12:04:28.349748+00:00","modified_at":"2024-08-06T12:04:28.349748+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1718378459"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1718378459","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147128248,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1722945867"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1722945867","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150677883,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -30,12 +32,13 @@ interactions: content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v1/synthetics/tests/tmq-dz3-gvf + uri: https://api.datadoghq.com/api/v1/synthetics/tests/jvr-sxa-dek response: body: - string: '{"public_id":"tmq-dz3-gvf","name":"New test name","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T15:20:59.669335+00:00","modified_at":"2024-06-14T15:21:00.614278+00:00","config":{"assertions":[{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1718378459"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1718378459","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147128248,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + string: '{"public_id":"jvr-sxa-dek","name":"New test name","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-06T12:04:28.349748+00:00","modified_at":"2024-08-06T12:04:29.397485+00:00","config":{"assertions":[{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1722945867"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1722945867","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150677883,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -43,7 +46,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["tmq-dz3-gvf"]}' + body: '{"public_ids":["jvr-sxa-dek"]}' headers: accept: - application/json @@ -53,7 +56,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"tmq-dz3-gvf","deleted_at":"2024-06-14T15:21:01.503647+00:00"}]} + string: '{"deleted_tests":[{"public_id":"jvr-sxa-dek","deleted_at":"2024-08-06T12:04:30.204129+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen index 9eeec0a396..ac270382ee 100644 --- a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen @@ -1 +1 @@ -2024-06-14T15:21:17.809Z \ No newline at end of file +2024-08-06T12:05:32.428Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml index aa5b6f8025..6dc4ab5e20 100644 --- a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml @@ -1,8 +1,9 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1718378477"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1718378477","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1718378477","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1722945932"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1722945932","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1722945932","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"n2s-zgq-9t7","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1718378477","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-14T15:21:18.387026+00:00","modified_at":"2024-06-14T15:21:18.387026+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"n8y-iq9-udp","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1722945932","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-08-06T12:05:33.055418+00:00","modified_at":"2024-08-06T12:05:33.055418+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1718378477"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1718378477","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":147128256,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1722945932"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1722945932","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":150677915,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' headers: content-type: - application/json @@ -23,7 +25,7 @@ interactions: code: 200 message: OK - request: - body: '{"tests":[{"public_id":"n2s-zgq-9t7"}]}' + body: '{"tests":[{"public_id":"n8y-iq9-udp"}]}' headers: accept: - application/json @@ -33,7 +35,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/trigger response: body: - string: '{"triggered_check_ids":["n2s-zgq-9t7"],"results":[{"public_id":"n2s-zgq-9t7","location":30005,"result_id":"3631876514496720429"}],"locations":[{"id":30005,"name":"aws:us-east-2","display_name":"Ohio + string: '{"triggered_check_ids":["n8y-iq9-udp"],"results":[{"public_id":"n8y-iq9-udp","location":30005,"result_id":"1085660093638008455"}],"locations":[{"id":30005,"name":"aws:us-east-2","display_name":"Ohio (AWS)","region":"Americas","is_active":true,"is_public":true,"metadata":null}],"batch_id":null} ' @@ -44,7 +46,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["n2s-zgq-9t7"]}' + body: '{"public_ids":["n8y-iq9-udp"]}' headers: accept: - application/json @@ -54,7 +56,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"n2s-zgq-9t7","deleted_at":"2024-06-14T15:21:20.295374+00:00"}]} + string: '{"deleted_tests":[{"public_id":"n8y-iq9-udp","deleted_at":"2024-08-06T12:05:35.339864+00:00"}]} ' headers: diff --git a/tests/v1/features/given.json b/tests/v1/features/given.json index 14fec35bfd..990ec9c3da 100644 --- a/tests/v1/features/given.json +++ b/tests/v1/features/given.json @@ -238,7 +238,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"config\": {\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"property\": \"{{ '{{ PROPERTY }}' }}\",\n \"target\": \"text/html\",\n \"type\": \"header\"\n },\n { \"operator\": \"lessThan\", \"target\": 2000, \"type\": \"responseTime\", \"timingsScope\": \"withoutDNS\" },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"elementsOperator\": \"atLeastOneElementMatches\",\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesJSONSchema\",\n \"target\": {\n \"metaSchema\": \"draft-07\",\n \"jsonSchema\": \"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesXPath\",\n \"target\": {\n \"xPath\": \"target-xpath\",\n \"targetValue\": \"0\",\n \"operator\": \"contains\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"md5\",\n \"target\": \"a\",\n \"type\": \"bodyHash\"\n }\n ],\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"variablesFromScript\": \"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\",\n \"request\": {\n \"certificate\": {\n \"cert\": {\n \"content\": \"cert-content\",\n \"filename\": \"cert-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n },\n \"key\": {\n \"content\": \"key-content\",\n \"filename\": \"key-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n }\n },\n \"headers\": { \"unique\": \"{{ unique_lower_alnum }}\" },\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\",\n \"proxy\": {\n \"url\": \"https://datadoghq.com\",\n \"headers\": {}\n },\n \"basicAuth\": {\n \"accessTokenUrl\": \"https://datadog-token.com\",\n \"audience\": \"audience\",\n \"clientId\": \"client-id\",\n \"clientSecret\": \"client-secret\",\n \"resource\": \"resource\",\n \"scope\": \"yoyo\",\n \"tokenApiAuthentication\": \"header\",\n \"type\": \"oauth-client\"\n },\n \"persistCookies\": true\n }\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_http_test_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 10 },\n \"tick_every\": 60,\n \"httpVersion\": \"http2\"\n },\n \"subtype\": \"http\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" + "value": "{\n \"config\": {\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"property\": \"{{ '{{ PROPERTY }}' }}\",\n \"target\": \"text/html\",\n \"type\": \"header\"\n },\n {\n \"operator\": \"lessThan\",\n \"target\": 2000,\n \"type\": \"responseTime\",\n \"timingsScope\": \"withoutDNS\"\n },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"elementsOperator\": \"atLeastOneElementMatches\",\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesJSONSchema\",\n \"target\": {\n \"metaSchema\": \"draft-07\",\n \"jsonSchema\": \"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesXPath\",\n \"target\": {\n \"xPath\": \"target-xpath\",\n \"targetValue\": \"0\",\n \"operator\": \"contains\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"md5\",\n \"target\": \"a\",\n \"type\": \"bodyHash\"\n },\n {\n \"code\": \"const hello = 'world';\",\n \"type\": \"javascript\"\n }\n ],\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"variablesFromScript\": \"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\",\n \"request\": {\n \"certificate\": {\n \"cert\": {\n \"content\": \"cert-content\",\n \"filename\": \"cert-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n },\n \"key\": {\n \"content\": \"key-content\",\n \"filename\": \"key-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n }\n },\n \"headers\": { \"unique\": \"{{ unique_lower_alnum }}\" },\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\",\n \"proxy\": {\n \"url\": \"https://datadoghq.com\",\n \"headers\": {}\n },\n \"basicAuth\": {\n \"accessTokenUrl\": \"https://datadog-token.com\",\n \"audience\": \"audience\",\n \"clientId\": \"client-id\",\n \"clientSecret\": \"client-secret\",\n \"resource\": \"resource\",\n \"scope\": \"yoyo\",\n \"tokenApiAuthentication\": \"header\",\n \"type\": \"oauth-client\"\n },\n \"persistCookies\": true\n }\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_http_test_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 10 },\n \"tick_every\": 60,\n \"httpVersion\": \"http2\"\n },\n \"subtype\": \"http\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" } ], "step": "there is a valid \"synthetics_api_test\" in the system", diff --git a/tests/v1/features/synthetics.feature b/tests/v1/features/synthetics.feature index 217e583377..943f0f6558 100644 --- a/tests/v1/features/synthetics.feature +++ b/tests/v1/features/synthetics.feature @@ -189,6 +189,8 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK - Returns the created test details. And the response "name" is equal to "{{ unique }}" + And the response "config.assertions[7].type" is equal to "javascript" + And the response "config.assertions[7].code" is equal to "const hello = 'world';" @team:DataDog/synthetics-ct Scenario: Create an API HTTP with oauth-rop test returns "OK - Returns the created test details." response diff --git a/tests/v1/features/synthetics_api_http_test_payload.json b/tests/v1/features/synthetics_api_http_test_payload.json index 00627e7b7a..4124db0163 100644 --- a/tests/v1/features/synthetics_api_http_test_payload.json +++ b/tests/v1/features/synthetics_api_http_test_payload.json @@ -7,7 +7,12 @@ "target": "text/html", "type": "header" }, - { "operator": "lessThan", "target": 2000, "type": "responseTime", "timingsScope": "withoutDNS" }, + { + "operator": "lessThan", + "target": 2000, + "type": "responseTime", + "timingsScope": "withoutDNS" + }, { "operator": "validatesJSONPath", "target": { @@ -48,6 +53,10 @@ "operator": "md5", "target": "a", "type": "bodyHash" + }, + { + "code": "const hello = 'world';", + "type": "javascript" } ], "configVariables": [