polish(techdemo): make demo customer-ready
req: examples/001 req: dx/008 req: form/002
This commit is contained in:
@@ -47,7 +47,7 @@ async fn browser_drives_typed_product_end_to_end() -> WebDriverResult<()> {
|
||||
|
||||
let result = async {
|
||||
driver.goto(&format!("http://{APP_ADDR}/")).await?;
|
||||
assert_text(&driver, "Rust owns the interaction graph").await?;
|
||||
assert_text(&driver, "A Linear-class work system without a frontend framework").await?;
|
||||
assert_text(&driver, "Compile checked handles").await?;
|
||||
assert_text(&driver, "No selectors. Generated resources address every target.").await?;
|
||||
wait_for_runtime(&driver).await?;
|
||||
@@ -70,25 +70,15 @@ async fn browser_drives_typed_product_end_to_end() -> WebDriverResult<()> {
|
||||
)
|
||||
.await?;
|
||||
driver
|
||||
.execute(
|
||||
&format!(
|
||||
r#"
|
||||
return fetch("/", {{
|
||||
method: "POST",
|
||||
headers: {{ "Content-Type": "application/x-www-form-urlencoded" }},
|
||||
body: "__h={}&title=Browser+verified+issue&lane=product&impact=8"
|
||||
}})
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) => {{ window.slhx.applyBatch(buffer, document.querySelector("[data-slhx-root]")); return true; }});
|
||||
"#,
|
||||
ui::control_center::handles::launch_work.id().id
|
||||
),
|
||||
Vec::new(),
|
||||
)
|
||||
.find(By::Css(&format!(
|
||||
"button{}",
|
||||
handle_selector(ui::control_center::handles::launch_work.id().id)
|
||||
)))
|
||||
.await?
|
||||
.click()
|
||||
.await?;
|
||||
|
||||
wait_for_text(&driver, &slot_selector(ui::control_center::slots::notice.id().id), "Launch accepted").await?;
|
||||
assert_text(&driver, "Browser verified issue").await?;
|
||||
wait_for_text(&driver, "body", "Browser verified issue").await?;
|
||||
assert_text(&driver, "width:88%").await?;
|
||||
|
||||
driver
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use scraper::{Html, Selector};
|
||||
use slhx::{Effect, EffectBatch, Payload, EFFECT_BATCH_ABI_VERSION};
|
||||
use slhx_techdemo::ui;
|
||||
use std::io::{Read, Write};
|
||||
use std::net::TcpStream;
|
||||
use std::process::{Child, Command, Stdio};
|
||||
@@ -47,7 +48,7 @@ fn product_is_e2e_working_over_http() {
|
||||
assert_eq!(home.status, 200);
|
||||
assert!(home.header("content-type").contains("text/html"));
|
||||
let document = Html::parse_document(home.text());
|
||||
assert_text(&document, "Rust owns the interaction graph");
|
||||
assert_text(&document, "A Linear-class work system without a frontend framework");
|
||||
assert_text(&document, "Compile checked handles");
|
||||
assert_text(&document, "Stream typed presence");
|
||||
assert_selector_count_at_least(&document, "[data-slhx-root=techdemo]", 1);
|
||||
@@ -163,7 +164,7 @@ fn product_is_e2e_working_over_http() {
|
||||
fn assert_effect_response(response: &Response) {
|
||||
assert_eq!(response.status, 200);
|
||||
assert!(response.header("content-type").contains("application/slhx"));
|
||||
assert_eq!(response.header("x-slhx-fingerprint"), "9481407110904740166");
|
||||
assert_eq!(response.header("x-slhx-fingerprint"), ui::BUILD_FINGERPRINT.0.to_string());
|
||||
let batch = response.batch();
|
||||
assert_eq!(batch.abi_version, EFFECT_BATCH_ABI_VERSION);
|
||||
assert!(!batch.ops.is_empty());
|
||||
|
||||
Reference in New Issue
Block a user