diff --git a/package-lock.json b/package-lock.json index 266564c65..c366dd29a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -807,11 +807,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1774,9 +1774,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, diff --git a/playwright.config.ts b/playwright.config.ts index 184f9e8d6..23a298265 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -36,19 +36,22 @@ export default defineConfig({ name: 'chromium', use: { ...devices['Desktop Chrome'], - launchOptions: { ignoreDefaultArgs: ['--mute-audio'] }, + launchOptions: { + ignoreDefaultArgs: ['--mute-audio'], + args: ['--autoplay-policy=no-user-gesture-required'] + }, } }, - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, + // { + // name: 'firefox', + // use: { ...devices['Desktop Firefox'] }, + // }, - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, + // { + // name: 'webkit', + // use: { ...devices['Desktop Safari'] }, + // }, /* Test against mobile viewports. */ // { @@ -65,16 +68,28 @@ export default defineConfig({ // name: 'Microsoft Edge', // use: { ...devices['Desktop Edge'], channel: 'msedge' }, // }, - // { - // name: 'Google Chrome', - // use: { - // ...devices['Desktop Chrome'], - // channel: 'chrome', - // launchOptions: { - // ignoreDefaultArgs: ['--mute-audio'] - // }, - // }, - // }, + { + name: 'Google Chrome', + use: { + ...devices['Desktop Chrome'], + channel: 'chrome', + launchOptions: { + ignoreDefaultArgs: ['--mute-audio'], + args: ['--autoplay-policy=no-user-gesture-required'] + }, + }, + }, + { + name: 'Google Chrome Canary', + use: { + ...devices['Desktop Chrome'], + channel: 'chrome-canary', + launchOptions: { + ignoreDefaultArgs: ['--mute-audio'], + args: ['--autoplay-policy=no-user-gesture-required'] + }, + }, + } ], /* Run your local dev server before starting the tests */ diff --git a/src/tests/playwright/pages/audioworklet-addmodule-resolution.html b/src/tests/playwright/pages/audioworklet-addmodule-resolution.html index b31025e94..d199502e6 100644 --- a/src/tests/playwright/pages/audioworklet-addmodule-resolution.html +++ b/src/tests/playwright/pages/audioworklet-addmodule-resolution.html @@ -3,7 +3,7 @@ - Hello Sine Test + AudioWorklet Add Module Resolution

Audioworklet Add Module Resolution

diff --git a/src/tests/playwright/pages/offline-sine.html b/src/tests/playwright/pages/offline-sine.html index 7704e2f89..cf4105f66 100644 --- a/src/tests/playwright/pages/offline-sine.html +++ b/src/tests/playwright/pages/offline-sine.html @@ -10,7 +10,7 @@

Offline Sine Test

Write 441Hz sine wave for 1 second to AudioBuffer using OfflineAudioContext, sampleRate: 44100

\ No newline at end of file diff --git a/src/tests/playwright/runner.spec.ts b/src/tests/playwright/runner.spec.ts index d92186ce9..1589571fd 100644 --- a/src/tests/playwright/runner.spec.ts +++ b/src/tests/playwright/runner.spec.ts @@ -2,26 +2,24 @@ import { test, expect } from '@playwright/test'; test('Hello Sine (realtime)', async ({ page }) => { await page.goto('pages/realtime-sine.html'); - - const h1 = await page.$('h1'); - const text = await h1?.textContent(); - expect(text).toBe('Realtime Sine Test'); + await page.click('#start'); const osc = await page.evaluateHandle(object => osc); - await page.click('#start'); - // Check 440Hz const f1 = await osc.getProperty('frequency'); const f1Val = await f1.getProperty('value'); expect(await f1Val.jsonValue()).toBe(440); - await page.waitForTimeout(1000); + // wait for the updateFrequency promise to resolve + const updateFrequencyPromise = await page.evaluate(() => updateFrequencyPromise); // Check 880Hz const f2 = await osc.getProperty('frequency'); const f2Val = await f2.getProperty('value'); expect(await f2Val.jsonValue()).toBe(880); + + await page.waitForTimeout(1000); }); test('Hello Sine (offline)', async ({ page }) => { diff --git a/src/tests/playwright/version.spec.ts b/src/tests/playwright/version.spec.ts new file mode 100644 index 000000000..8eb7b1d36 --- /dev/null +++ b/src/tests/playwright/version.spec.ts @@ -0,0 +1,7 @@ +import { test, expect } from '@playwright/test'; + +test('Browser version', async ({ browser }) => { + const version = await browser.version(); + console.log('Browser version:', version); + expect(version).not.toBe(null); +}); \ No newline at end of file