I’m working on a test suite using WebDriverIO for testing an Electron application. In my spec file, I have multiple test cases (it blocks) that need to run independently, but I need to restart the Electron application before each test case to ensure a clean state.
Here’s a simplified example of what I’m trying to achieve:
describe('My test suite', () => {
it('Test case 1', () => {
Test case logic
>! });
it('Test case 2', () => {
Test case logic
>! });
More test cases...
>! });
I’ve tried using browser.url(‘app://’) to reload the application for each test case, but it didn’t work reliably, and the application didn’t load properly.
What configurations or strategies can I use to ensure that the Electron application restarts before each test case in WebDriverIO? I want each test case to start with a fresh instance of the application.
Any insights or suggestions would be greatly appreciated. Thank you!
I have tried to evoke using browser.url()
describe('My test suite', () => {
it('Test case 1', () => {
Test case logic
>! });
it('Test case 2', () => {
browser.url('app://<path>')
Test case logic
>! });
More test cases...
>! });
but it did not work and failed to load contents of the application.
user25536480 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.