https://github.com/adomurad/r2e-platform
https://github.com/adomurad/r2e-platform
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adomurad/r2e-platform
- Owner: adomurad
- License: upl-1.0
- Created: 2024-10-18T06:22:59.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-02-01T11:16:25.000Z (4 months ago)
- Last Synced: 2025-03-15T07:11:12.151Z (2 months ago)
- Language: Roc
- Homepage: https://adomurad.github.io/r2e-platform/
- Size: 5.72 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- roc-awesome - adomurad/r2e-platform
README
# R2E Platform
E2E testing in Roc!
Docs: https://adomurad.github.io/r2e-platform/
Tutorial: https://adomurad.github.io/r2e-platform/Tutorial
Releases: https://github.com/adomurad/r2e-platform/releases
Example Repo: https://github.com/adomurad/r2e-platform-example
## Warning
This platform downloads ~150MB at the first start - "chrome for testing" and
chromedriver.## Showcase

Present the results in one of the predefined formats, or create you own
reporters:
## Support
Currently only supported target is chrome.
Running R2E Platform is possible only on:
- Linux x64
- MacOS arm
- MacOS x64Tested only on:
- Linux x64
- MacOS arm## Example:
```roc
app [test_cases, config] { r2e: platform "https://github.com/adomurad/r2e-platform/releases/download/0.9.0/18rG0wcljf8EmqFsLkFc8bioPpNZPyH_NJ83oCdmPrQ.tar.br" }import r2e.Test exposing [test]
import r2e.Config
import r2e.Debug
import r2e.Browser
import r2e.Element
import r2e.Assertconfig = 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 *"),
)
```## Local Development
```sh
roc build.roc
``````sh
roc --prebuilt-platform app.roc
```## Compatibility
To build this, you will need:
- zig
- golang