Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
c

ConnectedView

class ConnectedView[-Msg]

A semantic handle to one connected root or nested LiveView.

Actions resolve bindings from the latest committed HTML and wait for the correlated lifecycle reply. Runtime connection objects and protocol frames remain private implementation details.

Defined by scalive.testing.ConnectedView. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:226-353)

Methods16

awaitAction

def awaitAction: zio.package.Task[testing.ConnectedAction]

Waits for the next uncorrelated navigation or physical disconnect.

Defined by scalive.testing.ConnectedView.awaitAction. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:285-285)

awaitDiff

def awaitDiff: zio.package.Task[Unit]

Waits for the next uncorrelated async, subscription, or component output.

Defined by scalive.testing.ConnectedView.awaitDiff. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:282-282)

awaitDisconnected

def awaitDisconnected: zio.package.UIO[Unit]

Waits until this view's physical transport has closed.

Defined by scalive.testing.ConnectedView.awaitDisconnected. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:308-308)

awaitHtml

def awaitHtml(description: String, timeout: java.time.Duration)(predicate: String => Boolean): zio.package.Task[String]

Returns the first observed HTML satisfying predicate, checking the current snapshot before waiting for uncorrelated output. One overall deadline bounds the wait; a timeout reports the description and last observed HTML. The deadline uses the current ZIO clock. Predicate exceptions and view closure fail the task.

The predicate must be quick and nonblocking. Complete actions before waiting, and do not run concurrent awaitHtml or awaitDiff calls on this view: they consume the same notifications. This observes the latest server projection, not every intermediate state or the browser DOM.

Defined by scalive.testing.ConnectedView.awaitHtml. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:245-247)

changeForm

def changeForm(selector: String, fields: Vector[(String, String)], target: Option[String] = ...): zio.package.Task[testing.ConnectedAction]

Dispatches the selected form's phx-change binding.

Defined by scalive.testing.ConnectedView.changeForm. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:262-267)

click

def click(selector: String): zio.package.Task[testing.ConnectedAction]

Dispatches the phx-click binding on exactly one matching element.

Defined by scalive.testing.ConnectedView.click. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:254-255)

clickButton

def clickButton(label: String): zio.package.Task[testing.ConnectedAction]

Dispatches the phx-click binding on exactly one button with the given text.

Defined by scalive.testing.ConnectedView.clickButton. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:258-259)

currentUrl

def currentUrl: zio.package.Task[zio.http.URL]

Returns the route URL currently owned by this exact joined generation.

Defined by scalive.testing.ConnectedView.currentUrl. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:302-302)

html

def html: zio.package.UIO[String]

Returns the latest committed semantic HTML projection.

Defined by scalive.testing.ConnectedView.html. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:234-234)

isJoined

def isJoined: zio.package.UIO[Boolean]

Reports whether this exact topic is still installed in the production supervisor.

Defined by scalive.testing.ConnectedView.isJoined. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:305-305)

joinNested

def joinNested(instanceId: String): zio.package.RIO[zio.Scope, testing.ConnectedView[Nothing]]

Joins a nested LiveView registered in this view's latest committed HTML.

Defined by scalive.testing.ConnectedView.joinNested. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:288-289)

leave

def leave: zio.package.Task[Unit]

Leaves this lifecycle through the production supervisor.

Defined by scalive.testing.ConnectedView.leave. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:311-311)

send

def send(message: Msg): zio.package.Task[testing.ConnectedAction]

Sends one typed server message and waits for its committed output.

Defined by scalive.testing.ConnectedView.send. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:279-279)

submitForm

def submitForm(selector: String, fields: Vector[(String, String)], submitter: Option[RawFormSubmitter] = ...): zio.package.Task[testing.ConnectedAction]

Dispatches the selected form's phx-submit binding.

Defined by scalive.testing.ConnectedView.submitForm. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:270-276)

text

def text(selector: String): zio.package.Task[String]

Returns the text of exactly one element matching selector.

Defined by scalive.testing.ConnectedView.text. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:250-251)

upload

def upload(uploadRef: String, entryRef: String, fileName: String, mediaType: String, bytes: zio.Chunk[Byte]): zio.package.Task[Unit]

Runs hosted upload preflight and streams one complete entry to the lifecycle.

Defined by scalive.testing.ConnectedView.upload. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:292-299)

Values1

topic

val topic: String

Stable protocol topic text for diagnostics. It is not a runtime handle.

Defined by scalive.testing.ConnectedView.topic. View source (scalive/testing/src/scalive/testing/ConnectedRender.scala:231-231)