@iblai/mcp 1.0.0 → 1.1.3
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 +95 -142
- package/dist/index.js +129 -97
- package/dist/index.js.map +1 -1
- package/dist/prompts/create-playwright-test.d.ts +2 -0
- package/dist/prompts/create-playwright-test.d.ts.map +1 -0
- package/dist/prompts/create-playwright-test.js +99 -0
- package/dist/prompts/create-playwright-test.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +4 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/setup-e2e-testing.d.ts +2 -0
- package/dist/prompts/setup-e2e-testing.d.ts.map +1 -0
- package/dist/prompts/setup-e2e-testing.js +162 -0
- package/dist/prompts/setup-e2e-testing.js.map +1 -0
- package/dist/prompts/setup-new-app.d.ts +2 -0
- package/dist/prompts/setup-new-app.d.ts.map +1 -0
- package/dist/prompts/setup-new-app.js +226 -0
- package/dist/prompts/setup-new-app.js.map +1 -0
- package/dist/resources/data-layer.js +14 -14
- package/dist/resources/guides-layout.js +5 -5
- package/dist/resources/guides-playwright.d.ts +8 -0
- package/dist/resources/guides-playwright.d.ts.map +1 -0
- package/dist/resources/guides-playwright.js +235 -0
- package/dist/resources/guides-playwright.js.map +1 -0
- package/dist/resources/guides-rbac.js +2 -2
- package/dist/resources/guides-theme.js +4 -4
- package/dist/resources/index.d.ts +3 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +5 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/packages-overview.d.ts.map +1 -1
- package/dist/resources/packages-overview.js +12 -6
- package/dist/resources/packages-overview.js.map +1 -1
- package/dist/resources/packages-playwright.d.ts +8 -0
- package/dist/resources/packages-playwright.d.ts.map +1 -0
- package/dist/resources/packages-playwright.js +161 -0
- package/dist/resources/packages-playwright.js.map +1 -0
- package/dist/resources/web-containers.d.ts.map +1 -1
- package/dist/resources/web-containers.js +82 -22
- package/dist/resources/web-containers.js.map +1 -1
- package/dist/resources/web-utils.d.ts.map +1 -1
- package/dist/resources/web-utils.js +46 -9
- package/dist/resources/web-utils.js.map +1 -1
- package/dist/tools/api-query-info.d.ts.map +1 -1
- package/dist/tools/api-query-info.js +248 -238
- package/dist/tools/api-query-info.js.map +1 -1
- package/dist/tools/component-info.d.ts.map +1 -1
- package/dist/tools/component-info.js +945 -469
- package/dist/tools/component-info.js.map +1 -1
- package/dist/tools/hook-info.d.ts.map +1 -1
- package/dist/tools/hook-info.js +229 -98
- package/dist/tools/hook-info.js.map +1 -1
- package/dist/tools/index.d.ts +15 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/page-template.js +8 -8
- package/dist/tools/page-template.js.map +1 -1
- package/dist/tools/playwright-helper-info.d.ts +16 -0
- package/dist/tools/playwright-helper-info.d.ts.map +1 -0
- package/dist/tools/playwright-helper-info.js +849 -0
- package/dist/tools/playwright-helper-info.js.map +1 -0
- package/dist/tools/provider-setup.js +4 -4
- package/dist/tools/provider-setup.js.map +1 -1
- package/package.json +19 -6
|
@@ -62,7 +62,7 @@ export function StoreProvider({ children }) {
|
|
|
62
62
|
// providers/index.tsx
|
|
63
63
|
'use client';
|
|
64
64
|
|
|
65
|
-
import { AuthProvider, TenantProvider } from '@iblai/web-utils';
|
|
65
|
+
import { AuthProvider, TenantProvider } from '@iblai/iblai-js/web-utils';
|
|
66
66
|
import { getTenant, getUsername, redirectToAuthSpa } from '@/lib/utils';
|
|
67
67
|
|
|
68
68
|
export function Providers({ children }) {
|
|
@@ -94,7 +94,7 @@ export function Providers({ children }) {
|
|
|
94
94
|
'use client';
|
|
95
95
|
|
|
96
96
|
import { ThemeProvider } from 'next-themes';
|
|
97
|
-
import { Toaster } from '@iblai/web-containers';
|
|
97
|
+
import { Toaster } from '@iblai/iblai-js/web-containers';
|
|
98
98
|
|
|
99
99
|
export function ClientLayout({ children }) {
|
|
100
100
|
return (
|
|
@@ -139,7 +139,7 @@ export function AppLayout({ children }) {
|
|
|
139
139
|
### For Mentor App with Sidebar
|
|
140
140
|
|
|
141
141
|
\`\`\`typescript
|
|
142
|
-
import { SidebarProvider, SidebarInset } from '@iblai/web-containers';
|
|
142
|
+
import { SidebarProvider, SidebarInset } from '@iblai/iblai-js/web-containers';
|
|
143
143
|
|
|
144
144
|
<SidebarProvider>
|
|
145
145
|
<AppSidebar />
|
|
@@ -206,7 +206,7 @@ app/
|
|
|
206
206
|
|
|
207
207
|
\`\`\`typescript
|
|
208
208
|
// app/dashboard/loading.tsx
|
|
209
|
-
import { Skeleton } from '@iblai/web-containers';
|
|
209
|
+
import { Skeleton } from '@iblai/iblai-js/web-containers';
|
|
210
210
|
|
|
211
211
|
export default function Loading() {
|
|
212
212
|
return (
|
|
@@ -224,7 +224,7 @@ export default function Loading() {
|
|
|
224
224
|
// app/error.tsx
|
|
225
225
|
'use client';
|
|
226
226
|
|
|
227
|
-
import { ClientErrorPage } from '@iblai/web-containers/next';
|
|
227
|
+
import { ClientErrorPage } from '@iblai/iblai-js/web-containers/next';
|
|
228
228
|
|
|
229
229
|
export default function Error({ error, reset }) {
|
|
230
230
|
return <ClientErrorPage error={error} reset={reset} />;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guides-playwright.d.ts","sourceRoot":"","sources":["../../src/resources/guides-playwright.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;CA0O5B,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
export const guidesPlaywright = {
|
|
2
|
+
uri: 'ibl://guides/playwright',
|
|
3
|
+
name: 'Playwright E2E Testing Guide',
|
|
4
|
+
description: 'Step-by-step guide for setting up Playwright E2E tests in IBL.ai apps using @iblai/iblai-js/playwright',
|
|
5
|
+
mimeType: 'text/markdown',
|
|
6
|
+
content: `# Playwright E2E Testing Guide
|
|
7
|
+
|
|
8
|
+
## 1. Prerequisites
|
|
9
|
+
|
|
10
|
+
Install required dev dependencies:
|
|
11
|
+
|
|
12
|
+
\`\`\`bash
|
|
13
|
+
pnpm add -D @iblai/iblai-js @playwright/test @axe-core/playwright dotenv cross-env
|
|
14
|
+
\`\`\`
|
|
15
|
+
|
|
16
|
+
Install Playwright browsers:
|
|
17
|
+
|
|
18
|
+
\`\`\`bash
|
|
19
|
+
npx playwright install
|
|
20
|
+
\`\`\`
|
|
21
|
+
|
|
22
|
+
## 2. Directory Structure
|
|
23
|
+
|
|
24
|
+
\`\`\`
|
|
25
|
+
e2e/
|
|
26
|
+
├── playwright.config.ts # Uses createPlaywrightConfig()
|
|
27
|
+
├── auth.setup.ts # Uses createAuthSetup()
|
|
28
|
+
├── custom-reporter.ts # Re-exports CustomReporter from SDK
|
|
29
|
+
├── .env.development # Environment variables
|
|
30
|
+
├── tests/
|
|
31
|
+
│ ├── utils.ts # App-specific env var exports
|
|
32
|
+
│ ├── helpers.ts # App-specific auth/login helpers
|
|
33
|
+
│ ├── shared.ts # Shared test helpers (re-exports from SDK)
|
|
34
|
+
│ └── <feature>/ # Test spec files by feature
|
|
35
|
+
└── utils/ # App-specific helper modules
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
## 3. Playwright Config
|
|
39
|
+
|
|
40
|
+
Use \`createPlaywrightConfig()\` from the SDK to generate a full Playwright configuration:
|
|
41
|
+
|
|
42
|
+
\`\`\`typescript
|
|
43
|
+
// e2e/playwright.config.ts
|
|
44
|
+
import { createPlaywrightConfig } from '@iblai/iblai-js/playwright';
|
|
45
|
+
import dotenv from 'dotenv';
|
|
46
|
+
import path from 'path';
|
|
47
|
+
|
|
48
|
+
dotenv.config({ path: path.resolve(__dirname, '.env.development') });
|
|
49
|
+
|
|
50
|
+
export default createPlaywrightConfig({
|
|
51
|
+
platforms: [
|
|
52
|
+
{
|
|
53
|
+
name: 'mentornextjs',
|
|
54
|
+
dependencies: ['setup'],
|
|
55
|
+
otherTestMatch: ['**mentornextjs/*/*.spec.ts'],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
### What this generates
|
|
62
|
+
|
|
63
|
+
- **Auth setup projects** per browser: \`setup-chrome\`, \`setup-firefox\`, \`setup-safari\`, \`setup-edge\`. Each runs \`auth.setup.ts\` to authenticate and save storage state.
|
|
64
|
+
- **Test projects** for each platform x browser combination (e.g. \`mentornextjs-desktop-chrome\`, \`mentornextjs-desktop-firefox\`, etc.).
|
|
65
|
+
- **Default devices**: Desktop Chrome, Firefox, Safari, Edge.
|
|
66
|
+
- **CI settings** (auto-detected via \`process.env.CI\`): \`retries=3\`, \`workers=1\`, \`headless=true\`, \`trace=retain-on-failure\`.
|
|
67
|
+
- **Local settings**: \`retries=0\`, \`workers=undefined\` (Playwright default parallelism).
|
|
68
|
+
|
|
69
|
+
## 4. Auth Setup
|
|
70
|
+
|
|
71
|
+
Use \`createAuthSetup()\` to authenticate once per browser and persist storage state:
|
|
72
|
+
|
|
73
|
+
\`\`\`typescript
|
|
74
|
+
// e2e/auth.setup.ts
|
|
75
|
+
import { test as setup, createAuthSetup } from '@iblai/iblai-js/playwright';
|
|
76
|
+
|
|
77
|
+
setup(
|
|
78
|
+
'authenticate',
|
|
79
|
+
createAuthSetup({
|
|
80
|
+
hostUrl: process.env.MENTOR_NEXTJS_HOST || '',
|
|
81
|
+
authHost: process.env.AUTH_HOST || '',
|
|
82
|
+
appName: 'mentor',
|
|
83
|
+
postLoginUrlMatcher: (url) => url.href.includes('/platform/'),
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
\`\`\`
|
|
87
|
+
|
|
88
|
+
### How it works
|
|
89
|
+
|
|
90
|
+
- Authenticates once per browser and saves storage state to \`playwright/.auth/user-{browser}.json\`.
|
|
91
|
+
- Supports per-browser credentials via environment variables: \`PLAYWRIGHT_USERNAME_CHROME\`, \`PLAYWRIGHT_PASSWORD_CHROME\`, etc. Falls back to \`PLAYWRIGHT_USERNAME\` / \`PLAYWRIGHT_PASSWORD\`.
|
|
92
|
+
- The \`postLoginUrlMatcher\` function is used to wait until the app has fully loaded after login.
|
|
93
|
+
|
|
94
|
+
### Auth flow options
|
|
95
|
+
|
|
96
|
+
Set the \`AUTH_FLOW\` environment variable to control the authentication strategy:
|
|
97
|
+
|
|
98
|
+
| Flow | Description |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| \`username_password\` | **Default.** Standard email + password form login. |
|
|
101
|
+
| \`magic_link\` | Email-only login with Mailsac email verification. Requires \`MAILSAC_API_KEY\`. |
|
|
102
|
+
| \`sso\` | Platform SSO via an identity provider. Requires \`AUTH_IDP\`. |
|
|
103
|
+
| \`direct_sso\` | Client-specific SSO (e.g., Microsoft). Requires \`AUTH_IDP\`. |
|
|
104
|
+
|
|
105
|
+
## 5. Custom Reporter
|
|
106
|
+
|
|
107
|
+
Re-export the SDK's custom reporter so Playwright can resolve it locally:
|
|
108
|
+
|
|
109
|
+
\`\`\`typescript
|
|
110
|
+
// e2e/custom-reporter.ts
|
|
111
|
+
export { CustomReporter as default } from '@iblai/iblai-js/playwright';
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
The custom reporter provides structured JSON output suitable for CI pipelines and test result dashboards.
|
|
115
|
+
|
|
116
|
+
## 6. Environment Variables
|
|
117
|
+
|
|
118
|
+
Create an \`.env.development\` file in the \`e2e/\` directory:
|
|
119
|
+
|
|
120
|
+
\`\`\`
|
|
121
|
+
SKILLS_HOST=https://skills.example.com
|
|
122
|
+
MENTOR_NEXTJS_HOST=https://mentor.example.com
|
|
123
|
+
AUTH_HOST=https://auth.example.com
|
|
124
|
+
PLAYWRIGHT_USERNAME=test@example.com
|
|
125
|
+
PLAYWRIGHT_PASSWORD=testpassword
|
|
126
|
+
AUTH_FLOW=username_password
|
|
127
|
+
AUTH_IDP=
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
### Full environment variable reference
|
|
131
|
+
|
|
132
|
+
| Variable | Description | Required |
|
|
133
|
+
|----------|-------------|----------|
|
|
134
|
+
| \`SKILLS_HOST\` | Base URL for the Skills app | Per app |
|
|
135
|
+
| \`MENTOR_NEXTJS_HOST\` | Base URL for the Mentor app | Per app |
|
|
136
|
+
| \`AUTH_HOST\` | Base URL for the Auth app | Yes |
|
|
137
|
+
| \`PLAYWRIGHT_USERNAME\` | Default test user email | Yes |
|
|
138
|
+
| \`PLAYWRIGHT_PASSWORD\` | Default test user password | Yes |
|
|
139
|
+
| \`PLAYWRIGHT_USERNAME_CHROME\` | Per-browser username override | No |
|
|
140
|
+
| \`PLAYWRIGHT_PASSWORD_CHROME\` | Per-browser password override | No |
|
|
141
|
+
| \`PLAYWRIGHT_USERNAME_FIREFOX\` | Per-browser username override | No |
|
|
142
|
+
| \`PLAYWRIGHT_PASSWORD_FIREFOX\` | Per-browser password override | No |
|
|
143
|
+
| \`PLAYWRIGHT_USERNAME_SAFARI\` | Per-browser username override | No |
|
|
144
|
+
| \`PLAYWRIGHT_PASSWORD_SAFARI\` | Per-browser password override | No |
|
|
145
|
+
| \`PLAYWRIGHT_USERNAME_EDGE\` | Per-browser username override | No |
|
|
146
|
+
| \`PLAYWRIGHT_PASSWORD_EDGE\` | Per-browser password override | No |
|
|
147
|
+
| \`AUTH_FLOW\` | Auth strategy: \`username_password\`, \`magic_link\`, \`sso\`, \`direct_sso\` | No (defaults to \`username_password\`) |
|
|
148
|
+
| \`AUTH_IDP\` | Identity provider name for SSO flows | Only for SSO flows |
|
|
149
|
+
| \`MAILSAC_API_KEY\` | Mailsac API key for magic link flow | Only for \`magic_link\` |
|
|
150
|
+
|
|
151
|
+
## 7. Writing a Test
|
|
152
|
+
|
|
153
|
+
\`\`\`typescript
|
|
154
|
+
import { test, expect } from '@playwright/test';
|
|
155
|
+
import { logger, safeWaitForURL } from '@iblai/iblai-js/playwright';
|
|
156
|
+
import { waitForPageReady, reliableClick } from '@iblai/iblai-js/playwright';
|
|
157
|
+
import { MENTOR_NEXTJS_HOST } from '../utils';
|
|
158
|
+
|
|
159
|
+
test.describe('Feature Name', () => {
|
|
160
|
+
test.beforeEach(async ({ page }) => {
|
|
161
|
+
await page.goto(MENTOR_NEXTJS_HOST);
|
|
162
|
+
await waitForPageReady(page);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('should do something', async ({ page }) => {
|
|
166
|
+
await reliableClick(page, page.getByRole('button', { name: 'Submit' }));
|
|
167
|
+
await safeWaitForURL(page, (url) => url.pathname.includes('/success'));
|
|
168
|
+
await expect(page.getByText('Success')).toBeVisible();
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
\`\`\`
|
|
172
|
+
|
|
173
|
+
### Key patterns
|
|
174
|
+
|
|
175
|
+
- **Import \`test\` and \`expect\` from \`@playwright/test\` directly** — do not re-import from the SDK.
|
|
176
|
+
- **Import utilities from \`@iblai/iblai-js/playwright\`** — this includes \`waitForPageReady\`, \`reliableClick\`, \`reliableFill\`, \`safeWaitForURL\`, \`logger\`, and more.
|
|
177
|
+
- **Use \`waitForPageReady(page)\` after navigation** — waits for network idle and DOM stability.
|
|
178
|
+
- **Use \`reliableClick(page, locator)\` and \`reliableFill(page, locator, value)\`** — these retry interactions and handle flaky element states (detached, covered, etc.).
|
|
179
|
+
- **Use \`safeWaitForURL(page, matcher)\` instead of \`page.waitForURL()\`** — handles browser-specific URL timing quirks.
|
|
180
|
+
- **Use \`logger\` for structured logging** — integrates with the custom reporter for better debugging output.
|
|
181
|
+
|
|
182
|
+
## 8. Running Tests
|
|
183
|
+
|
|
184
|
+
\`\`\`bash
|
|
185
|
+
# Run all tests
|
|
186
|
+
pnpm test:e2e
|
|
187
|
+
|
|
188
|
+
# UI mode
|
|
189
|
+
pnpm test:e2e:ui
|
|
190
|
+
|
|
191
|
+
# Headed mode
|
|
192
|
+
pnpm test:e2e:headed
|
|
193
|
+
|
|
194
|
+
# Specific test file
|
|
195
|
+
npx playwright test --config e2e/playwright.config.ts e2e/tests/feature/test.spec.ts
|
|
196
|
+
|
|
197
|
+
# Specific browser
|
|
198
|
+
npx playwright test --config e2e/playwright.config.ts --project='mentornextjs-desktop-chrome'
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
### package.json scripts
|
|
202
|
+
|
|
203
|
+
Add these scripts to your app's \`package.json\`:
|
|
204
|
+
|
|
205
|
+
\`\`\`json
|
|
206
|
+
{
|
|
207
|
+
"scripts": {
|
|
208
|
+
"test:e2e": "cross-env CI=true npx playwright test --config e2e/playwright.config.ts",
|
|
209
|
+
"test:e2e:ui": "npx playwright test --config e2e/playwright.config.ts --ui",
|
|
210
|
+
"test:e2e:headed": "npx playwright test --config e2e/playwright.config.ts --headed"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
\`\`\`
|
|
214
|
+
|
|
215
|
+
## 9. Accessibility Testing
|
|
216
|
+
|
|
217
|
+
Use the \`expectNoAccessibilityViolations\` helper (powered by axe-core) to check for WCAG violations:
|
|
218
|
+
|
|
219
|
+
\`\`\`typescript
|
|
220
|
+
import { test, expect } from '@playwright/test';
|
|
221
|
+
import { expectNoAccessibilityViolations } from '@iblai/iblai-js/playwright';
|
|
222
|
+
import { waitForPageReady } from '@iblai/iblai-js/playwright';
|
|
223
|
+
import { MENTOR_NEXTJS_HOST } from '../utils';
|
|
224
|
+
|
|
225
|
+
test('page should be accessible', async ({ page }) => {
|
|
226
|
+
await page.goto(MENTOR_NEXTJS_HOST);
|
|
227
|
+
await waitForPageReady(page);
|
|
228
|
+
await expectNoAccessibilityViolations(page);
|
|
229
|
+
});
|
|
230
|
+
\`\`\`
|
|
231
|
+
|
|
232
|
+
This runs an axe-core accessibility scan against the current page and fails the test if any violations are found. It checks WCAG 2.1 AA compliance by default.
|
|
233
|
+
`,
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=guides-playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guides-playwright.js","sourceRoot":"","sources":["../../src/resources/guides-playwright.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,yBAAyB;IAC9B,IAAI,EAAE,8BAA8B;IACpC,WAAW,EACT,wGAAwG;IAC1G,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmOV;CACA,CAAC"}
|
|
@@ -58,7 +58,7 @@ export default rbacSlice.reducer;
|
|
|
58
58
|
|
|
59
59
|
\`\`\`typescript
|
|
60
60
|
// hoc/withPermissions.tsx
|
|
61
|
-
import { WithPermissions as BaseWithPermissions, checkRbacPermission } from '@iblai/web-utils';
|
|
61
|
+
import { WithPermissions as BaseWithPermissions, checkRbacPermission } from '@iblai/iblai-js/web-utils';
|
|
62
62
|
import { useAppSelector } from '@/lib/hooks';
|
|
63
63
|
import { selectRbacPermissions } from '@/features/rbac';
|
|
64
64
|
import { config } from '@/lib/config';
|
|
@@ -132,7 +132,7 @@ function NavBar() {
|
|
|
132
132
|
### Programmatic Permission Check
|
|
133
133
|
|
|
134
134
|
\`\`\`typescript
|
|
135
|
-
import { checkRbacPermission } from '@iblai/web-utils';
|
|
135
|
+
import { checkRbacPermission } from '@iblai/iblai-js/web-utils';
|
|
136
136
|
import { useAppSelector } from '@/lib/hooks';
|
|
137
137
|
import { selectRbacPermissions } from '@/features/rbac';
|
|
138
138
|
|
|
@@ -11,7 +11,7 @@ Import the base theme in your app:
|
|
|
11
11
|
|
|
12
12
|
\`\`\`typescript
|
|
13
13
|
// In your root layout or global CSS
|
|
14
|
-
import '@iblai/web-containers/styles/base.css';
|
|
14
|
+
import '@iblai/iblai-js/web-containers/styles/base.css';
|
|
15
15
|
\`\`\`
|
|
16
16
|
|
|
17
17
|
## Theme Variables
|
|
@@ -95,7 +95,7 @@ export function ClientLayout({ children }) {
|
|
|
95
95
|
\`\`\`typescript
|
|
96
96
|
import { useTheme } from 'next-themes';
|
|
97
97
|
import { Sun, Moon } from 'lucide-react';
|
|
98
|
-
import { Button } from '@iblai/web-containers';
|
|
98
|
+
import { Button } from '@iblai/iblai-js/web-containers';
|
|
99
99
|
|
|
100
100
|
export function ThemeToggle() {
|
|
101
101
|
const { theme, setTheme } = useTheme();
|
|
@@ -134,7 +134,7 @@ useEffect(() => {
|
|
|
134
134
|
## Button Variants
|
|
135
135
|
|
|
136
136
|
\`\`\`typescript
|
|
137
|
-
import { Button } from '@iblai/web-containers';
|
|
137
|
+
import { Button } from '@iblai/iblai-js/web-containers';
|
|
138
138
|
|
|
139
139
|
// Available variants
|
|
140
140
|
<Button variant="default">Primary</Button>
|
|
@@ -154,7 +154,7 @@ import { Button } from '@iblai/web-containers';
|
|
|
154
154
|
## Class Merging Utility
|
|
155
155
|
|
|
156
156
|
\`\`\`typescript
|
|
157
|
-
import { cn } from '@iblai/web-containers';
|
|
157
|
+
import { cn } from '@iblai/iblai-js/web-containers';
|
|
158
158
|
|
|
159
159
|
// Merge classes with conflict resolution
|
|
160
160
|
<div className={cn(
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { packagesOverview } from './packages-overview.js';
|
|
2
|
+
import { packagesPlaywright } from './packages-playwright.js';
|
|
2
3
|
import { webContainers } from './web-containers.js';
|
|
3
4
|
import { webUtils } from './web-utils.js';
|
|
4
5
|
import { dataLayer } from './data-layer.js';
|
|
5
6
|
import { guidesLayout } from './guides-layout.js';
|
|
6
7
|
import { guidesRbac } from './guides-rbac.js';
|
|
7
8
|
import { guidesTheme } from './guides-theme.js';
|
|
9
|
+
import { guidesPlaywright } from './guides-playwright.js';
|
|
8
10
|
export interface Resource {
|
|
9
11
|
uri: string;
|
|
10
12
|
name: string;
|
|
@@ -13,5 +15,5 @@ export interface Resource {
|
|
|
13
15
|
content: string;
|
|
14
16
|
}
|
|
15
17
|
export declare const RESOURCES: Record<string, Resource>;
|
|
16
|
-
export { packagesOverview, webContainers, webUtils, dataLayer, guidesLayout, guidesRbac, guidesTheme, };
|
|
18
|
+
export { packagesOverview, packagesPlaywright, webContainers, webUtils, dataLayer, guidesLayout, guidesRbac, guidesTheme, guidesPlaywright, };
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAU9C,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,GACjB,CAAC"}
|
package/dist/resources/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { packagesOverview } from './packages-overview.js';
|
|
2
|
+
import { packagesPlaywright } from './packages-playwright.js';
|
|
2
3
|
import { webContainers } from './web-containers.js';
|
|
3
4
|
import { webUtils } from './web-utils.js';
|
|
4
5
|
import { dataLayer } from './data-layer.js';
|
|
5
6
|
import { guidesLayout } from './guides-layout.js';
|
|
6
7
|
import { guidesRbac } from './guides-rbac.js';
|
|
7
8
|
import { guidesTheme } from './guides-theme.js';
|
|
9
|
+
import { guidesPlaywright } from './guides-playwright.js';
|
|
8
10
|
export const RESOURCES = {
|
|
9
11
|
[packagesOverview.uri]: packagesOverview,
|
|
12
|
+
[packagesPlaywright.uri]: packagesPlaywright,
|
|
10
13
|
[webContainers.uri]: webContainers,
|
|
11
14
|
[webUtils.uri]: webUtils,
|
|
12
15
|
[dataLayer.uri]: dataLayer,
|
|
13
16
|
[guidesLayout.uri]: guidesLayout,
|
|
14
17
|
[guidesRbac.uri]: guidesRbac,
|
|
15
18
|
[guidesTheme.uri]: guidesTheme,
|
|
19
|
+
[guidesPlaywright.uri]: guidesPlaywright,
|
|
16
20
|
};
|
|
17
|
-
export { packagesOverview, webContainers, webUtils, dataLayer, guidesLayout, guidesRbac, guidesTheme, };
|
|
21
|
+
export { packagesOverview, packagesPlaywright, webContainers, webUtils, dataLayer, guidesLayout, guidesRbac, guidesTheme, guidesPlaywright, };
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU1D,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,gBAAgB;IACxC,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,kBAAkB;IAC5C,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,aAAa;IAClC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ;IACxB,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS;IAC1B,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,YAAY;IAChC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,UAAU;IAC5B,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,WAAW;IAC9B,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,gBAAgB;CACzC,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,GACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages-overview.d.ts","sourceRoot":"","sources":["../../src/resources/packages-overview.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;
|
|
1
|
+
{"version":3,"file":"packages-overview.d.ts","sourceRoot":"","sources":["../../src/resources/packages-overview.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;CAyD5B,CAAC"}
|
|
@@ -19,25 +19,31 @@ ibl-frontend/
|
|
|
19
19
|
│ ├── data-layer/ # Redux store, RTK Query APIs
|
|
20
20
|
│ ├── web-containers/ # Shared React components (Radix UI)
|
|
21
21
|
│ ├── web-utils/ # Authentication, providers, hooks
|
|
22
|
+
│ ├── iblai-js/ # Unified SDK wrapper (@iblai/iblai-js)
|
|
23
|
+
│ │ └── src/playwright/ # Shared E2E test utilities subpath
|
|
22
24
|
│ ├── api-ai/ # Generated AI API client
|
|
23
25
|
│ ├── api-core/ # Generated Core API client
|
|
24
26
|
│ └── api-ai-plus/ # Generated AI Plus API client
|
|
25
|
-
└── playwright/ # E2E test suite
|
|
27
|
+
└── playwright/ # E2E test suite (legacy, migrating to per-app repos)
|
|
26
28
|
\`\`\`
|
|
27
29
|
|
|
28
30
|
## Package Import Patterns
|
|
29
31
|
|
|
30
32
|
\`\`\`typescript
|
|
31
33
|
// Data Layer - Redux and RTK Query
|
|
32
|
-
import { useGetMentorSettingsQuery, mentorReducer } from '@iblai/data-layer';
|
|
34
|
+
import { useGetMentorSettingsQuery, mentorReducer } from '@iblai/iblai-js/data-layer';
|
|
33
35
|
|
|
34
36
|
// Web Containers - UI Components
|
|
35
|
-
import { Button, Card, Dialog } from '@iblai/web-containers';
|
|
36
|
-
import { Profile, NotificationDropdown } from '@iblai/web-containers';
|
|
37
|
+
import { Button, Card, Dialog } from '@iblai/iblai-js/web-containers';
|
|
38
|
+
import { Profile, NotificationDropdown } from '@iblai/iblai-js/web-containers';
|
|
37
39
|
|
|
38
40
|
// Web Utils - Providers and Hooks
|
|
39
|
-
import { AuthProvider, TenantProvider, MentorProvider } from '@iblai/web-utils';
|
|
40
|
-
import { useAdvancedChat, useMentorSettings } from '@iblai/web-utils';
|
|
41
|
+
import { AuthProvider, TenantProvider, MentorProvider } from '@iblai/iblai-js/web-utils';
|
|
42
|
+
import { useAdvancedChat, useMentorSettings } from '@iblai/iblai-js/web-utils';
|
|
43
|
+
|
|
44
|
+
// iblai-js SDK - Playwright E2E test utilities
|
|
45
|
+
import { createPlaywrightConfig, createAuthSetup } from '@iblai/iblai-js/playwright';
|
|
46
|
+
import { reliableClick, safeWaitForURL, waitForPageReady } from '@iblai/iblai-js/playwright';
|
|
41
47
|
\`\`\`
|
|
42
48
|
|
|
43
49
|
## Key Technologies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages-overview.js","sourceRoot":"","sources":["../../src/resources/packages-overview.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,yBAAyB;IAC9B,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"packages-overview.js","sourceRoot":"","sources":["../../src/resources/packages-overview.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE,yBAAyB;IAC9B,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDV;CACA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages-playwright.d.ts","sourceRoot":"","sources":["../../src/resources/packages-playwright.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;CAgK9B,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
export const packagesPlaywright = {
|
|
2
|
+
uri: 'ibl://packages/playwright',
|
|
3
|
+
name: 'IBL Playwright Test Utilities',
|
|
4
|
+
description: 'Complete reference for @iblai/iblai-js/playwright — shared E2E test utilities for IBL.ai apps',
|
|
5
|
+
mimeType: 'text/markdown',
|
|
6
|
+
content: `# @iblai/iblai-js/playwright
|
|
7
|
+
|
|
8
|
+
Shared E2E test utilities for IBL.ai applications. This is an original subpath export from the \`@iblai/iblai-js\` SDK (not a re-export). It is used by the **mentorai** and **skillsai** E2E test suites to provide consistent authentication flows, page interaction helpers, accessibility auditing, config generation, and more.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
\`\`\`bash
|
|
13
|
+
pnpm add -D @playwright/test @axe-core/playwright dotenv cross-env
|
|
14
|
+
\`\`\`
|
|
15
|
+
|
|
16
|
+
> \`@iblai/iblai-js\` must also be installed. \`winston\`, \`axios\`, and \`dotenv\` are transitive dependencies.
|
|
17
|
+
|
|
18
|
+
## Export Reference
|
|
19
|
+
|
|
20
|
+
### Core Test Fixtures
|
|
21
|
+
|
|
22
|
+
| Export | Type | Description |
|
|
23
|
+
|--------|------|-------------|
|
|
24
|
+
| \`test\` | TestType | Extended Playwright test with \`step\` fixture |
|
|
25
|
+
| \`expect\` | ExpectType | Re-exported from \`@playwright/test\` |
|
|
26
|
+
| \`StepFn\` | Type | \`(title: string, fn: () => unknown) => unknown\` |
|
|
27
|
+
|
|
28
|
+
### Navigation
|
|
29
|
+
|
|
30
|
+
| Export | Type | Description |
|
|
31
|
+
|--------|------|-------------|
|
|
32
|
+
| \`safeWaitForURL\` | Function | \`(page, urlMatcher, options?) => Promise<void>\` — Browser-safe URL waiting that handles Firefox \`NS_BINDING_ABORTED\` and Safari navigation policy errors |
|
|
33
|
+
| \`waitForPageLoad\` | Function | \`(page) => Promise<void>\` — Waits for \`load\`, \`domcontentloaded\`, \`networkidle\`, and dismisses any dialogs |
|
|
34
|
+
| \`isFirefox\` | Function | \`(page) => boolean\` — Check if browser is Firefox |
|
|
35
|
+
| \`SafeWaitForURLOptions\` | Type | \`{ timeout?, waitUntil?, maxRetries? }\` |
|
|
36
|
+
|
|
37
|
+
### Utility Functions
|
|
38
|
+
|
|
39
|
+
| Export | Type | Description |
|
|
40
|
+
|--------|------|-------------|
|
|
41
|
+
| \`closeWithEsc\` | Function | \`(page) => Promise<void>\` — Press Escape to close modals |
|
|
42
|
+
| \`retry\` | Function | \`(action, errorMessage, retryCount?) => Promise<void>\` — Retry with count |
|
|
43
|
+
| \`isJSON\` | Function | \`(value: string) => boolean\` — Check if string is valid JSON |
|
|
44
|
+
|
|
45
|
+
### Page Interaction Helpers
|
|
46
|
+
|
|
47
|
+
| Export | Type | Description |
|
|
48
|
+
|--------|------|-------------|
|
|
49
|
+
| \`waitForPageReady\` | Function | \`(page, timeout?) => Promise<void>\` — Wait for \`readyState\` complete |
|
|
50
|
+
| \`checkAdminStatus\` | Function | \`(page) => Promise<boolean>\` — Check admin from localStorage |
|
|
51
|
+
| \`waitForElementStable\` | Function | \`(page, locator, timeout?) => Promise<void>\` — Wait for element attached, visible, not animating |
|
|
52
|
+
| \`reliableClick\` | Function | \`(page, locator, timeout?, maxRetries?) => Promise<void>\` — Click with retry |
|
|
53
|
+
| \`reliableFill\` | Function | \`(page, locator, value, timeout?, maxRetries?) => Promise<void>\` — Fill with retry and verification |
|
|
54
|
+
| \`waitForDialogReady\` | Function | \`(page, dialogLocator, timeout?) => Promise<void>\` — Wait for dialog visible and loaded |
|
|
55
|
+
| \`selectDateFromCalendar\` | Function | \`(page, dialogLocator, targetDate, timeout?) => Promise<void>\` — Calendar date picker |
|
|
56
|
+
|
|
57
|
+
### Accessibility
|
|
58
|
+
|
|
59
|
+
| Export | Type | Description |
|
|
60
|
+
|--------|------|-------------|
|
|
61
|
+
| \`expectNoAccessibilityViolations\` | Function | \`(page) => Promise<void>\` — Run axe-core on full page |
|
|
62
|
+
| \`expectNoAccessibilityViolationsOnDialogs\` | Function | \`(page, rules?, exclude?) => Promise<void>\` — Run axe-core on dialog elements |
|
|
63
|
+
|
|
64
|
+
### Auth Helpers
|
|
65
|
+
|
|
66
|
+
| Export | Type | Description |
|
|
67
|
+
|--------|------|-------------|
|
|
68
|
+
| \`AuthFlowBuilder\` | Class | Constructor: \`(flow, idp, authHost)\`. Method: \`run(page, step, username, password, hostUrl, authUrl, postLoginUrlMatcher?)\`. Supports \`username_password\`, \`magic_link\`, \`sso\`, \`direct_sso\` flows |
|
|
69
|
+
| \`createAuthSetup\` | Function | \`(config: AuthSetupConfig) => SetupFn\` — Factory for Playwright auth setup tests |
|
|
70
|
+
| \`AuthSetupConfig\` | Type | \`{ hostUrl, authHost, appName, postLoginUrlMatcher, authFlow?, authIdp? }\` |
|
|
71
|
+
| \`loginWithEmailAndPassword\` | Function | \`(page, username, password, hostUrl, postLoginUrlMatcher?) => Promise<void>\` |
|
|
72
|
+
| \`signUpWithEmailAndPassword\` | Function | \`(page, authHost, postSignUpUrl, credentials?, alreadyInSignupPage?) => Promise<void>\` |
|
|
73
|
+
| \`SignUpCredentials\` | Type | \`{ email: string, password: string }\` |
|
|
74
|
+
| \`loginWithMicrosoftIdp\` | Function | \`(page, username, password) => Promise<void>\` |
|
|
75
|
+
| \`canChatWithEmbedMentor\` | Function | \`(page, openChatButton) => Promise<void>\` — Test chat with embedded mentor widget |
|
|
76
|
+
| \`getMentorIdFromUrl\` | Function | \`(url: string) => string\` — Extract mentor ID from URL |
|
|
77
|
+
|
|
78
|
+
### Config Generation
|
|
79
|
+
|
|
80
|
+
| Export | Type | Description |
|
|
81
|
+
|--------|------|-------------|
|
|
82
|
+
| \`createPlaywrightConfig\` | Function | \`(options: CreatePlaywrightConfigOptions) => PlaywrightTestConfig\` — Complete config with per-browser auth setup |
|
|
83
|
+
| \`CreatePlaywrightConfigOptions\` | Type | \`{ testDir?, devices?, platforms, customReporterPath?, extraProjects? }\` |
|
|
84
|
+
| \`PlatformConfig\` | Type | \`{ name, devices?, dependencies?, otherTestMatch?, testIgnore? }\` |
|
|
85
|
+
| \`generateProjectConfig\` | Function | Generate per-browser project config |
|
|
86
|
+
| \`generateBrowserSetupProjects\` | Function | Generate auth setup projects per browser |
|
|
87
|
+
| \`getBrowserKey\` | Function | \`(deviceName) => string\` — e.g., \`'Desktop Chrome'\` → \`'chrome'\` |
|
|
88
|
+
|
|
89
|
+
### Environment Configuration
|
|
90
|
+
|
|
91
|
+
| Export | Type | Description |
|
|
92
|
+
|--------|------|-------------|
|
|
93
|
+
| \`createEnvConfig\` | Function | \`(overrides?) => EnvConfig\` — Typed env var reader from \`process.env\` |
|
|
94
|
+
| \`EnvConfig\` | Type | Interface with: \`skillHost\`, \`authHost\`, \`analyticsHost\`, \`mentorHost\`, \`mentorNextjsHost\`, \`authNextjsHost\`, \`playwrightUsername\`, \`playwrightPassword\`, \`inviteUsername\`, \`inviteUserPassword\`, \`authFlow\`, \`authIdp\`, \`enableStripeTest\`, \`iblMentorDisabledTabs\`, \`embedUrl\`, \`wcagRange\` |
|
|
95
|
+
| \`AuthFlowType\` | Type | \`'username_password' \\| 'magic_link' \\| 'sso' \\| 'direct_sso'\` |
|
|
96
|
+
|
|
97
|
+
### Report Download
|
|
98
|
+
|
|
99
|
+
| Export | Type | Description |
|
|
100
|
+
|--------|------|-------------|
|
|
101
|
+
| \`buildReportUrl\` | Function | \`(baseUrl, platformKey, reportName) => string\` |
|
|
102
|
+
| \`parseReportUrlParams\` | Function | \`(url) => { platformKey, reportName }\` |
|
|
103
|
+
| \`navigateToReportDownload\` | Function | \`(page, options) => Promise<void>\` |
|
|
104
|
+
| \`verifyPreparingPhase\` | Function | \`(page, options?) => Promise<void>\` |
|
|
105
|
+
| \`verifyDownloadingPhase\` | Function | \`(page, options?) => Promise<void>\` |
|
|
106
|
+
| \`verifyDonePhase\` | Function | \`(page, options?) => Promise<void>\` |
|
|
107
|
+
| \`verifyErrorPhase\` | Function | \`(page, options?) => Promise<void>\` |
|
|
108
|
+
| \`clickBackHome\` | Function | \`(page) => Promise<void>\` |
|
|
109
|
+
| \`clickDownloadAgain\` | Function | \`(page) => Promise<void>\` |
|
|
110
|
+
| \`clickManualDownloadLink\` | Function | \`(page) => Promise<void>\` |
|
|
111
|
+
| \`waitForReportDownload\` | Function | \`(page, options) => Promise<void>\` — Full flow |
|
|
112
|
+
| \`ReportDownloadOptions\` | Type | \`{ baseUrl, platformKey, reportName, timeout? }\` |
|
|
113
|
+
|
|
114
|
+
### Shared Test Helpers
|
|
115
|
+
|
|
116
|
+
| Export | Type | Description |
|
|
117
|
+
|--------|------|-------------|
|
|
118
|
+
| \`inviteUserTest\` | Function | \`(page, inviteModal) => Promise<void>\` |
|
|
119
|
+
| \`navigateToAccountComponent\` | Function | \`(page, profileBtn) => Promise<void>\` |
|
|
120
|
+
| \`navigateToDataReports\` | Function | \`(page) => Promise<void>\` |
|
|
121
|
+
| \`shouldDisplayReportCards\` | Function | \`(page, REPORT_CARDS[]) => Promise<void>\` |
|
|
122
|
+
| And 13 more CSV editor and combined report helpers | | |
|
|
123
|
+
|
|
124
|
+
### Infrastructure
|
|
125
|
+
|
|
126
|
+
| Export | Type | Description |
|
|
127
|
+
|--------|------|-------------|
|
|
128
|
+
| \`logger\` | Object | Winston logger instance — info level locally, silent in CI |
|
|
129
|
+
| \`MailsacClient\` | Class | Email testing client. Constructor: \`(apiKey)\`. Methods: \`getEmails(inbox)\`, \`getEmailById(email, messageId)\`, \`deleteEmail(emailId)\` |
|
|
130
|
+
| \`CustomReporter\` | Class | Playwright custom reporter with \`onBegin\`, \`onTestBegin\`, \`onTestEnd\`, \`onEnd\` |
|
|
131
|
+
|
|
132
|
+
## Import Patterns
|
|
133
|
+
|
|
134
|
+
\`\`\`typescript
|
|
135
|
+
// SDK utilities
|
|
136
|
+
import {
|
|
137
|
+
logger,
|
|
138
|
+
safeWaitForURL,
|
|
139
|
+
waitForPageReady,
|
|
140
|
+
createAuthSetup,
|
|
141
|
+
} from '@iblai/iblai-js/playwright';
|
|
142
|
+
|
|
143
|
+
// Playwright core (use directly, not from SDK)
|
|
144
|
+
import {
|
|
145
|
+
test,
|
|
146
|
+
expect,
|
|
147
|
+
Page,
|
|
148
|
+
Locator,
|
|
149
|
+
BrowserContext,
|
|
150
|
+
devices,
|
|
151
|
+
} from '@playwright/test';
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
> **Note:** Most test files import \`test\`/\`expect\` from \`@playwright/test\` directly. The SDK supplements Playwright with shared utilities.
|
|
155
|
+
|
|
156
|
+
## Source Location
|
|
157
|
+
|
|
158
|
+
\`packages/iblai-js/src/playwright/\` in the \`ibl-web-frontend\` monorepo.
|
|
159
|
+
`,
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=packages-playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages-playwright.js","sourceRoot":"","sources":["../../src/resources/packages-playwright.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,2BAA2B;IAChC,IAAI,EAAE,+BAA+B;IACrC,WAAW,EACT,+FAA+F;IACjG,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJV;CACA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-containers.d.ts","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;
|
|
1
|
+
{"version":3,"file":"web-containers.d.ts","sourceRoot":"","sources":["../../src/resources/web-containers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAoLzB,CAAC"}
|