From fa2da132acc5726a8a9d8d93412f9b72e78538d6 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Mon, 23 Dec 2024 11:12:26 -0500 Subject: [PATCH 1/2] convert field name to ts client attribute name --- features/step_definitions/request_steps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/request_steps.ts b/features/step_definitions/request_steps.ts index a538992a05c3..126f08f329b9 100644 --- a/features/step_definitions/request_steps.ts +++ b/features/step_definitions/request_steps.ts @@ -293,14 +293,14 @@ Then( Then( "the response {string} has field {string}", function (this: World, responsePath: string, field: string) { - expect(pathLookup(this.response, responsePath)).to.have.property(field); + expect(pathLookup(this.response, responsePath)).to.have.property(field.toAttributeName()); } ); Then( "the response {string} does not have field {string}", function (this: World, responsePath: string, field: string) { - expect(pathLookup(this.response, responsePath)).to.not.have.property(field); + expect(pathLookup(this.response, responsePath)).to.not.have.property(field.toAttributeName()); } ); From bff71e4917701d2b635566784c6ca63377cb2040 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 23 Dec 2024 16:37:07 +0000 Subject: [PATCH 2/2] Regenerate client from commit 19946d35 of spec repo --- .apigentools-info | 8 +++---- .generator/schemas/v1/openapi.yaml | 3 +++ .../frozen.json | 2 +- .../recording.har | 24 +++++++++---------- features/v1/synthetics.feature | 1 + .../models/SyntheticsStep.ts | 8 +++++++ 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index c9142bf33415..42d36af35b75 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-19 07:26:26.500720", - "spec_repo_commit": "5dd2cbe4" + "regenerated": "2024-12-23 16:35:39.161263", + "spec_repo_commit": "19946d35" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-19 07:26:26.515806", - "spec_repo_commit": "5dd2cbe4" + "regenerated": "2024-12-23 16:35:39.176070", + "spec_repo_commit": "19946d35" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index dc238c59a76a..1a448cf0f1fd 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -16274,6 +16274,9 @@ components: params: description: The parameters of the step. type: object + public_id: + description: The public ID of the step. + type: string timeout: description: The time before declaring a step failed. format: int64 diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json index aad1098b2144..6fb6611141b3 100644 --- a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json +++ b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json @@ -1 +1 @@ -"2024-12-09T11:17:43.729Z" +"2024-12-23T09:47:16.115Z" diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har index 05a55582c345..35ee0e961ded 100644 --- a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har +++ b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "4e32bcaed31500170b9264bdf9de2af4", + "_id": "6c8aaa45f828f0ab1b86692420d7b4b4", "_order": 0, "cache": {}, "request": { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"config\":{\"assertions\":[],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"certificateDomains\":[\"https://datadoghq.com\"],\"method\":\"GET\",\"url\":\"https://datadoghq.com\"},\"setCookie\":\"name:test\"},\"locations\":[\"aws:us-east-2\"],\"message\":\"Test message\",\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1733743063\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"ci\":{\"executionRule\":\"skipped\"},\"device_ids\":[\"tablet\"],\"disableCors\":true,\"disableCsp\":true,\"follow_redirects\":true,\"ignoreServerCertificateError\":true,\"initialNavigationTimeout\":200,\"min_failure_duration\":10,\"min_location_failed\":1,\"noScreenshot\":true,\"retry\":{\"count\":2,\"interval\":10},\"rumSettings\":{\"applicationId\":\"mockApplicationId\",\"clientTokenId\":12345,\"isEnabled\":true},\"tick_every\":300},\"steps\":[{\"allowFailure\":false,\"isCritical\":true,\"name\":\"Refresh page\",\"params\":{},\"type\":\"refresh\"}],\"tags\":[\"testing:browser\"],\"type\":\"browser\"}" + "text": "{\"config\":{\"assertions\":[],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"certificateDomains\":[\"https://datadoghq.com\"],\"method\":\"GET\",\"url\":\"https://datadoghq.com\"},\"setCookie\":\"name:test\"},\"locations\":[\"aws:us-east-2\"],\"message\":\"Test message\",\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1734947236\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"ci\":{\"executionRule\":\"skipped\"},\"device_ids\":[\"tablet\"],\"disableCors\":true,\"disableCsp\":true,\"follow_redirects\":true,\"ignoreServerCertificateError\":true,\"initialNavigationTimeout\":200,\"min_failure_duration\":10,\"min_location_failed\":1,\"noScreenshot\":true,\"retry\":{\"count\":2,\"interval\":10},\"rumSettings\":{\"applicationId\":\"mockApplicationId\",\"clientTokenId\":12345,\"isEnabled\":true},\"tick_every\":300},\"steps\":[{\"allowFailure\":false,\"isCritical\":true,\"name\":\"Refresh page\",\"params\":{},\"type\":\"refresh\"}],\"tags\":[\"testing:browser\"],\"type\":\"browser\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/tests/browser" }, "response": { - "bodySize": 1462, + "bodySize": 1466, "content": { "mimeType": "application/json", - "size": 1462, - "text": "{\"public_id\":\"jj5-nke-dq2\",\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1733743063\",\"status\":\"paused\",\"type\":\"browser\",\"tags\":[\"testing:browser\"],\"created_at\":\"2024-12-09T11:17:44.348239+00:00\",\"modified_at\":\"2024-12-09T11:17:44.348239+00:00\",\"config\":{\"assertions\":[],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"certificateDomains\":[\"https://datadoghq.com\"],\"method\":\"GET\",\"url\":\"https://datadoghq.com\"},\"setCookie\":\"name:test\"},\"message\":\"Test message\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"ci\":{\"executionRule\":\"skipped\"},\"device_ids\":[\"tablet\"],\"disableCors\":true,\"disableCsp\":true,\"follow_redirects\":true,\"ignoreServerCertificateError\":true,\"initialNavigationTimeout\":200,\"min_failure_duration\":10,\"min_location_failed\":1,\"noScreenshot\":true,\"retry\":{\"count\":2,\"interval\":10},\"rumSettings\":{\"applicationId\":\"mockApplicationId\",\"clientTokenId\":12345,\"isEnabled\":true},\"tick_every\":300},\"locations\":[\"aws:us-east-2\"],\"created_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":159881000,\"org_id\":321813,\"modified_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"steps\":[{\"name\":\"Refresh page\",\"params\":{},\"type\":\"refresh\",\"public_id\":\"yb6-rim-kwp\",\"allowFailure\":false,\"isCritical\":true}],\"stepCount\":{\"assertions\":0,\"subtests\":0,\"total\":1}}" + "size": 1466, + "text": "{\"public_id\":\"2pq-h6b-phj\",\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1734947236\",\"status\":\"paused\",\"type\":\"browser\",\"tags\":[\"testing:browser\"],\"created_at\":\"2024-12-23T09:47:16.924773+00:00\",\"modified_at\":\"2024-12-23T09:47:16.924773+00:00\",\"config\":{\"assertions\":[],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"certificateDomains\":[\"https://datadoghq.com\"],\"method\":\"GET\",\"url\":\"https://datadoghq.com\"},\"setCookie\":\"name:test\"},\"message\":\"Test message\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"ci\":{\"executionRule\":\"skipped\"},\"device_ids\":[\"tablet\"],\"disableCors\":true,\"disableCsp\":true,\"follow_redirects\":true,\"ignoreServerCertificateError\":true,\"initialNavigationTimeout\":200,\"min_failure_duration\":10,\"min_location_failed\":1,\"noScreenshot\":true,\"retry\":{\"count\":2,\"interval\":10},\"rumSettings\":{\"applicationId\":\"mockApplicationId\",\"clientTokenId\":12345,\"isEnabled\":true},\"tick_every\":300},\"locations\":[\"aws:us-east-2\"],\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":161011666,\"org_id\":321813,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"steps\":[{\"name\":\"Refresh page\",\"params\":{},\"type\":\"refresh\",\"public_id\":\"uwt-8ia-g4p\",\"allowFailure\":false,\"isCritical\":true}],\"stepCount\":{\"assertions\":0,\"subtests\":0,\"total\":1}}" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-12-09T11:17:43.734Z", - "time": 790 + "startedDateTime": "2024-12-23T09:47:16.124Z", + "time": 1035 }, { - "_id": "d7ff174d7e0965377dd6e8bdf360f422", + "_id": "07f3b17b251a4a6ed38193d876d04fdd", "_order": 0, "cache": {}, "request": { @@ -85,7 +85,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"public_ids\":[\"jj5-nke-dq2\"]}" + "text": "{\"public_ids\":[\"2pq-h6b-phj\"]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete" @@ -95,7 +95,7 @@ "content": { "mimeType": "application/json", "size": 96, - "text": "{\"deleted_tests\":[{\"public_id\":\"jj5-nke-dq2\",\"deleted_at\":\"2024-12-09T11:17:45.340410+00:00\"}]}\n" + "text": "{\"deleted_tests\":[{\"public_id\":\"2pq-h6b-phj\",\"deleted_at\":\"2024-12-23T09:47:17.898440+00:00\"}]}\n" }, "cookies": [], "headers": [ @@ -110,8 +110,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-12-09T11:17:44.534Z", - "time": 1004 + "startedDateTime": "2024-12-23T09:47:17.172Z", + "time": 983 } ], "pages": [], diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 3a6b14a29418..c6962b4dbab5 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -65,6 +65,7 @@ Feature: Synthetics And the response "options.rumSettings.isEnabled" is equal to true And the response "options.rumSettings.applicationId" is equal to "mockApplicationId" And the response "options.rumSettings.clientTokenId" is equal to 12345 + And the response "steps[0]" has field "public_id" @team:DataDog/synthetics-ct Scenario: Create a browser test returns "OK - Returns the created test details." response diff --git a/packages/datadog-api-client-v1/models/SyntheticsStep.ts b/packages/datadog-api-client-v1/models/SyntheticsStep.ts index 32f80fab3333..7916c2c3b5ea 100644 --- a/packages/datadog-api-client-v1/models/SyntheticsStep.ts +++ b/packages/datadog-api-client-v1/models/SyntheticsStep.ts @@ -39,6 +39,10 @@ export class SyntheticsStep { * The parameters of the step. */ "params"?: any; + /** + * The public ID of the step. + */ + "publicId"?: string; /** * The time before declaring a step failed. */ @@ -92,6 +96,10 @@ export class SyntheticsStep { baseName: "params", type: "any", }, + publicId: { + baseName: "public_id", + type: "string", + }, timeout: { baseName: "timeout", type: "number",