Skip to content

Commit 231d7a4

Browse files
committed
removed test from publish path
1 parent f085eaa commit 231d7a4

File tree

5 files changed

+49
-93
lines changed

5 files changed

+49
-93
lines changed

.github/workflows/debug-tests.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,7 @@ jobs:
5555
- name: Build widget
5656
run: npm run build:widget
5757

58-
- name: Install Playwright
59-
run: npx playwright install chromium
60-
61-
- name: Run widget tests
62-
run: npm run test:ci
63-
6458
- name: Publish to npm
6559
run: npm publish
6660
env:
6761
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68-
69-
- name: Upload test results
70-
if: always()
71-
uses: actions/upload-artifact@v4
72-
with:
73-
name: playwright-report
74-
path: playwright-report/
75-
retention-days: 30

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"test": "npm run test:widget",
4141
"test:widget": "npm run build:widget && playwright test",
4242
"test:widget:ui": "npm run build:widget && playwright test --ui",
43-
"test:serve": "serve -s . -p 3000 --no-clean-urls",
43+
"test:serve": "serve -s . -p 3000",
4444
"test:ci": "npm run build:widget && playwright test --reporter=list",
4545
"test:ci:only": "playwright test --reporter=list"
4646
},

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default defineConfig({
2424
webServer: {
2525
command: 'npm run test:serve',
2626
port: 3000,
27-
timeout: 60 * 1000,
27+
timeout: 60 * 1000, // 1 minute timeout
2828
reuseExistingServer: !process.env.CI,
2929
},
3030
});

tests/widget-embed.spec.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,53 @@ declare global {
77
}
88

99
test.describe('VapiWidget Embed Tests', () => {
10+
test('debug: check script loading', async ({ page }) => {
11+
// Enable console logging to see any errors
12+
page.on('console', (msg) => {
13+
if (msg.type() === 'error') {
14+
console.log('Browser console error:', msg.text());
15+
}
16+
});
17+
18+
page.on('pageerror', (error) => {
19+
console.log('Page error:', error.message);
20+
});
21+
22+
await page.goto('/test-widget-embed.html');
23+
24+
// Check if the script tag exists
25+
const scriptExists = await page.evaluate(() => {
26+
const script = document.querySelector('script[src*="widget.umd.js"]');
27+
return !!script;
28+
});
29+
console.log('Script tag exists:', scriptExists);
30+
31+
// Wait a bit for script to potentially load
32+
await page.waitForTimeout(2000);
33+
34+
// Check what's on the window
35+
const windowInfo = await page.evaluate(() => {
36+
const hasWidgetLoader = 'WidgetLoader' in window;
37+
const typeOfWidgetLoader = typeof (window as any).WidgetLoader;
38+
const keys = Object.keys(window).filter(
39+
(key) =>
40+
key.toLowerCase().includes('widget') ||
41+
key.toLowerCase().includes('loader')
42+
);
43+
44+
return {
45+
hasWidgetLoader,
46+
typeOfWidgetLoader,
47+
relevantWindowKeys: keys,
48+
// Check if the script actually executed
49+
scriptExecuted: !!(window as any)._widgetLoaderExecuted,
50+
};
51+
});
52+
53+
console.log('Window info:', windowInfo);
54+
expect(scriptExists).toBe(true);
55+
});
56+
1057
test('should load widget from script tag with data attributes', async ({
1158
page,
1259
}) => {

0 commit comments

Comments
 (0)