Documentation ¶
Overview ¶
Package scanapp supports controlling the Scan App on Chrome OS.
Index ¶
- Variables
- type ColorMode
- type DropdownName
- type FileType
- type PageSize
- type Resolution
- type ScanApp
- func (s *ScanApp) ClickDone() uiauto.Action
- func (s *ScanApp) ClickMoreSettings() uiauto.Action
- func (s *ScanApp) ClickMultiPageScanCheckbox() uiauto.Action
- func (s *ScanApp) ClickMyFilesLink() uiauto.Action
- func (s *ScanApp) ClickSave() uiauto.Action
- func (s *ScanApp) Close(ctx context.Context) error
- func (s *ScanApp) Exists(finder *nodewith.Finder) uiauto.Action
- func (s *ScanApp) LeftClick(finder *nodewith.Finder) uiauto.Action
- func (s *ScanApp) LeftClickUntil(finder *nodewith.Finder, condition func(context.Context) error) uiauto.Action
- func (s *ScanApp) MakeVisible(finder *nodewith.Finder) uiauto.Action
- func (s *ScanApp) MultiPageScan(PageNumber int) uiauto.Action
- func (s *ScanApp) RemovePage() uiauto.Action
- func (s *ScanApp) RescanPage() uiauto.Action
- func (s *ScanApp) Scan() uiauto.Action
- func (s *ScanApp) SelectColorMode(colorMode ColorMode) uiauto.Action
- func (s *ScanApp) SelectFileType(fileType FileType) uiauto.Action
- func (s *ScanApp) SelectPageSize(pageSize PageSize) uiauto.Action
- func (s *ScanApp) SelectResolution(resolution Resolution) uiauto.Action
- func (s *ScanApp) SelectScanner(scanner string) uiauto.Action
- func (s *ScanApp) SelectSource(source Source) uiauto.Action
- func (s *ScanApp) SetScanSettings(settings ScanSettings) uiauto.Action
- func (s *ScanApp) WaitUntilExists(finder *nodewith.Finder) uiauto.Action
- func (s *ScanApp) WaitUntilGone(finder *nodewith.Finder) uiauto.Action
- func (s *ScanApp) WithTimeout(timeout time.Duration) *ScanApp
- type ScanSettings
- type Source
Constants ¶
This section is empty.
Variables ¶
var WindowFinder *nodewith.Finder = nodewith.Name(apps.Scan.Name).ClassName("BrowserFrame").Role(role.Window)
WindowFinder is the finder for the ScanApp window.
Functions ¶
This section is empty.
Types ¶
type DropdownName ¶
type DropdownName string
DropdownName defines the name of a dropdown.
const ( DropdownNameScanner DropdownName = "Scanner" DropdownNameSource DropdownName = "Source" DropdownNameScanTo DropdownName = "Scan to" DropdownNameFileType DropdownName = "File type" DropdownNameColorMode DropdownName = "Color" DropdownNamePageSize DropdownName = "Page size" DropdownNameResolution DropdownName = "Resolution" )
The names for each of the Scan app's dropdowns.
type Resolution ¶
type Resolution string
Resolution defines a resolution option.
const ( Resolution75DPI Resolution = "75 dpi" Resolution150DPI Resolution = "150 dpi" Resolution200DPI Resolution = "200 dpi" Resolution300DPI Resolution = "300 dpi" Resolution600DPI Resolution = "600 dpi" Resolution1200DPI Resolution = "1200 dpi" )
The available resolution options.
func (Resolution) ToInt ¶
func (r Resolution) ToInt() (int, error)
ToInt returns the integer representation of `r`.
type ScanApp ¶
type ScanApp struct {
// contains filtered or unexported fields
}
ScanApp represents an instance of the Scan App.
func Launch ¶
Launch launches the Scan App and returns it. An error is returned if the app fails to launch.
func LaunchWithPollOpts ¶
func LaunchWithPollOpts(ctx context.Context, opts testing.PollOptions, tconn *chrome.TestConn) (*ScanApp, error)
LaunchWithPollOpts is like Launch, above, but allows the user to specify the PollOptions for the uiauto connection.
func (*ScanApp) ClickDone ¶
ClickDone returns a function that clicks the done button to return to the first page of the app.
func (*ScanApp) ClickMoreSettings ¶
ClickMoreSettings returns a function that clicks the More settings button to expand or collapse the content.
func (*ScanApp) ClickMultiPageScanCheckbox ¶
ClickMultiPageScanCheckbox returns a function that clicks the multi-page scan checkbox.
func (*ScanApp) ClickMyFilesLink ¶
ClickMyFilesLink returns a function that opens My files in the Files app by clicking the My files folder link.
func (*ScanApp) ClickSave ¶
ClickSave returns a function that clicks the Save button to end a multi-page scan session.
func (*ScanApp) Close ¶
Close closes the Scan App. This is automatically done when Chrome resets and is not necessary to call.
func (*ScanApp) LeftClickUntil ¶
func (s *ScanApp) LeftClickUntil(finder *nodewith.Finder, condition func(context.Context) error) uiauto.Action
LeftClickUntil calls ui.LeftClickUntil scoping the finder to the Scan App.
func (*ScanApp) MakeVisible ¶
MakeVisible calls ui.MakeVisible scoping the finder to the Scan App.
func (*ScanApp) MultiPageScan ¶
MultiPageScan returns a function that performs a multi-page scan by clicking the scan button.
func (*ScanApp) RemovePage ¶
RemovePage returns a function that moves the mouse over the scan preview section and removes the current page in view.
func (*ScanApp) RescanPage ¶
RescanPage returns a function that moves the mouse over the scan preview section and rescans the current page in view.
func (*ScanApp) SelectColorMode ¶
SelectColorMode returns a function that interacts with the Scan app to select `colorMode` from the list of supported color modes.
func (*ScanApp) SelectFileType ¶
SelectFileType returns a function that interacts with the Scan app to select `fileType` from the list of supported file types.
func (*ScanApp) SelectPageSize ¶
SelectPageSize returns a function that interacts with the Scan app to select `pageSize` from the list of supported page sizes.
func (*ScanApp) SelectResolution ¶
func (s *ScanApp) SelectResolution(resolution Resolution) uiauto.Action
SelectResolution returns a function that interacts with the Scan app to select `resolution` from the list of supported resolutions.
func (*ScanApp) SelectScanner ¶
SelectScanner returns a function that interacts with the Scan app to select `scanner` from the list of detected scanners.
func (*ScanApp) SelectSource ¶
SelectSource returns a function that interacts with the Scan app to select `source` from the list of supported sources.
func (*ScanApp) SetScanSettings ¶
func (s *ScanApp) SetScanSettings(settings ScanSettings) uiauto.Action
SetScanSettings returns a function that interacts with the Scan app to set the scan settings.
func (*ScanApp) WaitUntilExists ¶
WaitUntilExists calls ui.WaitUntilExists scoping the finder to the Scan App.
func (*ScanApp) WaitUntilGone ¶
WaitUntilGone calls ui.WaitUntilGone scoping the finder to the Scan App.
type ScanSettings ¶
type ScanSettings struct { Scanner string Source Source FileType FileType ColorMode ColorMode PageSize PageSize Resolution Resolution }
ScanSettings defines the settings to use to perform a scan.