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

Any instructions on how to setup a .fsx script file #457

Open
rodsantest1 opened this issue Nov 6, 2018 · 7 comments
Open

Any instructions on how to setup a .fsx script file #457

rodsantest1 opened this issue Nov 6, 2018 · 7 comments

Comments

@rodsantest1
Copy link

rodsantest1 commented Nov 6, 2018

How do I setup imports and references to use .fsx script file?

I'm using VS 2017 FX 4.6.1

See image

@lefthandedgoat
Copy link
Owner

This may help you:

#148

@amirrajan
Copy link
Collaborator

And this: #385

@rodsantest1
Copy link
Author

How does CanopyRepl work in canopy-lite? I tried fsi CanopyRepl.fsx but nothing happened. I was thinking it would somehow allow me to run a statement line by line like in old Visual Studio version where you can press Alt+Enter on a line to execute that line only.

@halcwb
Copy link

halcwb commented Feb 5, 2019

I setup a script file using the paket generate_load_scripts command. I can just load the generated fsx file in my script file like: #load "./../../../.paket/load/net472/UITests/uitests.group.fsx".

I can start up a browser, create a test and have the test run. However, the only problem is that if I repeat throwing the code to the REPL, the test will be activated twice (because it is again added). So, I would like to clear the list of tests to be run. I tried this:

#load "./../../../.paket/load/net472/UITests/uitests.group.fsx"

open System
open System.IO
open canopy
open canopy.runner.classic
open canopy.configuration
open canopy.classic
open canopy.types

let filepath = __SOURCE_DIRECTORY__
let driverpath =
    @"./../../../packages/uitests/Selenium.WebDriver.ChromeDriver/driver/win32"
let chromepath = Path.Combine(filepath, driverpath)

chromeDir <- chromepath
suites <- [ new suite() ]
start chrome
"check if the app is loaded" &&& fun _ ->
    // go to the url
    url "http://localhost:8080/"
    // check if the elmish-app div is displayed
    displayed "#elmish-app"
run()
quit()

But trying to start with a fresh set of tests by suites <- [ new suite() ] doesn't work.

@lefthandedgoat
Copy link
Owner

@halcwb What you have seems reasonable.

Are you running this twice? #load "./../../../.paket/load/net472/UITests/uitests.group.fsx"

Or running it one time, and then pasting the contents of the fsx the second time?

@halcwb
Copy link

halcwb commented Feb 6, 2019

I run the complete script once, then the lines including and following suites <- [ new suite() ]. This will run one test but will report the result from the previous tests. If I run the complete script, the result is the same, however. So, the previous tests are still cached bij the fsi.

P.s. Besides this, it works like a charm! Great!!!

@halcwb
Copy link

halcwb commented Feb 6, 2019

P.P.S. Beware of this problem. I.e. incorrect order of reference with first the canop reference and then the selenium webdriver reference instead of vica versa. You need to correct this manually in the group.fsx script generated by Paket.

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

No branches or pull requests

4 participants