pub enum Step {
Show 28 variants
WaitFor {
id: String,
timeout_secs: Option<f64>,
},
WaitIdle,
ScrollTo {
id: String,
edge: Option<String>,
x: Option<f64>,
y: Option<f64>,
},
Tap {
id: String,
repeat: Option<u32>,
},
Submit {
id: String,
},
Input {
id: String,
text: Option<String>,
key: Option<String>,
args: Option<BTreeMap<String, Value>>,
},
SetValue {
id: String,
value: f64,
},
Toggle {
id: String,
value: Option<bool>,
},
Select {
id: String,
index: i64,
},
Reorder {
id: String,
from: usize,
to: usize,
},
Menu {
item: Option<String>,
key: Option<String>,
path: Option<Vec<String>>,
},
Toolbar {
item: String,
text: Option<String>,
key: Option<String>,
args: Option<BTreeMap<String, Value>>,
on: Option<bool>,
},
AssertVisible {
id: String,
},
AssertText {
id: String,
text: Option<String>,
key: Option<String>,
args: Option<BTreeMap<String, Value>>,
},
AssertValue {
id: String,
value: Value,
},
AssertNoPlaceholders {
allow: Vec<String>,
},
CloseWindow {
window: String,
},
Screenshot {
name: String,
window: Option<String>,
},
Pause {
secs: f64,
},
Navigate {
route: String,
},
NavBack,
AssertRoute {
route: String,
},
AssertPresented {
title: Option<String>,
},
Respond {
button: Option<i64>,
text: Option<String>,
path: Option<String>,
dismiss: bool,
},
A11yAudit {
id: Option<String>,
},
Focus {
id: String,
focused: Option<bool>,
},
AssertFocused {
id: String,
focused: Option<bool>,
},
ExpectExit {
within: Option<f64>,
},
}Variants§
WaitFor
Fields
WaitIdle
ScrollTo
Programmatic scroll (docs/scroll.md §dayscript). With edge/x+y, id must name a
scroll piece; with neither, id names ANY element and its nearest enclosing scroll
reveals it. Unanimated, so the next step sees the settled position.
Fields
Tap
Submit
Deliver Event::Submitted to the element — the scripted stand-in for the platform’s
submit gesture (Enter in a text_area with .on_submit, a field’s return key).
Input
Fields
SetValue
Toggle
Select
Reorder
Drag-reorder a list row programmatically: row from drops at row to through the same
guard → commit path a native drag takes (docs/list.md) — the app’s reorder_guard may
deny or retarget it. Fails (non-retryably) when the list isn’t .reorderable() or the
guard denies the move.
Menu
Invoke an app-menu item programmatically (docs/menus.md): match a unique Action
leaf in the installed app-menu model by exact item label, or by key — a Fluent
key resolved in the run’s locale (locale-portable; a standard-role item also
matches its role’s core-catalog key, so the auto Preferences item is
key: day-preferences). path disambiguates with ancestor submenu labels (suffix
match). Items that run a native selector instead of a day action (role items with
id 0) are not invokable this way.
Toolbar
Drive a window-toolbar item by its id (docs/toolbars.md). With neither text: nor
on: this runs a button’s command; text: types into a search item; on: sets a
toggle. Each goes through the same dispatch the native control fires, so it exercises
the app’s wiring — it does not prove the native widget drew (a screenshot does).
Fields
key: Option<String>Localized alternative to text, exactly as Step::Input takes one: resolve this
Fluent key (with args) in the RUN’S locale and type the result. A toolbar search
field that filters on localized text needs this — a literal query written in English
matches nothing once the run switches locale.
AssertVisible
AssertText
AssertValue
AssertNoPlaceholders
Fail if any piece kind rendered a ⟨kind⟩ placeholder — i.e. the backend had no renderer
for it. Placeholders are invisible to every other assertion (the app still renders, the
screenshot still looks plausible), so this is the only step that catches a missing or
silently-dropped renderer. allow lists the kinds a target is expected to lack, which
makes the script itself the per-target gap ledger; anything outside it is a failure.
CloseWindow
Close the secondary window opened under window (day::open_window’s key —
the preferences window is day.preferences), through the same async confirm →
teardown path a title-bar close takes (docs/windows.md; on the cover-fallback tier
this dismisses the cover). An already-closed window is a success (closing is
idempotent).
Screenshot
Fields
window: Option<String>Capture the secondary window opened under this key (day::open_window’s key)
instead of the primary (docs/windows.md). On the cover-fallback tier the key
resolves to the primary window, whose fullscreen cover IS the content — same
pixels, no special case. A missing key fails retryably (the window may still be
opening).
Pause
Navigate to a registered route (reset-to semantics; “” = root). docs/navigation.md.
Pop one navigation level (the native back path, day-initiated).
AssertRoute
Assert the current route path (“” = root).
AssertPresented
Assert a modal is presented, optionally checking its title (docs/dialogs.md).
Respond
Answer the open modal: a button index, a prompt text, a file path (open/save
pickers — relative paths resolve against the app temp dir, writable on every target), or
dismiss.
A11yAudit
Diff the NATIVE accessibility tree against Day’s expectations (role/label/value/identifier)
for every id’d node, or just id (§13, §14.2). Backends that can’t read their native tree
(found = false) are skipped; role is only compared when both sides map to a known Role.
Focus
Move native focus to the control — the real Toolkit duty, not a synthetic event, so
keyboards and end-editing flows engage (docs/focus.md). focused: false resigns it.
AssertFocused
Assert the control’s focus state as Day resolved it (NodeProbe.focused; retryable —
focus lands a turn after the request). focused defaults to true.
ExpectExit
Expect the app to TERMINATE — the only step that tolerates the app dying (docs/break.md’s
crash-reporting flow, docs/agent.md). MUST be the last step: a preceding step triggered an
intentional exit/crash, and expect_exit treats the connection dropping within within
seconds (default 15) as success; the app surviving the window is the failure. Handled
runner-side (day-cli), so the in-app engine never executes it — this arm is defensive.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnsafeUnpin for Step
impl UnwindSafe for Step
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more