Skip to main content

Step

Enum Step 

Source
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

§timeout_secs: Option<f64>

Upper bound in seconds for the implicit retry wait (§14.3) — for elements that appear only after slow work (a login round-trip, a first sync). Defaults to the shared step timeout.

§

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

§edge: Option<String>

"top" | "bottom" | "leading" | "trailing".

§

Tap

Fields

§repeat: Option<u32>
§

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).

Fields

§

Input

Fields

§key: Option<String>

Localized alternative to text: resolve this Fluent key (with args) in the RUN’S locale and type the result — locale-portable queries (e.g. a localized fruit name).

§

SetValue

Fields

§value: f64
§

Toggle

Fields

§value: Option<bool>
§

Select

Fields

§index: i64
§

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.

Fields

§from: usize
§

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.

Fields

§

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

§item: String
§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

Fields

§

AssertText

§

AssertValue

Fields

§value: Value
§

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.

Fields

§allow: Vec<String>
§

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).

Fields

§window: String
§

Screenshot

Fields

§name: String
§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

Fields

§secs: f64
§

Navigate

Navigate to a registered route (reset-to semantics; “” = root). docs/navigation.md.

Fields

§route: String
§

NavBack

Pop one navigation level (the native back path, day-initiated).

§

AssertRoute

Assert the current route path (“” = root).

Fields

§route: String
§

AssertPresented

Assert a modal is presented, optionally checking its title (docs/dialogs.md).

Fields

§

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.

Fields

§button: Option<i64>
§dismiss: bool
§

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.

Fields

§

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.

Fields

§focused: Option<bool>
§

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.

Fields

§focused: Option<bool>
§

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.

Fields

§within: Option<f64>

Trait Implementations§

Source§

impl Clone for Step

Source§

fn clone(&self) -> Step

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Step

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Step

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Step

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> IntoReactive<T, StaticMark> for T
where T: Clone + 'static,

§

fn into_reactive(self) -> Reactive<T>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

Day API ↩ Guides· daybrite.dev