-
Notifications
You must be signed in to change notification settings - Fork 1
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
UiTests target + sample tests #743
Conversation
tests/Client.UiTests/Runner.fs
Outdated
|
||
open canopy.classic | ||
open canopy.types | ||
open Expecto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious about Expecto, but honestly I think it would be confusing to have different testing frameworks in one project, so let's switch to xUnit for now :) Looks like definitely possible, e.g. here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this link is quite old, I've tried to match it with current api, but it seems I won't be able to run it the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sooooo... this seems to work (instead of both Runner and Tests):
module Client.UiTests.Tests
open canopy.classic
open canopy.types
open System
open Xunit
type Fixture() =
do
//start Chrome // Use this if you want to see your tests in the browser
start ChromeHeadless
resize (1280, 960)
let serverUrl = Environment.GetEnvironmentVariable("SERVER_URL")
let startApp() =
url serverUrl
waitForElement("#elmish-app")
type Tests() =
interface IClassFixture<Fixture>
[<Fact>]
member _.``Soundcheck - server is online``() =
startApp()
[<Fact>]
member _.``Validate word is loaded``() =
startApp()
click (first ".link-block")
let taskText = (element ".task-label").GetAttribute("innerText")
Assert.NotNull taskText
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this Fixture
make it run only once? I'll modify the code then or do you have a working config already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixture code runs only once prior to running all tests.
closes #153
fake build target runuitests
All the details for installation are mentioned in README now.
Unfortunately stopping of client/server is a bit quirky, but I think that can be solved as a separate task