faillog

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: 7 Imported by: 0

Documentation

Overview

Package faillog provides helper functions for dumping UI data on test failures.

Package faillog provides helper functions for dumping UI data on test failures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpUITree

func DumpUITree(ctx context.Context, outDir string, tconn *chrome.TestConn)

DumpUITree Dumps the whole UI tree data to 'ui_tree.txt'.

func DumpUITreeOnError

func DumpUITreeOnError(ctx context.Context, outDir string, hasError func() bool, tconn *chrome.TestConn)

DumpUITreeOnError dumps tree to 'ui_tree.txt', when the test fails. Use DumpUITreeOnErrorToFile, if you want to specify the fileName.

func DumpUITreeOnErrorToFile

func DumpUITreeOnErrorToFile(ctx context.Context, outDir string, hasError func() bool, tconn *chrome.TestConn, fileName string)

DumpUITreeOnErrorToFile checks the given hasError function and dumps the whole UI tree data into a file 'fileName' when the test fails. It does nothing when the test succeeds. TODO(b/201247306): The dump content may not include ARC UI tree due to timing issue.

func DumpUITreeToFile

func DumpUITreeToFile(ctx context.Context, outDir string, tconn *chrome.TestConn, fileName string)

DumpUITreeToFile Dumps the whole UI tree data into a file 'fileName'.

func DumpUITreeWithScreenshotOnError

func DumpUITreeWithScreenshotOnError(ctx context.Context, outDir string, hasError func() bool, cr *chrome.Chrome, filePrefix string)

DumpUITreeWithScreenshotOnError checks the given hasError function and dumps the whole UI tree data into 'filePrefix'.txt and a screenshot into 'filePrefix'.png when the test fails. It does nothing when the test succeeds.

func SaveScreenshotOnError

func SaveScreenshotOnError(ctx context.Context, cr *chrome.Chrome, outDir string, hasError func() bool)

SaveScreenshotOnError takes screenshot when the test fails. Use saveScreenshotToFileOnError, if you want to specify the fileName.

Types

This section is empty.

Jump to

Keyboard shortcuts

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