printpreview

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package printpreview provides support for controlling Chrome print preview directly through the UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(ctx context.Context, tconn *chrome.TestConn) error

Print sets focus on the print button in Chrome print preview and injects the ENTER key to start printing. This is more reliable than clicking the print button since notifications often block it from view.

func SelectPrinter

func SelectPrinter(ctx context.Context, tconn *chrome.TestConn, printerName string) error

SelectPrinter interacts with Chrome print preview to select the printer with the given printerName.

func SetLayout

func SetLayout(ctx context.Context, tconn *chrome.TestConn, layout Layout) error

SetLayout interacts with Chrome print preview to change the layout setting to the provided layout.

func SetPages

func SetPages(ctx context.Context, tconn *chrome.TestConn, pages string) error

SetPages interacts with Chrome print preview to set the selected pages.

func WaitForPrintPreview

func WaitForPrintPreview(tconn *chrome.TestConn) uiauto.Action

WaitForPrintPreview waits for Print Preview to finish loading after it's initially opened.

Types

type Layout

type Layout int

Layout represents the layout setting in Chrome print preview.

const (
	// Portrait represents the portrait layout setting.
	Portrait Layout = iota
	// Landscape represents the landscape layout setting.
	Landscape
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL