test(insomnia-test): add graphql, grpc, websocket, socket.io, event-stream and mcp specs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Bob QiuandClaude Sonnet 5.5 committed 2026-11-06 15:51:29 +08:00
1 parent fb3239a3be
commit 56d762408a
75 files changed
+511 -436

No files matched your search

@@ -1,11 +1,12 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { EventStreamMethod } from '@package/models/event-stream-request';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { EventStreamMethod } from '../../models/event-stream-request';
import { Project } from '../../models/project';
test('Verify Event Stream Request Sends the API Key Header Until Authentication Is Set to None', async ({ user }) => {
const { eventStreamRequestFlow, workspaceFlow } = user.flowManager;
@@ -23,7 +24,7 @@ test('Verify Event Stream Request Sends the API Key Header Until Authentication
const authenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`${apiKeyName}: ${apiKeyValue}`);
@@ -32,9 +33,9 @@ test('Verify Event Stream Request Sends the API Key Header Until Authentication
const unauthenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain('GET /sse-events/1');
expect(await unauthenticatedResponse.console()).not.toContain(apiKeyName);
expect(await unauthenticatedResponse.console?.()).not.toContain(apiKeyName);
});
@@ -1,11 +1,12 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { EventStreamMethod } from '@package/models/event-stream-request';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { EventStreamMethod } from '../../models/event-stream-request';
import { Project } from '../../models/project';
test('Verify Event Stream Request Sends the Basic Authentication Header Until Authentication Is Set to None', async ({
user,
}) => {
@@ -25,7 +26,7 @@ test('Verify Event Stream Request Sends the Basic Authentication Header Until Au
const authenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`Authorization: Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`);
@@ -34,9 +35,9 @@ test('Verify Event Stream Request Sends the Basic Authentication Header Until Au
const unauthenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain('GET /sse-events/1');
expect(await unauthenticatedResponse.console()).not.toContain('Authorization:');
expect(await unauthenticatedResponse.console?.()).not.toContain('Authorization:');
});
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
test("Verify Event Stream Request Sends the Bearer Token Header Until Authentication Is Set to None", async ({
user,
}) => {
@@ -29,7 +30,7 @@ test("Verify Event Stream Request Sends the Bearer Token Header Until Authentica
const authenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`Authorization: Bearer ${token}`);
@@ -38,11 +39,11 @@ test("Verify Event Stream Request Sends the Bearer Token Header Until Authentica
const unauthenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain("GET /sse-events/1");
expect(await unauthenticatedResponse.console()).not.toContain(
expect(await unauthenticatedResponse.console?.()).not.toContain(
"Authorization:",
);
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { RequestState } from "@package/enums/request-state";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { RequestState } from "../../enums/request-state";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
const eventCount = 20;
test("Verify Disconnecting an Open Event Stream Stops It Early", async ({
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
test("Verify Linked Cookie Is Sent With Event Stream Request", async ({
user,
}) => {
@@ -37,6 +38,6 @@ test("Verify Linked Cookie Is Sent With Event Stream Request", async ({
const responseView = await eventStreamRequestFlow.send(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("Enable cookie sending with jar of 1 cookie");
});
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
test("Verify Duplicated Event Stream Request Keeps Url, Method and Headers", async ({
user,
}) => {
@@ -36,6 +37,6 @@ test("Verify Duplicated Event Stream Request Keeps Url, Method and Headers", asy
expect(duplicated!.url).toBe(request.url);
expect(duplicated!.method).toBe(request.method);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain(`X-Custom: ${headerValue}`);
});
@@ -1,13 +1,14 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { RequestState } from "@package/enums/request-state";
import { EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { RequestState } from "../../enums/request-state";
import { EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
const eventStreamUrl = "http://{{url}}/sse-events/5";
test("Verify Create Event Stream Request", async ({ user }) => {
@@ -1,11 +1,12 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { EventStreamMethod } from '@package/models/event-stream-request';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { EventStreamMethod } from '../../models/event-stream-request';
import { Project } from '../../models/project';
test('Verify Event Stream Request Sends the OAuth 2.0 Header Until Authentication Is Set to None', async ({ user }) => {
const { eventStreamRequestFlow, workspaceFlow } = user.flowManager;
@@ -28,7 +29,7 @@ test('Verify Event Stream Request Sends the OAuth 2.0 Header Until Authenticatio
const authenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`Authorization: Bearer ${tokens.accessToken}`);
@@ -37,9 +38,9 @@ test('Verify Event Stream Request Sends the OAuth 2.0 Header Until Authenticatio
const unauthenticatedResponse = await eventStreamRequestFlow.send(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain('GET /sse-events/1');
expect(await unauthenticatedResponse.console()).not.toContain('Authorization:');
expect(await unauthenticatedResponse.console?.()).not.toContain('Authorization:');
});
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
test("Verify Enabling a Proxy Routes Event Stream Requests Through It", async ({
user,
}) => {
@@ -38,6 +39,6 @@ test("Verify Enabling a Proxy Routes Event Stream Requests Through It", async ({
});
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("Using proxy: http://127.0.0.1:1111");
});
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
test("Verify Template Tag in Event Stream Request Header Is Resolved", async ({
user,
}) => {
@@ -33,6 +34,6 @@ test("Verify Template Tag in Event Stream Request Header Is Resolved", async ({
const responseView = await eventStreamRequestFlow.send(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("X-Tag: YWJj");
});
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER_HTTPS, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, EVENT_STREAM_SERVER_HTTPS, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
test("Verify Event Stream Request Over a TLS Connection", async ({ user }) => {
const { eventStreamRequestFlow, preferencesFlow, workspaceFlow } =
user.flowManager;
@@ -28,7 +29,7 @@ test("Verify Event Stream Request Over a TLS Connection", async ({ user }) => {
const responseView = await eventStreamRequestFlow.send(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("TLSv1.3");
await expect
.poll(
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { EVENT_STREAM_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { EventStreamMethod } from "@package/models/event-stream-request";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { EVENT_STREAM_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { EventStreamMethod } from "../../models/event-stream-request";
import { Project } from "../../models/project";
const variableName = "unlinked";
test("Verify Unlinked Environment Variable Causes Error in Event Stream Request", async ({
@@ -1,12 +1,13 @@
import { faker } from '@faker-js/faker';
import { ContentType } from '@package/enums/content-type';
import { HttpMethod } from '@package/enums/http-method';
import { ProjectType } from '@package/enums/project-types';
import { HTTP_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ContentType } from '../../enums/content-type';
import { HttpMethod } from '../../enums/http-method';
import { ProjectType } from '../../enums/project-types';
import { HTTP_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { Project } from '../../models/project';
const query = '{ characters { results { name } } }';
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -29,14 +30,14 @@ test('Verify GraphQL Request Sends the API Key Header Until Authentication Is Se
await graphqlRequestFlow.setAuthentication(request, { type: 'none' });
const unauthenticatedResponse = await graphqlRequestFlow.send(request);
expect(authenticatedResponse.statusBar.code).toBe(200);
expect(authenticatedResponse.preview).toMatchObject({
expect(authenticatedResponse.statusCode).toBe(200);
expect(authenticatedResponse.body).toMatchObject({
headers: expect.objectContaining({
[apiKeyName.toLowerCase()]: apiKeyValue,
}),
});
expect(unauthenticatedResponse.statusBar.code).toBe(200);
expect((unauthenticatedResponse.preview as { headers: Record<string, string> }).headers).not.toHaveProperty(
expect(unauthenticatedResponse.statusCode).toBe(200);
expect((unauthenticatedResponse.body as { headers: Record<string, string> }).headers).not.toHaveProperty(
apiKeyName.toLowerCase(),
);
});
@@ -1,12 +1,13 @@
import { faker } from '@faker-js/faker';
import { ContentType } from '@package/enums/content-type';
import { HttpMethod } from '@package/enums/http-method';
import { ProjectType } from '@package/enums/project-types';
import { HTTP_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ContentType } from '../../enums/content-type';
import { HttpMethod } from '../../enums/http-method';
import { ProjectType } from '../../enums/project-types';
import { HTTP_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { Project } from '../../models/project';
const query = '{ characters { results { name } } }';
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -31,14 +32,14 @@ test('Verify GraphQL Request Sends the Basic Authentication Header Until Authent
await graphqlRequestFlow.setAuthentication(request, { type: 'none' });
const unauthenticatedResponse = await graphqlRequestFlow.send(request);
expect(authenticatedResponse.statusBar.code).toBe(200);
expect(authenticatedResponse.preview).toMatchObject({
expect(authenticatedResponse.statusCode).toBe(200);
expect(authenticatedResponse.body).toMatchObject({
headers: expect.objectContaining({
authorization: `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`,
}),
});
expect(unauthenticatedResponse.statusBar.code).toBe(200);
expect((unauthenticatedResponse.preview as { headers: Record<string, string> }).headers).not.toHaveProperty(
expect(unauthenticatedResponse.statusCode).toBe(200);
expect((unauthenticatedResponse.body as { headers: Record<string, string> }).headers).not.toHaveProperty(
'authorization',
);
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -35,13 +36,13 @@ test("Verify GraphQL Request Sends the Bearer Token Header Until Authentication
await graphqlRequestFlow.setAuthentication(request, { type: "none" });
const unauthenticatedResponse = await graphqlRequestFlow.send(request);
expect(authenticatedResponse.statusBar.code).toBe(200);
expect(authenticatedResponse.preview).toMatchObject({
expect(authenticatedResponse.statusCode).toBe(200);
expect(authenticatedResponse.body).toMatchObject({
headers: expect.objectContaining({ authorization: `Bearer ${token}` }),
});
expect(unauthenticatedResponse.statusBar.code).toBe(200);
expect(unauthenticatedResponse.statusCode).toBe(200);
expect(
(unauthenticatedResponse.preview as { headers: Record<string, string> })
(unauthenticatedResponse.body as { headers: Record<string, string> })
.headers,
).not.toHaveProperty("authorization");
});
@@ -1,13 +1,14 @@
import { faker } from '@faker-js/faker';
import { ContentType } from '@package/enums/content-type';
import { HttpMethod } from '@package/enums/http-method';
import { ProjectType } from '@package/enums/project-types';
import { RequestState } from '@package/enums/request-state';
import { DEFAULT_TIMEOUT, HTTP_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ContentType } from '../../enums/content-type';
import { HttpMethod } from '../../enums/http-method';
import { ProjectType } from '../../enums/project-types';
import { RequestState } from '../../enums/request-state';
import { DEFAULT_TIMEOUT, HTTP_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { Project } from '../../models/project';
const query = '{ characters { results { name } } }';
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -49,6 +50,6 @@ test('Verify Cancelling an In-Flight GraphQL Request Shows a Cancellation Messag
const laterResponse = await graphqlRequestFlow.send(laterRequest);
expect(requestStateAfterCancel).toBe(RequestState.Idle);
expect(cancelledResponse.statusBar.code).toBeUndefined();
expect(laterResponse.statusBar.code).toBe(200);
expect(cancelledResponse.statusCode).toBeUndefined();
expect(laterResponse.statusCode).toBe(200);
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -36,8 +37,8 @@ test("Verify Linked Cookie Is Sent With GraphQL Request", async ({ user }) => {
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
expect(responseView.preview).toMatchObject({
expect(responseView.statusCode).toBe(200);
expect(responseView.body).toMatchObject({
headers: expect.objectContaining({
cookie: `${cookieKey}=${cookieValue}`,
}),
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -40,7 +41,7 @@ test("Verify Duplicated GraphQL Request Keeps Url, Body and Headers", async ({
expect(duplicated).toBeTruthy();
expect(duplicated!.url).toBe(request.url);
expect(duplicated!.body!.text).toBe(request.body!.text);
expect(responseView.preview).toMatchObject({
expect(responseView.body).toMatchObject({
headers: expect.objectContaining({ "x-custom": headerValue }),
});
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const url = `${HTTP_SERVER}/graphql`;
const query = '{ characters(filter: {status: "Alive"}) { results { name } } }';
const body = {
@@ -34,8 +35,8 @@ test("Verify Create GraphQL Request", async ({ user }) => {
body: body,
});
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
expect(responseView.statusBar.message).toBe("OK");
expect(responseView.statusCode).toBe(200);
expect(responseView.statusMessage).toBe("OK");
expect(responseView.headers).toEqual(
expect.arrayContaining([
expect.objectContaining({
@@ -44,7 +45,7 @@ test("Verify Create GraphQL Request", async ({ user }) => {
}),
]),
);
expect(responseView.preview).toMatchObject({
expect(responseView.body).toMatchObject({
data: {
characters: {
results: expect.arrayContaining(
@@ -1,13 +1,14 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { Project } from "../../models/project";
const url = `${HTTP_SERVER}/graphql`;
const query = "query Ep($id: Int!) { episode(id: $id) { id name } }";
@@ -50,8 +51,8 @@ test("Verify GraphQL Request Renders a Numeric Environment Variable", async ({
});
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
expect(responseView.preview).toMatchObject({
expect(responseView.statusCode).toBe(200);
expect(responseView.body).toMatchObject({
data: { episode: { id: episodeId } },
});
});
@@ -1,12 +1,13 @@
import { faker } from '@faker-js/faker';
import { ContentType } from '@package/enums/content-type';
import { HttpMethod } from '@package/enums/http-method';
import { ProjectType } from '@package/enums/project-types';
import { HTTP_SERVER, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_SERVER, test } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ContentType } from '../../enums/content-type';
import { HttpMethod } from '../../enums/http-method';
import { ProjectType } from '../../enums/project-types';
import { HTTP_SERVER, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_SERVER, test } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { Project } from '../../models/project';
const query = '{ characters { results { name } } }';
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -34,14 +35,14 @@ test('Verify GraphQL Request Sends the OAuth 2.0 Header Until Authentication Is
await graphqlRequestFlow.setAuthentication(request, { type: 'none' });
const unauthenticatedResponse = await graphqlRequestFlow.send(request);
expect(authenticatedResponse.statusBar.code).toBe(200);
expect(authenticatedResponse.preview).toMatchObject({
expect(authenticatedResponse.statusCode).toBe(200);
expect(authenticatedResponse.body).toMatchObject({
headers: expect.objectContaining({
authorization: `Bearer ${tokens.accessToken}`,
}),
});
expect(unauthenticatedResponse.statusBar.code).toBe(200);
expect((unauthenticatedResponse.preview as { headers: Record<string, string> }).headers).not.toHaveProperty(
expect(unauthenticatedResponse.statusCode).toBe(200);
expect((unauthenticatedResponse.body as { headers: Record<string, string> }).headers).not.toHaveProperty(
'authorization',
);
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const url = `${HTTP_SERVER}/graphql`;
const query =
"query Characters($filter: CharacterFilter) { characters(filter: $filter) { results { name status } } }";
@@ -36,8 +37,8 @@ test("Verify GraphQL Request With Object Variables", async ({ user }) => {
});
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
expect(responseView.preview).toMatchObject({
expect(responseView.statusCode).toBe(200);
expect(responseView.body).toMatchObject({
data: {
characters: {
results: [{ name: "Summer Smith", status: "Dead" }],
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -36,8 +37,8 @@ test("Verify Pre-Request Script Adds a Header to GraphQL Request", async ({
});
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
expect(responseView.preview).toMatchObject({
expect(responseView.statusCode).toBe(200);
expect(responseView.body).toMatchObject({
headers: expect.objectContaining({ "x-hello": headerValue }),
});
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const url = `${HTTP_SERVER}/graphql`;
const query = "{ characters { results { name } } }";
@@ -46,8 +47,8 @@ test("Verify GraphQL Schema Documentation Shows Field Descriptions", async ({
}),
]),
});
expect(responseView.statusBar.code).toBe(200);
expect(responseView.preview).toMatchObject({
expect(responseView.statusCode).toBe(200);
expect(responseView.body).toMatchObject({
data: {
characters: {
results: expect.arrayContaining([
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -37,8 +38,8 @@ test("Verify GraphQL Request Header With a Template Tag Is Resolved", async ({
});
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
expect(responseView.preview).toMatchObject({
expect(responseView.statusCode).toBe(200);
expect(responseView.body).toMatchObject({
headers: expect.objectContaining({ "x-header-name": "aGVhZGVyLXZhbHVl" }),
});
});
@@ -1,12 +1,13 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER_HTTPS, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER_HTTPS, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -32,8 +33,8 @@ test("Verify GraphQL Request Over a TLS Connection", async ({ user }) => {
});
const responseView = await graphqlRequestFlow.send(request);
expect(responseView.statusBar.code).toBe(200);
const sent = JSON.parse((responseView.preview as { data: string }).data) as {
expect(responseView.statusCode).toBe(200);
const sent = JSON.parse((responseView.body as { data: string }).data) as {
query: string;
};
expect(sent.query.replace(/\s+/g, " ").trim()).toBe(query);
@@ -1,13 +1,14 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { HttpMethod } from "@package/enums/http-method";
import { ProjectType } from "@package/enums/project-types";
import { HTTP_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { HttpMethod } from "../../enums/http-method";
import { ProjectType } from "../../enums/project-types";
import { HTTP_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { Project } from "../../models/project";
const query = "{ characters { results { name } } }";
const body = { mimeType: ContentType.JSON, text: JSON.stringify({ query }) };
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { Project } from "../../models/project";
test("Verify Environment Variable Interpolation Inside a gRPC Request Body", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Cancelling an In-Flight gRPC Server Streaming Call", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Cancelling an Open gRPC Client Streaming Call", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Committing a gRPC Client Streaming Call With No Messages Sent", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Custom gRPC Metadata Headers Are Sent to the Server", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Duplicating a gRPC Request With a Bidirectional Streaming Method Selected", async ({
user,
}) => {
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { Project } from "../../models/project";
test("Verify Create gRPC Request", async ({ user }) => {
const { environmentFlow, grpcRequestFlow, workspaceFlow } = user.flowManager;
const { workspacePage } = user.pageManager;
@@ -1,13 +1,14 @@
import path from "node:path";
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { certPath } from "@package/misc/certs";
import { GRPC_SERVER_MTLS, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { certPath } from "../../misc/certs";
import { GRPC_SERVER_MTLS, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Client Certificate Toggle Controls mTLS Enforcement For gRPC Request", async ({
user,
}) => {
@@ -16,7 +17,7 @@ test("Verify Client Certificate Toggle Controls mTLS Enforcement For gRPC Reques
await preferencesFlow.set({
validateSSL: false,
dataFolders: [path.join(import.meta.dirname, "../../misc/fixtures")],
dataFolders: [path.join(__dirname, "../../misc/fixtures")],
});
const project = await workspaceFlow.createProject(
@@ -4,12 +4,13 @@ import * as net from "node:net";
import type { Duplex } from "node:stream";
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const startRecordingProxy = async () => {
const targets: string[] = [];
const sockets = new Set<Duplex>();
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const unreachableGrpcUrl = "localhost:19999";
test("Verify gRPC Server Reflection Fails Against an Unreachable Server", async ({
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Re-sending a Completed gRPC Unary Request Reflects the New Body", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify a gRPC Server-Side Business Error Status Is Surfaced", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Switching gRPC Methods Resets the Response Pane", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Template Tag in gRPC Request Body Is Resolved", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { GRPC_SERVER_TLS, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { GRPC_SERVER_TLS, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify gRPC Request Over a TLS Connection", async ({ user }) => {
const { grpcRequestFlow, preferencesFlow, workspaceFlow } = user.flowManager;
@@ -1,10 +1,11 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from '@package/misc/fixtures';
import { McpClient } from '@package/models/mcp-client';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from '../../misc/fixtures';
import { McpClient } from '../../models/mcp-client';
import { Project } from '../../models/project';
test('Verify MCP Client Sends the API Key Header Only When Authentication Is Configured', async ({ user }) => {
const { mcpClientFlow, workspaceFlow } = user.flowManager;
const { responsePage } = user.pageManager;
@@ -1,10 +1,11 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from '@package/misc/fixtures';
import { McpClient } from '@package/models/mcp-client';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from '../../misc/fixtures';
import { McpClient } from '../../models/mcp-client';
import { Project } from '../../models/project';
test('Verify MCP Client Sends the Basic Authentication Header Only When Authentication Is Configured', async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "@package/misc/fixtures";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "../../misc/fixtures";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
test("Verify MCP Client Sends the Bearer Token Header Only When Authentication Is Configured", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "@package/misc/fixtures";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "../../misc/fixtures";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
test("Verify Disconnecting an MCP Client Closes the Connection and It Can Reconnect", async ({
user,
}) => {
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "@package/misc/fixtures";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "../../misc/fixtures";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
test("Verify Environment Variable in MCP Client URL Is Resolved", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "@package/misc/fixtures";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, MCP_SERVER, test } from "../../misc/fixtures";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
const mcpUrl = MCP_SERVER;
const tool = "read_wiki_structure";
const args = { repoName: "Kong/insomnia" };
@@ -1,10 +1,11 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, MCP_SERVER, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_SERVER, test } from '@package/misc/fixtures';
import { McpClient } from '@package/models/mcp-client';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, MCP_SERVER, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_SERVER, test } from '../../misc/fixtures';
import { McpClient } from '../../models/mcp-client';
import { Project } from '../../models/project';
test('Verify MCP Client Sends the OAuth 2.0 Header Only When Authentication Is Configured', async ({ user }) => {
const { mcpClientFlow, workspaceFlow } = user.flowManager;
const { responsePage } = user.pageManager;
@@ -4,12 +4,13 @@ import * as net from "node:net";
import type { Duplex } from "node:stream";
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { MCP_SERVER, test } from "@package/misc/fixtures";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { MCP_SERVER, test } from "../../misc/fixtures";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
const startRecordingProxy = async () => {
const targets: string[] = [];
const sockets = new Set<Duplex>();
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { certPath } from "@package/misc/certs";
import { MCP_SERVER_HTTPS, test } from "@package/misc/fixtures";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { certPath } from "../../misc/certs";
import { MCP_SERVER_HTTPS, test } from "../../misc/fixtures";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
test("Verify MCP Client Over a TLS Connection", async ({ user }) => {
const { certificatesFlow, mcpClientFlow, workspaceFlow } = user.flowManager;
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test } from "@package/misc/fixtures";
import { McpClient } from "@package/models/mcp-client";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test } from "../../misc/fixtures";
import { McpClient } from "../../models/mcp-client";
import { Project } from "../../models/project";
const unreachableUrl = "http://localhost:1/mcp";
test("Verify Connecting to an Unreachable MCP Server Lists No Tools", async ({
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Disconnecting a Socket.IO Request Before the Server Replies Delivers No Echo", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { SOCKET_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { SOCKET_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const message = { eventName: "hello", payload: '"world"' };
test("Verify Duplicated Socket.IO Request Keeps Url and Message", async ({
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import type { SocketIORequest } from "@package/models/socket-io-request";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
import type { SocketIORequest } from "../../models/socket-io-request";
const socketIoUrl = SOCKET_SERVER;
const message = { eventName: "hello", payload: '"world"' };
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Enabling an Unreachable Proxy Fails the Socket.IO Connection", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Template Tag in Socket.IO Message Payload Is Resolved", async ({
user,
}) => {
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { certPath } from "@package/misc/certs";
import { DEFAULT_TIMEOUT, SOCKET_SERVER_WSS, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { certPath } from "../../misc/certs";
import { DEFAULT_TIMEOUT, SOCKET_SERVER_WSS, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Socket.IO Request Over a TLS Connection", async ({ user }) => {
const { certificatesFlow, socketIoRequestFlow, workspaceFlow } =
user.flowManager;
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER_AUTH_TOKEN, SOCKET_SERVER_PROTECTED, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, SOCKET_SERVER_AUTH_TOKEN, SOCKET_SERVER_PROTECTED, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Socket.IO Handshake Is Accepted With the Token and Rejected Without It", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Connecting to an Unreachable Socket.IO Server Fails", async ({
user,
}) => {
@@ -1,10 +1,11 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, test, WS_SERVER } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, test, WS_SERVER } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { Project } from '../../models/project';
test('Verify WebSocket Connection Sends the API Key Header Until Authentication Is Set to None', async ({ user }) => {
const { webSocketRequestFlow, workspaceFlow } = user.flowManager;
@@ -22,7 +23,7 @@ test('Verify WebSocket Connection Sends the API Key Header Until Authentication
const authenticatedResponse = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`${apiKeyName}: ${apiKeyValue}`);
@@ -32,9 +33,9 @@ test('Verify WebSocket Connection Sends the API Key Header Until Authentication
const unauthenticatedResponse = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain('host:');
expect(await unauthenticatedResponse.console()).not.toContain(apiKeyName);
expect(await unauthenticatedResponse.console?.()).not.toContain(apiKeyName);
});
@@ -1,10 +1,11 @@
import { faker } from '@faker-js/faker';
import { ProjectType } from '@package/enums/project-types';
import { DEFAULT_TIMEOUT, test, WS_SERVER } from '@package/misc/fixtures';
import { Collection } from '@package/models/collection';
import { Project } from '@package/models/project';
import { expect } from "@playwright/test";
import { ProjectType } from '../../enums/project-types';
import { DEFAULT_TIMEOUT, test, WS_SERVER } from '../../misc/fixtures';
import { Collection } from '../../models/collection';
import { Project } from '../../models/project';
test('Verify WebSocket Connection Sends the Basic Authentication Header Until Authentication Is Set to None', async ({
user,
}) => {
@@ -24,7 +25,7 @@ test('Verify WebSocket Connection Sends the Basic Authentication Header Until Au
const authenticatedResponse = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`authorization: Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`);
@@ -34,9 +35,9 @@ test('Verify WebSocket Connection Sends the Basic Authentication Header Until Au
const unauthenticatedResponse = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain('host:');
expect(await unauthenticatedResponse.console()).not.toContain('authorization:');
expect(await unauthenticatedResponse.console?.()).not.toContain('authorization:');
});
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify WebSocket Connection Sends the Bearer Token Header Until Authentication Is Set to None", async ({
user,
}) => {
@@ -28,7 +29,7 @@ test("Verify WebSocket Connection Sends the Bearer Token Header Until Authentica
const authenticatedResponse = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => authenticatedResponse.console(), {
.poll(() => authenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain(`authorization: Bearer ${token}`);
@@ -39,11 +40,11 @@ test("Verify WebSocket Connection Sends the Bearer Token Header Until Authentica
await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => unauthenticatedResponse.console(), {
.poll(() => unauthenticatedResponse.console?.(), {
timeout: DEFAULT_TIMEOUT,
})
.toContain("host:");
expect(await unauthenticatedResponse.console()).not.toContain(
expect(await unauthenticatedResponse.console?.()).not.toContain(
"authorization:",
);
});
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Linked Cookie Is Sent With WebSocket Connection", async ({
user,
}) => {
@@ -33,6 +34,6 @@ test("Verify Linked Cookie Is Sent With WebSocket Connection", async ({
const responseView = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain(`cookie: ${cookieKey}=${cookieValue}`);
});
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Disconnecting a WebSocket Request Before the Server Replies Delivers No Echo", async ({
user,
}) => {
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { Project } from "../../models/project";
test("Verify Environment Variable in WebSocket Request URL Is Resolved", async ({
user,
}) => {
@@ -43,7 +44,7 @@ test("Verify Environment Variable in WebSocket Request URL Is Resolved", async (
const responseView = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain(`Preparing request to ${WS_SERVER}`);
await expect
.poll(
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const webSocketUrl = WS_SERVER;
test("Verify Create WebSocket Request", async ({ user }) => {
@@ -38,7 +39,7 @@ test("Verify Create WebSocket Request", async ({ user }) => {
]),
);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("101 Switching Protocols");
await expect
.poll(
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify Import from URL Moves Query String Into Params and Preserves It on Connect", async ({
user,
}) => {
@@ -42,10 +43,10 @@ test("Verify Import from URL Moves Query String Into Params and Preserves It on
]),
);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("101 Switching Protocols");
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain(
`Preparing request to ${baseUrl}?${paramName1}=${paramValue1}&${paramName2}=${paramValue2}`,
);
@@ -4,12 +4,13 @@ import * as net from "node:net";
import type { Duplex } from "node:stream";
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const startRecordingProxy = async () => {
const targets: string[] = [];
const sockets = new Set<Duplex>();
@@ -103,7 +104,7 @@ test("Verify WebSocket Requests Are Routed Through the Preferences Proxy", async
);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("101 Switching Protocols");
expect(proxy.targets).toContain(hostOf(WS_SERVER));
} finally {
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const webSocketUrl = WS_SERVER;
test("Send Multiple Messages of Different Body Types Over an Open WebSocket Connection", async ({
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ContentType } from "@package/enums/content-type";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ContentType } from "../../enums/content-type";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
const tag = "{% base64 'encode', 'normal', 'abc' %}";
test("Verify Template Tags in WebSocket Header and Message Are Resolved", async ({
@@ -34,7 +35,7 @@ test("Verify Template Tags in WebSocket Header and Message Are Resolved", async
const responseView = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("x-tag: YWJj");
await expect
.poll(
@@ -1,10 +1,11 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER_WSS } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { DEFAULT_TIMEOUT, test, WS_SERVER_WSS } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { Project } from "../../models/project";
test("Verify WebSocket Request Over a TLS Connection", async ({ user }) => {
const { preferencesFlow, webSocketRequestFlow, workspaceFlow } =
user.flowManager;
@@ -27,7 +28,7 @@ test("Verify WebSocket Request Over a TLS Connection", async ({ user }) => {
const responseView = await webSocketRequestFlow.disconnect(request);
await expect
.poll(() => responseView.console(), { timeout: DEFAULT_TIMEOUT })
.poll(() => responseView.console?.(), { timeout: DEFAULT_TIMEOUT })
.toContain("101 Switching Protocols");
await expect
.poll(
@@ -1,11 +1,12 @@
import { faker } from "@faker-js/faker";
import { ProjectType } from "@package/enums/project-types";
import { test, WS_SERVER } from "@package/misc/fixtures";
import { Collection } from "@package/models/collection";
import { EnvironmentKvPairDataType } from "@package/models/environment";
import { Project } from "@package/models/project";
import { expect } from "@playwright/test";
import { ProjectType } from "../../enums/project-types";
import { test, WS_SERVER } from "../../misc/fixtures";
import { Collection } from "../../models/collection";
import { EnvironmentKvPairDataType } from "../../models/environment";
import { Project } from "../../models/project";
const variableName = "unlinked";
test("Verify Unlinked Environment Variable Causes Error in WebSocket Request", async ({