-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.roc
32 lines (28 loc) · 1.08 KB
/
app.roc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# app [test_cases, config] { r2e: platform "https://github.com/adomurad/r2e-platform/releases/download/0.9.0/18rG0wcljf8EmqFsLkFc8bioPpNZPyH_NJ83oCdmPrQ.tar.br" }
app [test_cases, config] { r2e: platform "./platform/main.roc" }
import r2e.Test exposing [test]
import r2e.Config
import r2e.Debug
import r2e.Browser
import r2e.Element
import r2e.Assert
config = Config.default_config
test_cases = [test1]
test1 = test(
"use roc repl",
|browser|
# go to roc-lang.org
browser |> Browser.navigate_to!("http://roc-lang.org")?
# find repl input
repl_input = browser |> Browser.find_element!(Css("#source-input"))?
# wait for the repl to initialize
Debug.wait!(200)
# send keys to repl
repl_input |> Element.input_text!("0.1+0.2{enter}")?
# find repl output element
output_el = browser |> Browser.find_element!(Css(".output"))?
# get output text
output_text = output_el |> Element.get_text!?
# assert text - fail for demo purpose
output_text |> Assert.should_be("0.3000000001 : Frac *"),
)