0.9.20 • Published 11 months ago

screenright-client v0.9.20

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

ScreenRight nodejs client library.

Installation

npm i screenright-client

Setup environments

Diagram Id

export SCREENRIGHT_DIAGRAM_ID=xxxxxxx

Deployment Token

export SCREENRIGHT_DEPLOYMENT_TOKEN=xxxxxxx

Implementation

with "Playwright"

import { capture, initializeScreenwright, finalize } from "screenright-client"

test("basic test", async ({ page }) => {

  await initializeScreenwright() // The diagram ID specified in the environment variable is used.
  // await initializeScreenwright(diagramId) <- The diagram ID specified in the argument is used.


  // With the key home, capture with the title "Home Screen".
  await capture(page, "home", "Home Screen")


  // Created with "setting" as the parent screen.
  await capture(
    page,
    "setting|projects",
    "Project list",
    "setting"
  )


  // Specify options.
  await capture(
    page,
    "home",
    "Home Screen",
    undefined,
    {
      waitMilliseconds: 200, // wait before capturing.
      clickLocatorSelector: `button:text("delete)`, // specify the element you want to click.
      annotationText: "Click here!", // specify the annotation.
      annotationDirection: "bottom", // Specifies the position of the annotation from the element.
      paddingPixel: 4, // Specifies the padding for the border surrounding the element.
      annotationTextColor: "red" | "blue" | "black" | "white" | "yellow" | "green"
      description: "write a description"
    }
  )

  await finalize()
})
0.9.20

11 months ago

0.9.14

11 months ago

0.9.13

11 months ago

0.9.12

11 months ago

0.9.11

11 months ago

0.9.10

11 months ago

0.9.9

11 months ago

0.9.8

11 months ago

0.9.7

11 months ago

0.9.6

11 months ago

0.9.5

12 months ago

0.9.4

12 months ago

0.9.3

12 months ago

0.9.2

12 months ago

0.9.1

12 months ago

0.9.0

12 months ago