@lvce-editor/test-with-playwright-worker 22.40.1 → 22.40.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/dist/workerMain.js +12 -5
- package/package.json +1 -1
package/dist/workerMain.js
CHANGED
|
@@ -1768,12 +1768,13 @@ const getUrlFromTestFile = (absolutePath, port, traceFocus, traceRendererWorker)
|
|
|
1768
1768
|
}
|
|
1769
1769
|
return url.href;
|
|
1770
1770
|
};
|
|
1771
|
-
const navigateToTest = async (page, url) => {
|
|
1771
|
+
const navigateToTest = async (page, url, browser) => {
|
|
1772
1772
|
await page.goto(url, {
|
|
1773
|
-
waitUntil: 'domcontentloaded'
|
|
1773
|
+
waitUntil: browser === 'webkit' ? 'commit' : 'domcontentloaded'
|
|
1774
1774
|
});
|
|
1775
1775
|
};
|
|
1776
1776
|
const runTest = async ({
|
|
1777
|
+
browser,
|
|
1777
1778
|
page,
|
|
1778
1779
|
port,
|
|
1779
1780
|
svgScreenshotOptions,
|
|
@@ -1789,7 +1790,7 @@ const runTest = async ({
|
|
|
1789
1790
|
expect
|
|
1790
1791
|
} = await import('@playwright/test');
|
|
1791
1792
|
const url = getUrlFromTestFile(test, port, traceFocus ?? false, traceRendererWorker ?? false);
|
|
1792
|
-
await navigateToTest(page, url);
|
|
1793
|
+
await navigateToTest(page, url, browser);
|
|
1793
1794
|
const testOverlay = page.locator('#TestOverlay');
|
|
1794
1795
|
await expect(testOverlay).toBeVisible({
|
|
1795
1796
|
timeout
|
|
@@ -1861,6 +1862,7 @@ const getResultCounts$1 = status => {
|
|
|
1861
1862
|
* @param {{testSrc:string, tests:string[], filter?: string, headless:boolean, page: import('@playwright/test').Page, port:number, timeout:number, onResult:any, onFinalResult:any}} param0
|
|
1862
1863
|
*/
|
|
1863
1864
|
const runTests = async ({
|
|
1865
|
+
browser = 'chromium',
|
|
1864
1866
|
filter,
|
|
1865
1867
|
headless,
|
|
1866
1868
|
onFinalResult,
|
|
@@ -1882,6 +1884,7 @@ const runTests = async ({
|
|
|
1882
1884
|
const filteredTests = filter ? tests.filter(test => test.includes(filter)) : tests;
|
|
1883
1885
|
for (const test of filteredTests) {
|
|
1884
1886
|
const result = await runTest({
|
|
1887
|
+
browser,
|
|
1885
1888
|
page,
|
|
1886
1889
|
port,
|
|
1887
1890
|
test,
|
|
@@ -2041,6 +2044,7 @@ const readTestResultsText = async (page, timeout) => {
|
|
|
2041
2044
|
return text;
|
|
2042
2045
|
};
|
|
2043
2046
|
const runTestsWithReusedPage = async ({
|
|
2047
|
+
browser,
|
|
2044
2048
|
filter,
|
|
2045
2049
|
onFinalResult,
|
|
2046
2050
|
onResult,
|
|
@@ -2056,7 +2060,7 @@ const runTestsWithReusedPage = async ({
|
|
|
2056
2060
|
const url = getAllTestsUrl(port, filter, traceFocus ?? false, rendererWorkerTraceDirectory !== undefined);
|
|
2057
2061
|
await page.goto(url, {
|
|
2058
2062
|
timeout,
|
|
2059
|
-
waitUntil: 'domcontentloaded'
|
|
2063
|
+
waitUntil: browser === 'webkit' ? 'commit' : 'domcontentloaded'
|
|
2060
2064
|
});
|
|
2061
2065
|
const text = await readTestResultsText(page, timeout);
|
|
2062
2066
|
results = parseTestResults(text);
|
|
@@ -2593,8 +2597,9 @@ const startBrowser = async ({
|
|
|
2593
2597
|
headless
|
|
2594
2598
|
};
|
|
2595
2599
|
// Chromium 153 crashes when restoring OPFS handles from its in-memory IndexedDB backend.
|
|
2600
|
+
// WebKit also rejects OPFS access in an ephemeral context.
|
|
2596
2601
|
// An empty userDataDir gives each run a temporary disk-backed profile managed by Playwright.
|
|
2597
|
-
const browserInstance = browser === '
|
|
2602
|
+
const browserInstance = browser === 'firefox' ? await launcher.launch(options) : await launcher.launchPersistentContext('', options);
|
|
2598
2603
|
let disposal;
|
|
2599
2604
|
const dispose = () => {
|
|
2600
2605
|
signal.removeEventListener('abort', handleAbort);
|
|
@@ -3015,6 +3020,7 @@ const runAllTests = async (extensionPath, testPath, cwd, browser, headless, time
|
|
|
3015
3020
|
page,
|
|
3016
3021
|
run: async () => {
|
|
3017
3022
|
await runTestsWithReusedPage({
|
|
3023
|
+
browser,
|
|
3018
3024
|
...filterOption,
|
|
3019
3025
|
onFinalResult,
|
|
3020
3026
|
onResult,
|
|
@@ -3037,6 +3043,7 @@ const runAllTests = async (extensionPath, testPath, cwd, browser, headless, time
|
|
|
3037
3043
|
page,
|
|
3038
3044
|
run: async () => {
|
|
3039
3045
|
await runTests({
|
|
3046
|
+
browser,
|
|
3040
3047
|
...filterOption,
|
|
3041
3048
|
headless,
|
|
3042
3049
|
onFinalResult,
|