HtmlScene unstable
Scene with the HTML vocabulary: steps that send what the browser host
sends for each user action, and assertions on fields.
Details
HtmlScene.Steps extends Scene.Steps, so every scene step works here.
Each payload is typed from the host's own payload types in Html, so a
test can't send a shape the host never would. click sends pointerdown,
mousedown, pointerup, mouseup and click, then runs the browser's defaults: it
throws on a disabled control, a submit button submits its form with the
fields read from the view, a checkbox or radio button fires input and
change, a popovertarget button toggles its popover, and a label clicks
its control. The events of one click are one interaction for the
acknowledgement rule.
Example A weather lookup
import { Command, UiSchema } from "effect/ui"import { Html } from "effect/ui/html"import { HtmlLocator, HtmlScene } from "effect/ui/html/testing"import { Effect, Schema } from "effect"
const Message = UiSchema.TaggedEnum({ UpdatedZip: { zip: Schema.String }, SubmittedForm: { zip: Schema.String }, CompletedFetchWeather: { forecast: Schema.String }})
class FetchWeather extends Command.Service<FetchWeather>()( "weather/FetchWeather", { args: { zip: Schema.String }, success: Message }) {}
const Weather = Html.component({ name: "Weather", model: Schema.Struct({ zip: Schema.String, forecast: Schema.String }), message: Message}).make({ init: () => ({ zip: "", forecast: "" }), update: ($, message) => Message.match(message, { UpdatedZip: ({ zip }) => $.evolve({ zip }), SubmittedForm: ({ zip }) => $.run(FetchWeather.make({ zip })), CompletedFetchWeather: ({ forecast }) => $.evolve({ forecast }) }), view: (h, model) => h.div( h.form.on("submit", ({ fields }) => Message.SubmittedForm({ zip: fields.zip ?? "" })).children( h.label.attr("for", "zip").children("Zip code"), h.input.attrs({ id: "zip", name: "zip" }).value(model.zip) .on("input", ({ value }) => Message.UpdatedZip({ zip: value })), h.button.children("Get Weather") ), h.p.attr("role", "status").children(model.forecast) )})
Effect.gen(function*() { const s = yield* HtmlScene.make(Weather, {}) s.type(HtmlLocator.label("Zip code"), "90210") // A submit button submits its form, with the fields read from the view. .click(HtmlLocator.role("button", { name: "Get Weather" })) .expectExact(FetchWeather.make({ zip: "90210" })) .resolve(FetchWeather, Message.CompletedFetchWeather({ forecast: "sun" })) .expect(HtmlLocator.role("status")).toHaveText("sun")}).pipe(Effect.scoped, Effect.runSync)Constructors
Starts an HTML scene: init with props, as a cursor in a scope. It
takes what Scene.make takes, and runs the same end check when the scope
closes.
Signature
declare const make: { <C extends AnyComponent>(component: C, props: Props<C>): Effect<Steps<C, never>, never, Scope>; <C extends AnyComponent, V extends Elements = never>(component: C, props: Props<C>, options: { readonly elements?: View.Vocabulary<V>; readonly slots: (h: View.Helper<never, unknown> & View.Tags<[V] extends [never] ? VocabularyOf<C> : V, never>) => { [K in Component.Slots<C>]: View.Input<never, any> }; }): Effect<Steps<C, never>, never, Scope>; <Props, Events, Parts, R, Rcv, V extends Elements = never>(component: Headless<Props, Events, Parts, R, Rcv>, props: Props, options: { readonly elements?: View.Vocabulary<V>; readonly view: (parts: Parts, h: View.Helper<never, Props> & View.Tags<V, never>) => View.Content<never, any>; }): Effect<Steps<Component<string, Props, any, any, Events, R, V, {}, never>, Parts>, never, Scope>;}The cursor after init. Its steps follow the acknowledgement rule, but
nothing checks what's pending or unacknowledged at the end.
Signature
declare const start: { <C extends AnyComponent>(component: C, props: Props<C>): Steps<C>; <Props, Events, Parts, R, Rcv, V extends Elements = never>(component: Headless<Props, Events, Parts, R, Rcv>, props: Props, options: { readonly elements?: View.Vocabulary<V>; readonly view: (parts: Parts, h: View.Helper<never, Props> & View.Tags<V, never>) => View.Content<never, any>; }): Steps<Component<string, Props, any, any, Events, R, V, {}, never>, Parts>;}Models
The assertions expect(locator) offers in an HtmlScene: the scene's,
plus checks on fields and inline styles. These want exactly one match.
Signature
interface Expect<S> extends Expect<S> { toBeChecked(checked?: boolean): S; toBeDisabled(disabled?: boolean): S; toHaveAccessibleName(name: string | RegExp): S; toHaveStyle(style: { accentColor?: string | false | RegExp; alignContent?: string | false | RegExp; alignItems?: string | false | RegExp; alignmentBaseline?: string | false | RegExp; alignSelf?: string | false | RegExp; all?: string | false | RegExp; anchorName?: string | false | RegExp; anchorScope?: string | false | RegExp; animation?: string | false | RegExp; animationComposition?: string | false | RegExp; animationDelay?: string | false | RegExp; animationDirection?: string | false | RegExp; animationDuration?: string | false | RegExp; animationFillMode?: string | false | RegExp; animationIterationCount?: string | false | RegExp; animationName?: string | false | RegExp; animationPlayState?: string | false | RegExp; animationRange?: string | false | RegExp; animationRangeEnd?: string | false | RegExp; animationRangeStart?: string | false | RegExp; animationTimeline?: string | false | RegExp; animationTimingFunction?: string | false | RegExp; appearance?: string | false | RegExp; aspectRatio?: string | false | RegExp; backdropFilter?: string | false | RegExp; backfaceVisibility?: string | false | RegExp; background?: string | false | RegExp; backgroundAttachment?: string | false | RegExp; backgroundBlendMode?: string | false | RegExp; backgroundClip?: string | false | RegExp; backgroundColor?: string | false | RegExp; backgroundImage?: string | false | RegExp; backgroundOrigin?: string | false | RegExp; backgroundPosition?: string | false | RegExp; backgroundPositionX?: string | false | RegExp; backgroundPositionY?: string | false | RegExp; backgroundRepeat?: string | false | RegExp; backgroundSize?: string | false | RegExp; baselineShift?: string | false | RegExp; baselineSource?: string | false | RegExp; blockSize?: string | false | RegExp; border?: string | false | RegExp; borderBlock?: string | false | RegExp; borderBlockColor?: string | false | RegExp; borderBlockEnd?: string | false | RegExp; borderBlockEndColor?: string | false | RegExp; borderBlockEndStyle?: string | false | RegExp; borderBlockEndWidth?: string | false | RegExp; borderBlockStart?: string | false | RegExp; borderBlockStartColor?: string | false | RegExp; borderBlockStartStyle?: string | false | RegExp; borderBlockStartWidth?: string | false | RegExp; borderBlockStyle?: string | false | RegExp; borderBlockWidth?: string | false | RegExp; borderBottom?: string | false | RegExp; borderBottomColor?: string | false | RegExp; borderBottomLeftRadius?: string | false | RegExp; borderBottomRightRadius?: string | false | RegExp; borderBottomStyle?: string | false | RegExp; borderBottomWidth?: string | false | RegExp; borderCollapse?: string | false | RegExp; borderColor?: string | false | RegExp; borderEndEndRadius?: string | false | RegExp; borderEndStartRadius?: string | false | RegExp; borderImage?: string | false | RegExp; borderImageOutset?: string | false | RegExp; borderImageRepeat?: string | false | RegExp; borderImageSlice?: string | false | RegExp; borderImageSource?: string | false | RegExp; borderImageWidth?: string | false | RegExp; borderInline?: string | false | RegExp; borderInlineColor?: string | false | RegExp; borderInlineEnd?: string | false | RegExp; borderInlineEndColor?: string | false | RegExp; borderInlineEndStyle?: string | false | RegExp; borderInlineEndWidth?: string | false | RegExp; borderInlineStart?: string | false | RegExp; borderInlineStartColor?: string | false | RegExp; borderInlineStartStyle?: string | false | RegExp; borderInlineStartWidth?: string | false | RegExp; borderInlineStyle?: string | false | RegExp; borderInlineWidth?: string | false | RegExp; borderLeft?: string | false | RegExp; borderLeftColor?: string | false | RegExp; borderLeftStyle?: string | false | RegExp; borderLeftWidth?: string | false | RegExp; borderRadius?: string | false | RegExp; borderRight?: string | false | RegExp; borderRightColor?: string | false | RegExp; borderRightStyle?: string | false | RegExp; borderRightWidth?: string | false | RegExp; borderSpacing?: string | false | RegExp; borderStartEndRadius?: string | false | RegExp; borderStartStartRadius?: string | false | RegExp; borderStyle?: string | false | RegExp; borderTop?: string | false | RegExp; borderTopColor?: string | false | RegExp; borderTopLeftRadius?: string | false | RegExp; borderTopRightRadius?: string | false | RegExp; borderTopStyle?: string | false | RegExp; borderTopWidth?: string | false | RegExp; borderWidth?: string | false | RegExp; bottom?: string | false | RegExp; boxDecorationBreak?: string | false | RegExp; boxShadow?: string | false | RegExp; boxSizing?: string | false | RegExp; breakAfter?: string | false | RegExp; breakBefore?: string | false | RegExp; breakInside?: string | false | RegExp; captionSide?: string | false | RegExp; caretColor?: string | false | RegExp; clear?: string | false | RegExp; clip?: string | false | RegExp; clipPath?: string | false | RegExp; clipRule?: string | false | RegExp; color?: string | false | RegExp; colorInterpolation?: string | false | RegExp; colorInterpolationFilters?: string | false | RegExp; colorScheme?: string | false | RegExp; columnCount?: string | false | RegExp; columnFill?: string | false | RegExp; columnGap?: string | false | RegExp; columnRule?: string | false | RegExp; columnRuleColor?: string | false | RegExp; columnRuleStyle?: string | false | RegExp; columnRuleWidth?: string | false | RegExp; columns?: string | false | RegExp; columnSpan?: string | false | RegExp; columnWidth?: string | false | RegExp; contain?: string | false | RegExp; container?: string | false | RegExp; containerName?: string | false | RegExp; containerType?: string | false | RegExp; containIntrinsicBlockSize?: string | false | RegExp; containIntrinsicHeight?: string | false | RegExp; containIntrinsicInlineSize?: string | false | RegExp; containIntrinsicSize?: string | false | RegExp; containIntrinsicWidth?: string | false | RegExp; content?: string | false | RegExp; contentVisibility?: string | false | RegExp; counterIncrement?: string | false | RegExp; counterReset?: string | false | RegExp; counterSet?: string | false | RegExp; cursor?: string | false | RegExp; cx?: string | false | RegExp; cy?: string | false | RegExp; d?: string | false | RegExp; direction?: string | false | RegExp; display?: string | false | RegExp; dominantBaseline?: string | false | RegExp; dynamicRangeLimit?: string | false | RegExp; emptyCells?: string | false | RegExp; fieldSizing?: string | false | RegExp; fill?: string | false | RegExp; fillOpacity?: string | false | RegExp; fillRule?: string | false | RegExp; filter?: string | false | RegExp; flex?: string | false | RegExp; flexBasis?: string | false | RegExp; flexDirection?: string | false | RegExp; flexFlow?: string | false | RegExp; flexGrow?: string | false | RegExp; flexShrink?: string | false | RegExp; flexWrap?: string | false | RegExp; float?: string | false | RegExp; floodColor?: string | false | RegExp; floodOpacity?: string | false | RegExp; font?: string | false | RegExp; fontFamily?: string | false | RegExp; fontFeatureSettings?: string | false | RegExp; fontKerning?: string | false | RegExp; fontLanguageOverride?: string | false | RegExp; fontOpticalSizing?: string | false | RegExp; fontPalette?: string | false | RegExp; fontSize?: string | false | RegExp; fontSizeAdjust?: string | false | RegExp; fontStretch?: string | false | RegExp; fontStyle?: string | false | RegExp; fontSynthesis?: string | false | RegExp; fontSynthesisSmallCaps?: string | false | RegExp; fontSynthesisStyle?: string | false | RegExp; fontSynthesisWeight?: string | false | RegExp; fontVariant?: string | false | RegExp; fontVariantAlternates?: string | false | RegExp; fontVariantCaps?: string | false | RegExp; fontVariantEastAsian?: string | false | RegExp; fontVariantEmoji?: string | false | RegExp; fontVariantLigatures?: string | false | RegExp; fontVariantNumeric?: string | false | RegExp; fontVariantPosition?: string | false | RegExp; fontVariationSettings?: string | false | RegExp; fontWeight?: string | false | RegExp; forcedColorAdjust?: string | false | RegExp; gap?: string | false | RegExp; grid?: string | false | RegExp; gridArea?: string | false | RegExp; gridAutoColumns?: string | false | RegExp; gridAutoFlow?: string | false | RegExp; gridAutoRows?: string | false | RegExp; gridColumn?: string | false | RegExp; gridColumnEnd?: string | false | RegExp; gridColumnGap?: string | false | RegExp; gridColumnStart?: string | false | RegExp; gridGap?: string | false | RegExp; gridRow?: string | false | RegExp; gridRowEnd?: string | false | RegExp; gridRowGap?: string | false | RegExp; gridRowStart?: string | false | RegExp; gridTemplate?: string | false | RegExp; gridTemplateAreas?: string | false | RegExp; gridTemplateColumns?: string | false | RegExp; gridTemplateRows?: string | false | RegExp; height?: string | false | RegExp; hyphenateCharacter?: string | false | RegExp; hyphenateLimitChars?: string | false | RegExp; hyphens?: string | false | RegExp; imageOrientation?: string | false | RegExp; imageRendering?: string | false | RegExp; inlineSize?: string | false | RegExp; inset?: string | false | RegExp; insetBlock?: string | false | RegExp; insetBlockEnd?: string | false | RegExp; insetBlockStart?: string | false | RegExp; insetInline?: string | false | RegExp; insetInlineEnd?: string | false | RegExp; insetInlineStart?: string | false | RegExp; isolation?: string | false | RegExp; justifyContent?: string | false | RegExp; justifyItems?: string | false | RegExp; justifySelf?: string | false | RegExp; left?: string | false | RegExp; letterSpacing?: string | false | RegExp; lightingColor?: string | false | RegExp; lineBreak?: string | false | RegExp; lineHeight?: string | false | RegExp; listStyle?: string | false | RegExp; listStyleImage?: string | false | RegExp; listStylePosition?: string | false | RegExp; listStyleType?: string | false | RegExp; margin?: string | false | RegExp; marginBlock?: string | false | RegExp; marginBlockEnd?: string | false | RegExp; marginBlockStart?: string | false | RegExp; marginBottom?: string | false | RegExp; marginInline?: string | false | RegExp; marginInlineEnd?: string | false | RegExp; marginInlineStart?: string | false | RegExp; marginLeft?: string | false | RegExp; marginRight?: string | false | RegExp; marginTop?: string | false | RegExp; marker?: string | false | RegExp; markerEnd?: string | false | RegExp; markerMid?: string | false | RegExp; markerStart?: string | false | RegExp; mask?: string | false | RegExp; maskClip?: string | false | RegExp; maskComposite?: string | false | RegExp; maskImage?: string | false | RegExp; maskMode?: string | false | RegExp; maskOrigin?: string | false | RegExp; maskPosition?: string | false | RegExp; maskRepeat?: string | false | RegExp; maskSize?: string | false | RegExp; maskType?: string | false | RegExp; mathDepth?: string | false | RegExp; mathShift?: string | false | RegExp; mathStyle?: string | false | RegExp; maxBlockSize?: string | false | RegExp; maxHeight?: string | false | RegExp; maxInlineSize?: string | false | RegExp; maxWidth?: string | false | RegExp; minBlockSize?: string | false | RegExp; minHeight?: string | false | RegExp; minInlineSize?: string | false | RegExp; minWidth?: string | false | RegExp; mixBlendMode?: string | false | RegExp; objectFit?: string | false | RegExp; objectPosition?: string | false | RegExp; offset?: string | false | RegExp; offsetAnchor?: string | false | RegExp; offsetDistance?: string | false | RegExp; offsetPath?: string | false | RegExp; offsetPosition?: string | false | RegExp; offsetRotate?: string | false | RegExp; opacity?: string | false | RegExp; order?: string | false | RegExp; orphans?: string | false | RegExp; outline?: string | false | RegExp; outlineColor?: string | false | RegExp; outlineOffset?: string | false | RegExp; outlineStyle?: string | false | RegExp; outlineWidth?: string | false | RegExp; overflow?: string | false | RegExp; overflowAnchor?: string | false | RegExp; overflowBlock?: string | false | RegExp; overflowClipMargin?: string | false | RegExp; overflowInline?: string | false | RegExp; overflowWrap?: string | false | RegExp; overflowX?: string | false | RegExp; overflowY?: string | false | RegExp; overscrollBehavior?: string | false | RegExp; overscrollBehaviorBlock?: string | false | RegExp; overscrollBehaviorInline?: string | false | RegExp; overscrollBehaviorX?: string | false | RegExp; overscrollBehaviorY?: string | false | RegExp; padding?: string | false | RegExp; paddingBlock?: string | false | RegExp; paddingBlockEnd?: string | false | RegExp; paddingBlockStart?: string | false | RegExp; paddingBottom?: string | false | RegExp; paddingInline?: string | false | RegExp; paddingInlineEnd?: string | false | RegExp; paddingInlineStart?: string | false | RegExp; paddingLeft?: string | false | RegExp; paddingRight?: string | false | RegExp; paddingTop?: string | false | RegExp; page?: string | false | RegExp; pageBreakAfter?: string | false | RegExp; pageBreakBefore?: string | false | RegExp; pageBreakInside?: string | false | RegExp; paintOrder?: string | false | RegExp; perspective?: string | false | RegExp; perspectiveOrigin?: string | false | RegExp; placeContent?: string | false | RegExp; placeItems?: string | false | RegExp; placeSelf?: string | false | RegExp; pointerEvents?: string | false | RegExp; position?: string | false | RegExp; positionAnchor?: string | false | RegExp; positionArea?: string | false | RegExp; positionTry?: string | false | RegExp; positionTryFallbacks?: string | false | RegExp; positionTryOrder?: string | false | RegExp; positionVisibility?: string | false | RegExp; printColorAdjust?: string | false | RegExp; quotes?: string | false | RegExp; r?: string | false | RegExp; resize?: string | false | RegExp; right?: string | false | RegExp; rotate?: string | false | RegExp; rowGap?: string | false | RegExp; rubyAlign?: string | false | RegExp; rubyPosition?: string | false | RegExp; rx?: string | false | RegExp; ry?: string | false | RegExp; scale?: string | false | RegExp; scrollbarColor?: string | false | RegExp; scrollbarGutter?: string | false | RegExp; scrollbarWidth?: string | false | RegExp; scrollBehavior?: string | false | RegExp; scrollMargin?: string | false | RegExp; scrollMarginBlock?: string | false | RegExp; scrollMarginBlockEnd?: string | false | RegExp; scrollMarginBlockStart?: string | false | RegExp; scrollMarginBottom?: string | false | RegExp; scrollMarginInline?: string | false | RegExp; scrollMarginInlineEnd?: string | false | RegExp; scrollMarginInlineStart?: string | false | RegExp; scrollMarginLeft?: string | false | RegExp; scrollMarginRight?: string | false | RegExp; scrollMarginTop?: string | false | RegExp; scrollPadding?: string | false | RegExp; scrollPaddingBlock?: string | false | RegExp; scrollPaddingBlockEnd?: string | false | RegExp; scrollPaddingBlockStart?: string | false | RegExp; scrollPaddingBottom?: string | false | RegExp; scrollPaddingInline?: string | false | RegExp; scrollPaddingInlineEnd?: string | false | RegExp; scrollPaddingInlineStart?: string | false | RegExp; scrollPaddingLeft?: string | false | RegExp; scrollPaddingRight?: string | false | RegExp; scrollPaddingTop?: string | false | RegExp; scrollSnapAlign?: string | false | RegExp; scrollSnapStop?: string | false | RegExp; scrollSnapType?: string | false | RegExp; scrollTimeline?: string | false | RegExp; scrollTimelineAxis?: string | false | RegExp; scrollTimelineName?: string | false | RegExp; shapeImageThreshold?: string | false | RegExp; shapeMargin?: string | false | RegExp; shapeOutside?: string | false | RegExp; shapeRendering?: string | false | RegExp; stopColor?: string | false | RegExp; stopOpacity?: string | false | RegExp; stroke?: string | false | RegExp; strokeDasharray?: string | false | RegExp; strokeDashoffset?: string | false | RegExp; strokeLinecap?: string | false | RegExp; strokeLinejoin?: string | false | RegExp; strokeMiterlimit?: string | false | RegExp; strokeOpacity?: string | false | RegExp; strokeWidth?: string | false | RegExp; tableLayout?: string | false | RegExp; tabSize?: string | false | RegExp; textAlign?: string | false | RegExp; textAlignLast?: string | false | RegExp; textAnchor?: string | false | RegExp; textAutospace?: string | false | RegExp; textBox?: string | false | RegExp; textBoxEdge?: string | false | RegExp; textBoxTrim?: string | false | RegExp; textCombineUpright?: string | false | RegExp; textDecoration?: string | false | RegExp; textDecorationColor?: string | false | RegExp; textDecorationLine?: string | false | RegExp; textDecorationSkipInk?: string | false | RegExp; textDecorationStyle?: string | false | RegExp; textDecorationThickness?: string | false | RegExp; textEmphasis?: string | false | RegExp; textEmphasisColor?: string | false | RegExp; textEmphasisPosition?: string | false | RegExp; textEmphasisStyle?: string | false | RegExp; textIndent?: string | false | RegExp; textJustify?: string | false | RegExp; textOrientation?: string | false | RegExp; textOverflow?: string | false | RegExp; textRendering?: string | false | RegExp; textShadow?: string | false | RegExp; textTransform?: string | false | RegExp; textUnderlineOffset?: string | false | RegExp; textUnderlinePosition?: string | false | RegExp; textWrap?: string | false | RegExp; textWrapMode?: string | false | RegExp; textWrapStyle?: string | false | RegExp; timelineScope?: string | false | RegExp; top?: string | false | RegExp; touchAction?: string | false | RegExp; transform?: string | false | RegExp; transformBox?: string | false | RegExp; transformOrigin?: string | false | RegExp; transformStyle?: string | false | RegExp; transition?: string | false | RegExp; transitionBehavior?: string | false | RegExp; transitionDelay?: string | false | RegExp; transitionDuration?: string | false | RegExp; transitionProperty?: string | false | RegExp; transitionTimingFunction?: string | false | RegExp; translate?: string | false | RegExp; unicodeBidi?: string | false | RegExp; userSelect?: string | false | RegExp; vectorEffect?: string | false | RegExp; verticalAlign?: string | false | RegExp; viewTimeline?: string | false | RegExp; viewTimelineAxis?: string | false | RegExp; viewTimelineInset?: string | false | RegExp; viewTimelineName?: string | false | RegExp; viewTransitionClass?: string | false | RegExp; viewTransitionName?: string | false | RegExp; visibility?: string | false | RegExp; webkitAlignContent?: string | false | RegExp; webkitAlignItems?: string | false | RegExp; webkitAlignSelf?: string | false | RegExp; webkitAnimation?: string | false | RegExp; webkitAnimationDelay?: string | false | RegExp; webkitAnimationDirection?: string | false | RegExp; webkitAnimationDuration?: string | false | RegExp; webkitAnimationFillMode?: string | false | RegExp; webkitAnimationIterationCount?: string | false | RegExp; webkitAnimationName?: string | false | RegExp; webkitAnimationPlayState?: string | false | RegExp; webkitAnimationTimingFunction?: string | false | RegExp; webkitAppearance?: string | false | RegExp; webkitBackfaceVisibility?: string | false | RegExp; webkitBackgroundClip?: string | false | RegExp; webkitBackgroundOrigin?: string | false | RegExp; webkitBackgroundSize?: string | false | RegExp; webkitBorderBottomLeftRadius?: string | false | RegExp; webkitBorderBottomRightRadius?: string | false | RegExp; webkitBorderRadius?: string | false | RegExp; webkitBorderTopLeftRadius?: string | false | RegExp; webkitBorderTopRightRadius?: string | false | RegExp; webkitBoxAlign?: string | false | RegExp; webkitBoxFlex?: string | false | RegExp; webkitBoxOrdinalGroup?: string | false | RegExp; webkitBoxOrient?: string | false | RegExp; webkitBoxPack?: string | false | RegExp; webkitBoxShadow?: string | false | RegExp; webkitBoxSizing?: string | false | RegExp; webkitFilter?: string | false | RegExp; webkitFlex?: string | false | RegExp; webkitFlexBasis?: string | false | RegExp; webkitFlexDirection?: string | false | RegExp; webkitFlexFlow?: string | false | RegExp; webkitFlexGrow?: string | false | RegExp; webkitFlexShrink?: string | false | RegExp; webkitFlexWrap?: string | false | RegExp; webkitJustifyContent?: string | false | RegExp; webkitLineClamp?: string | false | RegExp; webkitMask?: string | false | RegExp; webkitMaskBoxImage?: string | false | RegExp; webkitMaskBoxImageOutset?: string | false | RegExp; webkitMaskBoxImageRepeat?: string | false | RegExp; webkitMaskBoxImageSlice?: string | false | RegExp; webkitMaskBoxImageSource?: string | false | RegExp; webkitMaskBoxImageWidth?: string | false | RegExp; webkitMaskClip?: string | false | RegExp; webkitMaskComposite?: string | false | RegExp; webkitMaskImage?: string | false | RegExp; webkitMaskOrigin?: string | false | RegExp; webkitMaskPosition?: string | false | RegExp; webkitMaskRepeat?: string | false | RegExp; webkitMaskSize?: string | false | RegExp; webkitOrder?: string | false | RegExp; webkitPerspective?: string | false | RegExp; webkitPerspectiveOrigin?: string | false | RegExp; webkitTextFillColor?: string | false | RegExp; webkitTextSizeAdjust?: string | false | RegExp; webkitTextStroke?: string | false | RegExp; webkitTextStrokeColor?: string | false | RegExp; webkitTextStrokeWidth?: string | false | RegExp; webkitTransform?: string | false | RegExp; webkitTransformOrigin?: string | false | RegExp; webkitTransformStyle?: string | false | RegExp; webkitTransition?: string | false | RegExp; webkitTransitionDelay?: string | false | RegExp; webkitTransitionDuration?: string | false | RegExp; webkitTransitionProperty?: string | false | RegExp; webkitTransitionTimingFunction?: string | false | RegExp; webkitUserSelect?: string | false | RegExp; whiteSpace?: string | false | RegExp; whiteSpaceCollapse?: string | false | RegExp; widows?: string | false | RegExp; width?: string | false | RegExp; willChange?: string | false | RegExp; wordBreak?: string | false | RegExp; wordSpacing?: string | false | RegExp; wordWrap?: string | false | RegExp; writingMode?: string | false | RegExp; x?: string | false | RegExp; y?: string | false | RegExp; zIndex?: string | false | RegExp; zoom?: string | false | RegExp; } & { [name: `${string}-${string}`]: string | false | RegExp; }): S; toHaveValue(value: string): S;}A cursor over one HTML scene: the scene's steps, plus a step per user action the browser host turns into an event. Each one is an interaction.
Details
Simulated user actions (click, type, change, compositionEnd,
keydown, submit, focus and drop) throw on inert targets, regardless
of how they were found. Raw events (fire, fireElement) and blur still
reach inert targets.
Signature
interface Steps<C extends AnyComponent, Parts = never> extends Steps<C, Parts> { blur(locator: Locator): this; change(locator: Locator, value: string | Partial<InputPayload>): this; click(target: string | Locator): this; compositionEnd(locator: Locator, value?: string): this; connectivity(online: boolean): this; drop(locator: Locator, payload?: Partial<DropPayload>): this; expect(locator: Locator): Expect<Steps<C, Parts>>; fireCustomEvent(event: string, payload?: Partial<GlobalPayload<CustomEventPayload>>): this; fireDocument<K extends keyof DocumentEvents>(event: K, payload?: Partial<GlobalPayload<DocumentEvents[K]>>): this; fireElement<E extends { [event: string]: Decoder<unknown, never>; }, K extends string>(element: CustomElementBinding<any, any, E>, locator: Locator, event: K, detail: E[K]["Encoded"]): this; fireWindow<K extends keyof WindowEvents>(event: K, payload?: Partial<GlobalPayload<WindowEvents[K]>>): this; focus(locator: Locator): this; frame(delta?: number): this; keydown(locator: Locator, key: string, details?: Partial<Omit<KeyPayload, "key">>): this; mediaQuery(query: string, matches: boolean): this; submit(locator: Locator): this; type(locator: Locator, value: string, details?: Partial<Omit<ValuePayload, "value">>): this; visibility(visible: boolean): this;}