Skip to content

Commit 833cee8

Browse files
mjmadhumikeharder
andauthored
Data Plane - Microsoft.AzurePlaywrightService integration into Microsoft.LoadTestService (#34012)
* First commit of adding existing Playwright Dataplane APIs in Microsoft.LaodTestService * Added APIs for Playwright in Microsoft.Loadtestservice * Added readme changes for fixing CI failures * Resolved examples error * Removed playwright folder for proper naming * Renamed playwright service folder * Removed shared folder as suggested * Readme files modifications * Added missing version from readme * Renamed folder as suggested * Removed code to swagger sections from readme * Generate-metadata set to true * Removed GET workspaces API and added patterns * TSP Formatting * Added suppressions.yaml * Removing deprecated preview versions * Formatting files * Guid maxlength correction * Maxlength correction * Re-checking swagger lint diff errors * Removed all suppressions * Resolved example issue * Added runid as query param in get brwosers api * Added test runs APIs * Added certain validations * Updated example * Updated tspconfig.yaml * TSP Validation fix * Review comments on Test run model * Review comments on Test run model * Fixed Typo in property name for model validation * TSP Validation fix * TSP Validation fix * TSP Validation fix * TSP Validation fix * TSP Validation fix --------- Co-authored-by: Mike Harder <[email protected]>
1 parent e279afe commit 833cee8

File tree

307 files changed

+2087
-9621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+2087
-9621
lines changed

specification/loadtestservice/LoadTestService/tspconfig.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
parameters:
22
service-dir:
33
default: "sdk/loadtesting"
4+
"service-name":
5+
default: "loadtesting"
46
emit:
57
- "@azure-tools/typespec-autorest"
68
# Uncomment this line and add "@azure-tools/typespec-python" to your package.json to generate Python code
@@ -37,7 +39,8 @@ options:
3739
package-dir: "load-testing-rest"
3840
title: Azure Load Testing
3941
description: Azure Load Testing Client
40-
generate-metadata: false
42+
generate-metadata: true
43+
generate-test: false
4144
package-details:
4245
name: "@azure-rest/load-testing"
4346
description: "This package contains Microsoft Azure LoadTestingClient client library."
@@ -57,5 +60,5 @@ options:
5760
partial-update: true
5861
generate-tests: false
5962
generate-samples: false
60-
service-name: Load Testing
63+
service-name: Load Test
6164
flavor: azure
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"title": "AccessTokens_CreateOrReplace",
3+
"operationId": "AccessTokens_CreateOrReplace",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000",
7+
"accessTokenId": "00000000-0000-0000-0000-000000000000",
8+
"resource": {
9+
"name": "sampleAccessToken",
10+
"expiryAt": "2022-09-28T12:32:33Z"
11+
}
12+
},
13+
"responses": {
14+
"200": {
15+
"body": {
16+
"id": "00000000-0000-0000-0000-000000000000",
17+
"name": "sampleAccessToken",
18+
"jwtToken": "sampleJwtToken",
19+
"createdAt": "2021-09-28T12:32:33Z",
20+
"expiryAt": "2022-09-28T12:32:33Z",
21+
"state": "Active"
22+
}
23+
},
24+
"201": {
25+
"body": {
26+
"id": "00000000-0000-0000-0000-000000000000",
27+
"name": "sampleAccessToken",
28+
"jwtToken": "sampleJwtToken",
29+
"createdAt": "2021-09-28T12:32:33Z",
30+
"expiryAt": "2022-09-28T12:32:33Z",
31+
"state": "Active"
32+
}
33+
}
34+
}
35+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"title": "AccessTokens_Delete",
3+
"operationId": "AccessTokens_Delete",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000",
7+
"accessTokenId": "00000000-0000-0000-0000-000000000000"
8+
},
9+
"responses": {
10+
"204": {}
11+
}
12+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"title": "AccessTokens_Get",
3+
"operationId": "AccessTokens_Get",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000",
7+
"accessTokenId": "00000000-0000-0000-0000-000000000000"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"id": "00000000-0000-0000-0000-000000000000",
13+
"name": "sampleAccessToken",
14+
"createdAt": "2021-09-28T12:32:33Z",
15+
"expiryAt": "2022-09-28T12:32:33Z",
16+
"state": "Active"
17+
}
18+
}
19+
}
20+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"title": "AccessTokens_List",
3+
"operationId": "AccessTokens_List",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "00000000-0000-0000-0000-000000000000",
14+
"name": "sampleAccessToken",
15+
"createdAt": "2021-09-28T12:32:33Z",
16+
"expiryAt": "2022-09-28T12:32:33Z",
17+
"state": "Active"
18+
}
19+
],
20+
"nextLink": null
21+
}
22+
}
23+
}
24+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"title": "TestRuns_CreateOrUpdate",
3+
"operationId": "TestRuns_CreateOrUpdate",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000",
7+
"runId": "00000000-0000-0000-0000-000000000000",
8+
"resource": {
9+
"displayName": "sampleTestRun"
10+
}
11+
},
12+
"responses": {
13+
"200": {
14+
"body": {
15+
"id": "00000000-0000-0000-0000-000000000000",
16+
"displayName": "sampleTestRun",
17+
"creatorId": "string",
18+
"creatorName": "string",
19+
"config": {
20+
"framework": {
21+
"name": "string",
22+
"version": "string",
23+
"runnerName": "string"
24+
},
25+
"sdkLanguage": "JAVASCRIPT",
26+
"maxWorkers": 10
27+
},
28+
"ciConfig": {
29+
"providerName": "string",
30+
"branch": "string",
31+
"author": "string",
32+
"commitId": "string",
33+
"revisionUrl": "string"
34+
},
35+
"summary": {
36+
"status": "RUNNING",
37+
"billableTime": 0,
38+
"numBrowserSessions": 1,
39+
"maxConcurrentBrowserSessions": 10,
40+
"startTime": "2025-06-06T11:43:28.954Z",
41+
"endTime": "2025-06-06T11:43:28.954Z",
42+
"duration": 0,
43+
"errorMessages": [
44+
"string"
45+
]
46+
}
47+
}
48+
},
49+
"201": {
50+
"body": {
51+
"id": "00000000-0000-0000-0000-000000000000",
52+
"displayName": "sampleTestRun",
53+
"creatorId": "string",
54+
"creatorName": "string",
55+
"config": {
56+
"framework": {
57+
"name": "string",
58+
"version": "string",
59+
"runnerName": "string"
60+
},
61+
"sdkLanguage": "JAVASCRIPT",
62+
"maxWorkers": 10
63+
},
64+
"ciConfig": {
65+
"providerName": "string",
66+
"branch": "string",
67+
"author": "string",
68+
"commitId": "string",
69+
"revisionUrl": "string"
70+
},
71+
"summary": {
72+
"status": "RUNNING",
73+
"billableTime": 0,
74+
"numBrowserSessions": 1,
75+
"maxConcurrentBrowserSessions": 10,
76+
"startTime": "2025-06-06T11:43:28.954Z",
77+
"endTime": "2025-06-06T11:43:28.954Z",
78+
"duration": 0,
79+
"errorMessages": [
80+
"string"
81+
]
82+
}
83+
}
84+
}
85+
}
86+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"title": "TestRuns_List",
3+
"operationId": "TestRuns_List",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "00000000-0000-0000-0000-000000000000",
14+
"displayName": "string",
15+
"creatorId": "string",
16+
"creatorName": "string",
17+
"config": {
18+
"framework": {
19+
"name": "string",
20+
"version": "string",
21+
"runnerName": "string"
22+
},
23+
"sdkLanguage": "JAVASCRIPT",
24+
"maxWorkers": 10
25+
},
26+
"ciConfig": {
27+
"providerName": "string",
28+
"branch": "string",
29+
"author": "string",
30+
"commitId": "string",
31+
"revisionUrl": "string"
32+
},
33+
"summary": {
34+
"status": "RUNNING",
35+
"billableTime": 0,
36+
"numBrowserSessions": 1,
37+
"maxConcurrentBrowserSessions": 10,
38+
"startTime": "2025-06-06T11:43:28.954Z",
39+
"endTime": "2025-06-06T11:43:28.954Z",
40+
"duration": 0,
41+
"errorMessages": [
42+
"string"
43+
]
44+
}
45+
}
46+
],
47+
"nextLink": null
48+
}
49+
}
50+
}
51+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"title": "Workspaces_GetBrowsers",
3+
"operationId": "Workspaces_GetBrowsers",
4+
"parameters": {
5+
"api-version": "2025-07-01-preview",
6+
"workspaceId": "00000000-0000-0000-0000-000000000000",
7+
"os": "Linux"
8+
},
9+
"responses": {
10+
"302": {
11+
"headers": {
12+
"location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2025-07-01-preview&os=Linux"
13+
}
14+
}
15+
}
16+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// cheat-sheet - https://microsoft.github.io/typespec/standard-library/http/cheat-sheet
2+
// tsp compile main.tsp --emit @azure-tools/typespec-autorest
3+
4+
import "@typespec/http";
5+
import "@typespec/versioning";
6+
import "./routes.tsp";
7+
8+
using TypeSpec.Http;
9+
using TypeSpec.Versioning;
10+
11+
@server(
12+
"{endpoint}",
13+
"Playwright Service API Endpoint",
14+
{
15+
@doc("""
16+
Supported Playwright Service API Endpoints (protocol and hostname) formatted as https://{region}.api.playwright.microsoft.com.
17+
You can also find this value in the Azure Playwright Workspace property, such as `dataplaneUri`.
18+
""")
19+
endpoint: string,
20+
}
21+
)
22+
@useAuth(
23+
[
24+
OAuth2Auth<[
25+
{
26+
type: OAuth2FlowType.implicit,
27+
description: "We can use OAuth2 Implicit flow to get the auth token for calling the APIs.",
28+
authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize",
29+
scopes: ["https://playwright.microsoft.com/.default"],
30+
}
31+
]>,
32+
OAuth2Auth<[
33+
{
34+
type: OAuth2FlowType.authorizationCode,
35+
description: "We can use OAuth2 Authorization Code flow to get the auth token for calling the APIs.",
36+
authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize",
37+
tokenUrl: "https://login.microsoftonline.com/common/v2.0/oauth2/token",
38+
scopes: ["https://playwright.microsoft.com/.default"],
39+
}
40+
]>
41+
]
42+
)
43+
@service(#{ title: "Playwright Service API" })
44+
@versioned(Playwright.Versions)
45+
namespace Playwright;
46+
47+
@doc("Playwright Service API Versions.")
48+
enum Versions {
49+
@doc("Version 2025-07-01-preview")
50+
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
51+
v2025_07_01_preview: "2025-07-01-preview",
52+
}

0 commit comments

Comments
 (0)