Internal.Test browserInfo
A test which has yet to be evaluated. When evaluated,
it produces one or more scenarios execution agains WebDriver
host
See test
for some ways to create a Test
.
test : String -> (Step.Functions -> Task String out) -> Test browserInfo
Return a Test
that evaluates a single
scenario agains WebDriver
host.
import Test exposing (test)
import Expect
test "go to github main page" <|
\{ url } ->
url "https://github.com"
describe : String -> List (Test browserInfo) -> Test browserInfo
Apply a description to a list of tests.
import WebDriver.Test exposing (describe, test)
describe "WebDriver"
[ describe "Navigate"
[ test "go to github main page" <|
\{ url } ->
url "https://github.com"
]
]
Passing an empty list will result in a failing test, because you either made a mistake or are creating a placeholder.
skip : Test browserInfo -> Test browserInfo
Returns a Test
that gets skipped.
Calls to skip
aren't meant to be committed to version control. Instead, use
it when you want to focus on getting a particular subset of your tests to
pass. If you use skip
, your entire test suite will fail, even if
each of the individual tests pass. This is to help avoid accidentally
committing a skip
to version control.
See also only
. Note that skip
takes precedence over only
;
if you use a skip
inside an only
, it will still get skipped, and if you use
an only
inside a skip
, it will also get skipped.
import WebDriver.Test exposing (describe, test, skip)
import Task
describe "WebDriver"
[ describe "Navigate"
[ skip <| test "this test will not be executed" <|
\_ -> Task.succeed ()
test "this test will be executed" <|
\_ -> Task.succeed ()
]
]
only : Test browserInfo -> Test browserInfo
Returns a Test
that causes other tests to be skipped, and only runs the given one.
Calls to only
aren't meant to be committed to version control. Instead, use
them when you want to focus on getting a particular subset of your tests to pass.
If you use only
, your entire test suite will fail, even if
each of the individual tests pass. This is to help avoid accidentally
committing a only
to version control.
If you use only
on multiple tests, only those tests will run. If you
put a only
inside another only
, only the outermost only
will affect which tests gets run.
See also skip
. Note that skip
takes precedence over only
;
if you use a skip
inside an only
, it will still get skipped, and if you use
an only
inside a skip
, it will also get skipped.
import WebDriver.Test exposing (describe, only, skip)
import Task
describe "WebDriver"
[ describe "Navigate"
[ test "this test will not be executed" <|
\_ -> Task.succeed ()
only <| test "this test will be executed" <|
\_ -> Task.succeed ()
]
]
browsers : List browserInfo -> Test browserInfo -> Test browserInfo
Test wrapper that run tests inside in all discribed
concat : List (Test browserInfo) -> Test browserInfo
Run each of the given tests.
concat [ testDecoder, testSorting ]