Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues compiling code for tests #3

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

christian-bromann
Copy link

@christian-bromann christian-bromann commented Oct 18, 2023

Some gotchas:

  • since the code base is run in CJS we have to add vite-plugin-commonjs to transform project code into ESM
  • the current approach of skipping tests if certain primitives aren't available doesn't work with WebdriverIO as it has to run at least one single test, I raised an issue [🐛 Bug]: browser runner stales if no it block is found webdriverio/webdriverio#11466 to fix that
  • the stack trace test fails since there is no trace, not sure if it is a WDIO issue or if the trace gets cleared somewhere else
  • your original error you posted is caused by split2 which is a WDIO dependency and should get transformed to ESM properly, however it fails doing so here, I will investigate this - the workaround now is to fetch an ESM version from a CDN

@fatso83
Copy link
Owner

fatso83 commented Oct 19, 2023

Wow, that was a quick turnaround for a quite complicated issue! All good, except for some tests now complaining TypeError: utilPromisify is not a function. I'll have a look later.

@christian-bromann
Copy link
Author

@fatso83 I pushed a fix for that. Let me know if there is anything else I can do. Would love to see the SinonJS community doing browser tests in WebdriverIO 😉

@fatso83 fatso83 merged commit a6d5090 into fatso83:wdio-experiment Oct 19, 2023
9 checks passed
@fatso83
Copy link
Owner

fatso83 commented Oct 20, 2023

I got this working fine locally, also with headless chrome, so that's promising. Also ran firefox and safari tests.

I just need to figure out why the Sauce Labs tests are not working:

[0-0] 2023-10-20T09:28:50.364Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: net::ERR_CONNECTION_REFUSED
[0-0]   (Session info: chrome=118.0.5993.71)
[0-0] 2023-10-20T09:28:50.365Z ERROR @wdio/runner: Failed to run browser tests with cid 0-0: unknown error: Failed to load test page to run tests, make sure your browser can access "http://localhost:55740/"
...
[0-0]  Error:  Failed to load test page to run tests, make sure your browser can access "http://localhost:55740/"

Quite weird, but I hope SL support figures out.

@christian-bromann
Copy link
Author

Yes, there is an issue somewhere logged for the SL case. It was working when I initially released it but regressed since then and I haven't had a chance to look into it. What happens here is that WebdriverIO can't set up a socket connection with the browser in the cloud even with Sauce Connect enabled. Let me take a look again on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants