diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index f6cab15687b5..e3abfad4df66 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -427,9 +427,8 @@ describe('webContents module', () => { }) describe('sendInputEvent(event)', () => { - beforeEach((done) => { - w.webContents.once('did-finish-load', () => done()) - w.loadFile(path.join(fixtures, 'pages', 'key-events.html')) + beforeEach(async () => { + await w.loadFile(path.join(fixtures, 'pages', 'key-events.html')) }) it('can send keydown events', (done) => {