Skip to content

Commit 6dae4d3

Browse files
committed
Do not error when driver.quit() fails
1 parent d33a284 commit 6dae4d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,13 @@ const getDeviceName = ({
397397
}","reason": "${reason}"}}`
398398
);
399399

400-
await driver.quit();
400+
try {
401+
const sessionId = await driver.getSession();
402+
console.log({ sessionId: sessionId?.id_ });
403+
if (sessionId?.id_) await driver.quit();
404+
} catch (error) {
405+
// Do nothing when driver is already closed
406+
}
401407
}
402408
};
403409

0 commit comments

Comments
 (0)