Closed haf closed 6 years ago
Also, we should have an opt-in warning of using the global browser instance/alt opt-in crash on using it.
You mean pass in all options when you start the browser?
I moved them all to a record and made it mutable one time, and it was not that great.
Not sure how yet. I haven't looked into it; but passing around a context with that configuration is a nice way to make it thread safe. We'll still have the singleton static for the non-thread-safe default.
Yes I am happy with anything that is 'more correct'.
Ultimately need two results:
1) Mostly backwards compat 'classic' version, people like it because its low barrier of entry and really simple/clean API, even though its not idiomatic. 2) Idiomatic F# + Parallel friendly version. I don't have conventional feelings about what idiomatic F# is, so I am happy to follow community guidelines there.
If you can add travis testing it would ensure I don't inadvertently break something.
I think I have something that could work... Now it needs testing. I'm going to revert all XX functions now.
Also, it would be nice to have this running on .Net Core and perhaps even on NodeJS?
There is another WIP for .net core support, but I think its stale.
When you say node js, you mean a javascript version of the library?
Food time
Ok, that's that. Compiles again and should support passing the browser. Next up:
Compat
module that restores the globals and obsoletes them.I'm not going to tackle the naming yet.
To consider: making the thread sleep async in wait.fs
.
What do you say about moving the test framework to another assembly to keep it lean?
You should definitely document companion.fsx — it looks sweet!
For now I would like to keep the runner part together.
You can check out companion here: https://chrome.google.com/webstore/detail/canopy-companion-css-sele/jehfnloleecojodohcdfpbhjahhaplje
It works pretty well!
Nice tool :)
A split would look like this:
Canopy.Core
— what was just changed
Canopy
— depends on Canopy.Core
and Canopy.Runner
Canopy.Runner
— the runner
That way, people who reference Canopy
still get the same stuff.
I convert this to .Net Core if you let me.
Also; can I convert the naming of modules to F# standard PascalCase?
I am fine with PascalCase for everything except classic mode. Converting to .Net core is great also. I am not a fan of code organization through assemblies, but I will think on it.
Left to do: sort out the TODOs about global variables and configuration. Leaving for the evening. Parallel running should work now.
I'm thinking we have supply a Context = { browser: IWebDriver; conf: CanopyConfig }
and then we have a type that exposes all functions from Canopy.Core
curried with the browser instance; that way we can create a browser instance with all the convenience functions and still be thread safe.
I think we should rid ourselves of the global variables as well; move all those to a record and keep that with the browser instance.