Skip to content

Let me take a screenshot inside an iframe #26

@EllaCloudCannon

Description

@EllaCloudCannon

I use this macro to take screenshots of elements in the browser; however, I can't select elements that are inside of iframes.

macro: I screenshot the element {selector} as {name}
steps:
  - step: In my browser, I evaluate {js}
    js: |-
      await toolproof.waitFor(() => document.readyState == 'complete');
      await document.fonts.ready;
      let status = "Name is OK.";
      if ("%name%".indexOf("/") >= 0) {
        status = "Name contains a slash but should not."
      }
      if ("%name%".indexOf("_") >= 0) {
        status = "Name contains an underscore but should not."
      }
      if ("%name%".indexOf(" ") >= 0) {
        status = "Name contains a space but should not."
      }
      toolproof.assert_eq(status, "Name is OK.");
  - In my browser, I screenshot the element "%selector%" to "%toolproof_process_directory%/assets%name%.webp"
  - macro: Store metadata for "%name%" from "%selector%"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions