module UITests.Tests

open canopy
open System.IO
open Expecto
open System
open System.Threading

let serverUrl = "http://localhost:8085/"

let tests = 
    testList "client tests" [
        testCase "sound check - server is online" <| fun () ->
            url serverUrl
            waitForElement ".elmish-app"

            
        testCase "login with test user" <| fun () ->
            url serverUrl
            waitForElement ".elmish-app"

            let logout = someElement  ".logout"
            if logout.IsSome then click "Logout"

            click "Login"

            "#username" << "test"
            "#password" << "test"

            click "Log In"
            
            waitForElement "Isaac Abraham"
    ]

module UITests.Tests

open canopy
open System.IO
open Expecto
open System
open System.Threading

let serverUrl = "http://localhost:8085/"

let tests = 
    testList "client tests" [
        testCase "sound check - server is online" <| fun () ->
            url serverUrl
            waitForElement ".elmish-app"

            
        testCase "login with test user" <| fun () ->
            url serverUrl
            waitForElement ".elmish-app"

            let logoutLinkSelector = ".logout"
            let loginLinkSelector = "Login"

            let logout = someElement logoutLinkSelector 
            if logout.IsSome then
                click logoutLinkSelector 
                waitForElement loginLinkSelector

            click loginLinkSelector

            "#username" << "test"
            "#password" << "test"

            click "Log In"
            
            waitForElement logoutLinkSelector
    ]

Isolate user login test from changes in wish list.
Isolate user login test from changes in wish list.

If you remove Isaac's book from the wish list, the Canopy user login
test fails, because it checks for Isaac.  While I agree that removing
Isaac is a crime, the test should probably check for the logout option
in the menu.  Changed to do this.
