fake-timers icon indicating copy to clipboard operation
fake-timers copied to clipboard

Safari test run breaks in Sauce Lab due to missing W3C WebDriver support

Open fatso83 opened this issue 4 years ago • 16 comments

Full background: https://github.com/sinonjs/sinon/issues/2372.

Basically, Safari tests breaks with v12 and up. This needs to be fixed in min-wd (mantoni/min-webdriver#31).

fatso83 avatar May 20 '21 10:05 fatso83

Would it make sense to just migrate to WebDriverIO?

@christian-bromann given the visibility and popularity of this project is this something you can assist with? (feel free to say "no", no intention to pressure)

Ideally someone looking to contribute more ( @itayperry ) could take this if you can mentor them on the migration.

benjamingr avatar May 27 '21 11:05 benjamingr

Would it make sense to just migrate to WebDriverIO?

I don't think so. WebdriverIO has no capabilities to run Mocha, Jasmine and Cucumber in a browser for unit test purposes. However given that many libraries still would like to do such things I will look into supporting this. Short term I believe fixing the protocol bug in min-webdriver makes the most sense IMO.

christian-bromann avatar May 27 '21 12:05 christian-bromann

@christian-bromann thanks for the quick response it's appreciated! 🙏

The logic for running mocha tests in browsers isn't in min-webdriver it's in mochify. That could (at least optionally?) just use WebdriverIO right?

benjamingr avatar May 27 '21 12:05 benjamingr

Yes it could. Then easiest would be to implement a browserify plugin compatible interface into webdriverio similar as min-wd does it.

christian-bromann avatar May 27 '21 12:05 christian-bromann

Great, @itayperry is this something you'd be interested in contributing? It could be a good chance to contribute to another project too (WebdriverIO)

benjamingr avatar May 27 '21 13:05 benjamingr

Hi @benjamingr :) Yes, I'd be happy - I'm still working on 375 and I also wanna contribute to 374. I've been slow lately, so if no one takes this one, I definitely will :) I don't wanna stall you.

itayperry avatar May 31 '21 15:05 itayperry

... to implement a browserify plugin compatible interface into webdriverio similar as min-wd does it

I'd be happy to do it - how / where can I get started? I never did this before but it sounds interesting! :)

itayperry avatar Aug 31 '21 18:08 itayperry

I'm actually working on a Mochify rewrite (https://github.com/mantoni/mochify.js has a rewrite branch), and the current state seems to work fine. I just don't have enough free time to get it across the finish line.

mantoni avatar Aug 31 '21 19:08 mantoni

I just don't have enough free time to get it across the finish line.

@mantoni anything I can help with? (with some guidance).

itayperry avatar Sep 02 '21 15:09 itayperry

@itayperry You could start by checking out this branch and see if you can run Safari tests for fake-timers with it: https://github.com/mantoni/mochify.js/pull/241

mantoni avatar Sep 03 '21 06:09 mantoni

Hi @mantoni, I saw that you just merged rewrite-tests to rewrite branch - which made it easier for me to check out! So thank you - I couldn't find a way to check out an unmerged PR code (I read a guide but had too many issues - https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally - nevermind).

I'll be honest, I don't really know how to activate it - I tried deleting mochify from fake-timers and then using npm-link to package-link my local mochify rewrite branch. I had a few errors and I seem to be stuck.

In fact, I even tried to npm-link the basic master branch of my local mochify clone just to see if things work normally - and that also didn't work, I think I'm doing something wrong.

One more question - How do get it running? I saw this node cli --reporter nyan but couldn't quite understand it.

itayperry avatar Sep 04 '21 10:09 itayperry

Thanks for looking into it. There is clearly not enough documentation yet. I managed to run tests by invoking the new Mochify CLI locally using a relative path.

However, I will make a 0.1.0 release this afternoon and send a PR here. We can then iterate on that together. It's a lot easier when we have a running example to talk about.

mantoni avatar Sep 04 '21 11:09 mantoni

Sounds great! I'll wait for the PR. Thank you for being patient and helpful about all of it.

itayperry avatar Sep 04 '21 11:09 itayperry

@itayperry It tried all evening, and it works for Safari, but not for any other browser 🙈. Your help on the above PR and / or the Mochify rewrite would be highly appreciated.

mantoni avatar Sep 04 '21 19:09 mantoni

@mantoni I'd be very happy to help! Where should I start? (I might ask for some advice/tips).

itayperry avatar Sep 05 '21 08:09 itayperry

I figured it out for this project and have a fix in https://github.com/mantoni/mochify.js/pull/244 (spoiler: there's a very subtle bug in the geckodriver).

I'm happy to provide assistance for anyone who is willing to help. I'm sorry for the lack of documentation. A good way to start is to read through the initial "Mochify Rewrite" issue: https://github.com/mantoni/mochify.js/issues/229

Issues for the rewite can be found here: https://github.com/mantoni/mochify.js/milestone/1

mantoni avatar Sep 06 '21 07:09 mantoni

Getting this over the finish line is basically #395, for anyone interested.

fatso83 avatar Nov 22 '22 16:11 fatso83

WebDriverIO just merged the fix for "Allow to run unit tests within the browser #6928". Not sure if this makes any difference to this stale issue, but thought I would just mention it 😄

fatso83 avatar Mar 30 '23 06:03 fatso83

Ha! Yeah, WebdriverIO now supports running tests in the browser. It would be ideal for sinonjs but the Mochify PR seems to be almost ready to ship I guess.

christian-bromann avatar Mar 30 '23 15:03 christian-bromann

Yeah, all that PR needs to finish is someone that is not pre-occupied with feeding and putting kids to bed in their few allowable hours off 😄 Could perhaps put a 💵 bounty on it to get it proper tested and finished?

fatso83 avatar Mar 30 '23 15:03 fatso83

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 27 '23 10:12 stale[bot]