glendam/smoke

Runs a generic browser smoke check through Glendam.

The command opens a URL, waits for a selector, optionally verifies page text, and optionally clicks the selector before waiting for a second text value.

Types

Describes failures from the browser smoke check.

pub type SmokeError {
  InvalidArguments
  BrowserCouldNotLaunch(reason: chrome.LaunchError)
  BrowserOperationFailed(reason: chrome.RequestError)
  ExpectedTextWasNotFound(expected: String, actual: String)
  TextDidNotChange(expected: String, actual: String)
  BrowserShutdownFailed(reason: chrome.RequestError)
}

Constructors

  • InvalidArguments

    The command-line arguments were incomplete.

  • BrowserCouldNotLaunch(reason: chrome.LaunchError)

    Chrome could not be launched.

  • BrowserOperationFailed(reason: chrome.RequestError)

    A browser protocol operation failed.

  • ExpectedTextWasNotFound(expected: String, actual: String)

    The expected text was not present in the page body.

  • TextDidNotChange(expected: String, actual: String)

    The selected element did not reach the expected text after a click.

  • BrowserShutdownFailed(reason: chrome.RequestError)

    Browser shutdown failed after a successful or failed workflow.

Values

pub fn main() -> Nil

Runs the command-line browser smoke test.

pub fn run(
  url url: String,
  selector selector: String,
  expected_text expected_text: option.Option(String),
  after_click_text after_click_text: option.Option(String),
) -> Result(Nil, SmokeError)

Opens a URL, verifies text, and optionally clicks the selected element.

Search Document