Skip to content

Commit 79b435a

Browse files
committed
fix: e2e issue
1 parent 0e0d6a8 commit 79b435a

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

e2e/fixtures/modern.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
resources.forEach(resource => {
3838
// 通过检查资源特征判断是否可能404
3939
document.getElementById('test-results').innerHTML +=
40-
`<p style="color:red">${resource.name}: ${resource.responseStatus}</p>`;
40+
`${resource.name}: ${resource.responseStatus}; `;
4141
});
4242
});
4343
</script>
@@ -52,17 +52,17 @@
5252
src.includes('week-data-bundle.js')) {
5353
console.error('Critical script failed to load:', src);
5454
document.getElementById('test-results').innerHTML +=
55-
`<p style="color:red">Failed to load: ${src.split('/').pop()}</p>`;
55+
`Failed to load: ${src.split('/').pop()}`;
5656
}
5757
}
5858
}, true);
5959
</script>
6060
<script>
6161
const testResults = document.getElementById('test-results');
6262
if (window.EnumPlus && window.WeekConfig && window.SerializeJavascript) {
63-
testResults.innerHTML += '<p>All scripts loaded successfully!</p>';
63+
testResults.innerHTML += 'All scripts loaded successfully!';
6464
} else {
65-
testResults.innerHTML += '<p>Error: One or more scripts failed to load.</p>';
65+
testResults.innerHTML += 'Error: One or more scripts failed to load.';
6666
}
6767
Object.keys(window).forEach(key => {
6868
testResults.innerHTML += `${key}, `;

test/engines/playwright.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ export class PlaywrightEngine extends TestEngineBase {
4949
}) {
5050
const { page, assert, serializedEvaluateParams } = options;
5151
const resultStr = await page.evaluate((contextStr) => {
52-
throw new Error(
53-
Object.keys(window).join(', ') +
54-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
55-
JSON.stringify((window as any).__playwright__binding__) +
56-
document.documentElement.outerHTML
57-
);
52+
throw new Error(document.documentElement.outerHTML);
5853
}, serializedEvaluateParams);
5954

6055
const initialState = parse(resultStr, { /* debug: true, */ prettyPrint: false });

0 commit comments

Comments
 (0)