@constructive-io/playwright-test 3.3.3 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,10 +16,10 @@ Constructive Playwright Testing with HTTP server support for end-to-end testing.
16
16
 
17
17
  This package extends `@constructive-io/graphql-test` to provide an actual HTTP server for Playwright and other E2E testing frameworks. It creates isolated test databases and starts a GraphQL server for your suite to hit over HTTP.
18
18
 
19
- It can run either server, selected per-suite with `server.scopedRouting`:
19
+ It can run either server, selected per-suite with `server.useRouting`:
20
20
 
21
- - `server.scopedRouting: false` (default) — the single-tenant `@constructive-io/graphql-dev-server` (pure PostGraphile). No host route resolution and no database id; the configured schemas are exposed directly. Best for UI/local suites.
22
- - `server.scopedRouting: true` — the production `@constructive-io/graphql-server`. Every request is resolved through the scoped-routing plane (`constructive_routing_public.resolve_route()`), so the suite must seed real routing/database records and reach the api surface via its seeded host (`Host` header).
21
+ - `server.useRouting: false` (default) — the single-tenant `@constructive-io/graphql-dev-server` (pure PostGraphile). No host route resolution and no database id; the configured schemas are exposed directly. Best for UI/local suites.
22
+ - `server.useRouting: true` — the production `@constructive-io/graphql-server`. Every request is resolved through the scoped-routing plane (`constructive_routing_public.resolve_route()`), so the suite must seed real routing/database records and reach the api surface via its seeded host (`Host` header).
23
23
 
24
24
  ## Installation
25
25
 
@@ -61,7 +61,7 @@ describe('E2E Tests', () => {
61
61
 
62
62
  ### Against the real (scoped-routing) server
63
63
 
64
- Set `server.scopedRouting: true` to run the production `@constructive-io/graphql-server`. Seed real routing/database records and address the api surface by its seeded host:
64
+ Set `server.useRouting: true` to run the production `@constructive-io/graphql-server`. Seed real routing/database records and address the api surface by its seeded host:
65
65
 
66
66
  ```typescript
67
67
  import { test, expect } from '@playwright/test';
@@ -73,9 +73,9 @@ test('resolves through the scoped routing plane', async ({ request }) => {
73
73
  schemas: ['simple-pets-public'],
74
74
  authRole: 'anonymous',
75
75
  server: {
76
- scopedRouting: true,
76
+ useRouting: true,
77
77
  api: {
78
- scopedRoutingSchema: 'constructive_routing_public',
78
+ routingSchema: 'constructive_routing_public',
79
79
  isPublic: true,
80
80
  metaSchemas: ['constructive_routing_public', 'metaschema_public']
81
81
  }
@@ -166,8 +166,8 @@ Creates database connections and starts an HTTP server for testing.
166
166
  - `input.authRole` - Default authentication role (e.g., 'anonymous', 'authenticated')
167
167
  - `input.server.port` - Port to run the server on (defaults to random available port)
168
168
  - `input.server.host` - Host to bind to (defaults to 'localhost')
169
- - `input.server.scopedRouting` - `false` (default) runs the dev server; `true` runs the production scoped-routing server
170
- - `input.server.api` - API options forwarded to the production scoped server (e.g. `metaSchemas`, `isPublic`); only used when `scopedRouting` is `true`
169
+ - `input.server.useRouting` - `false` (default) runs the dev server; `true` runs the production scoped-routing server
170
+ - `input.server.api` - API options forwarded to the production scoped server (e.g. `metaSchemas`, `isPublic`); only used when `useRouting` is `true`
171
171
  - `input.graphile` - Optional Graphile configuration overrides
172
172
  - `seedAdapters` - Optional array of seed adapters for database setup
173
173
 
@@ -197,19 +197,19 @@ Low-level function to create just the production `@constructive-io/graphql-serve
197
197
  ## How It Works
198
198
 
199
199
  1. Creates an isolated test database using `pgsql-test`
200
- 2. Starts either the dev server or the production scoped-routing server (see `server.scopedRouting`)
200
+ 2. Starts either the dev server or the production scoped-routing server (see `server.useRouting`)
201
201
  3. Exposes the GraphQL endpoint for your suite to hit over HTTP
202
202
  4. Returns the server URL for Playwright to connect to
203
203
  5. Provides a teardown function that stops the server and cleans up the database
204
204
 
205
205
  ## Configuration
206
206
 
207
- By default (`scopedRouting: false`) the server runs `@constructive-io/graphql-dev-server`, which means:
207
+ By default (`useRouting: false`) the server runs `@constructive-io/graphql-dev-server`, which means:
208
208
  - No host route resolution (`resolve_route()`) is required and no database id is needed
209
209
  - Schemas are exposed directly based on the `schemas` parameter
210
210
  - Perfect for isolated testing without complex domain setup
211
211
 
212
- With `scopedRouting: true` the server runs the production `@constructive-io/graphql-server`:
212
+ With `useRouting: true` the server runs the production `@constructive-io/graphql-server`:
213
213
  - Every request is resolved through `constructive_routing_public.resolve_route()`
214
214
  - The suite must seed real routing/database records and address the api surface by its seeded host
215
215
 
@@ -37,9 +37,9 @@ const createConnectionsWithServerBase = async (input, seedAdapters) => {
37
37
  });
38
38
  // Start the HTTP server. Suites default to the single-tenant dev server;
39
39
  // suites exercising the real routing plane opt into the production
40
- // scoped-routing server with `server.scopedRouting: true`.
41
- const scopedRouting = input.server?.scopedRouting ?? false;
42
- const server = scopedRouting
40
+ // scoped-routing server with `server.useRouting: true`.
41
+ const useRouting = input.server?.useRouting ?? false;
42
+ const server = useRouting
43
43
  ? await createScopedTestServer(serverOpts, input.server)
44
44
  : await createTestServer(serverOpts, input.server);
45
45
  // Combined teardown function
@@ -40,9 +40,9 @@ const createConnectionsWithServerBase = async (input, seedAdapters) => {
40
40
  });
41
41
  // Start the HTTP server. Suites default to the single-tenant dev server;
42
42
  // suites exercising the real routing plane opt into the production
43
- // scoped-routing server with `server.scopedRouting: true`.
44
- const scopedRouting = input.server?.scopedRouting ?? false;
45
- const server = scopedRouting
43
+ // scoped-routing server with `server.useRouting: true`.
44
+ const useRouting = input.server?.useRouting ?? false;
45
+ const server = useRouting
46
46
  ? await (0, server_1.createScopedTestServer)(serverOpts, input.server)
47
47
  : await (0, server_1.createTestServer)(serverOpts, input.server);
48
48
  // Combined teardown function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/playwright-test",
3
- "version": "3.3.3",
3
+ "version": "3.4.1",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive Playwright Testing with HTTP server support",
6
6
  "main": "index.js",
@@ -35,17 +35,17 @@
35
35
  "makage": "^0.3.0"
36
36
  },
37
37
  "dependencies": {
38
- "@constructive-io/graphql-dev-server": "^3.3.3",
39
- "@constructive-io/graphql-env": "^3.19.2",
40
- "@constructive-io/graphql-server": "^5.3.3",
41
- "@constructive-io/graphql-test": "^5.1.3",
42
- "@constructive-io/graphql-types": "^3.18.2",
38
+ "@constructive-io/graphql-dev-server": "^3.4.1",
39
+ "@constructive-io/graphql-env": "^3.20.0",
40
+ "@constructive-io/graphql-server": "^5.4.1",
41
+ "@constructive-io/graphql-test": "^5.2.1",
42
+ "@constructive-io/graphql-types": "^3.19.0",
43
43
  "@pgpmjs/types": "^2.37.2",
44
44
  "express": "^5.2.1",
45
- "graphile-test": "^5.1.2",
45
+ "graphile-test": "^5.2.1",
46
46
  "pg": "^8.21.0",
47
47
  "pg-cache": "^3.16.2",
48
- "pgsql-test": "^5.1.2"
48
+ "pgsql-test": "^5.1.3"
49
49
  },
50
50
  "keywords": [
51
51
  "testing",
@@ -56,5 +56,5 @@
56
56
  "e2e",
57
57
  "integration"
58
58
  ],
59
- "gitHead": "0e3ee42c44c9b35ffac4bf1faa6775eb69311ec4"
59
+ "gitHead": "cc1b2af2c73c23b99a221e6bd8a8ba76c7ce79e6"
60
60
  }
package/types.d.ts CHANGED
@@ -19,10 +19,10 @@ export interface PlaywrightServerOptions {
19
19
  * every request through the scoped-routing plane. Suites must seed real
20
20
  * routing/database records so `resolve_route()` returns a real database id.
21
21
  */
22
- scopedRouting?: boolean;
22
+ useRouting?: boolean;
23
23
  /**
24
24
  * API configuration forwarded to the production scoped server (e.g.
25
- * `metaSchemas`, `isPublic`). Only used when `scopedRouting` is `true`.
25
+ * `metaSchemas`, `isPublic`). Only used when `useRouting` is `true`.
26
26
  */
27
27
  api?: Partial<ApiOptions>;
28
28
  }