Skip to content

Commit 2647911

Browse files
authored
fix(setContent): handle inner _waitForLoadState rejection (#1382)
1 parent 601d57a commit 2647911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/frames.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,11 @@ export class Frame {
635635
async setContent(html: string, options?: types.NavigateOptions): Promise<void> {
636636
const tag = `--playwright--set--content--${this._id}--${++this._setContentCounter}--`;
637637
const context = await this._utilityContext();
638-
const lifecyclePromise = new Promise(resolve => {
638+
const lifecyclePromise = new Promise((resolve, reject) => {
639639
this._page._frameManager._consoleMessageTags.set(tag, () => {
640640
// Clear lifecycle right after document.open() - see 'tag' below.
641641
this._page._frameManager.clearFrameLifecycle(this);
642-
resolve(this._waitForLoadState(options));
642+
this._waitForLoadState(options).then(resolve).catch(reject);
643643
});
644644
});
645645
const contentPromise = context.evaluate((html, tag) => {

0 commit comments

Comments
 (0)