Documentation ¶
Overview ¶
Package util contains some common utilities or constants that are used by multiple input tests.
Index ¶
- Variables
- func ExtractExternalFilesFromMap(messages map[InputModality]data.Message, inputMethods []ime.InputMethod) []string
- func GetNthCandidateText(ctx context.Context, tconn *chrome.TestConn, n int) (string, error)
- func GetNthCandidateTextAndThen(tconn *chrome.TestConn, n int, fn func(text string) uiauto.Action) uiauto.Action
- func RunSubTest(ctx context.Context, s *testing.State, cr *chrome.Chrome, testName string, ...)
- func RunSubtestsPerInputMethodAndMessage(ctx context.Context, uc *useractions.UserContext, s *testing.State, ...)
- func RunSubtestsPerInputMethodAndModalidy(ctx context.Context, tconn *chrome.TestConn, s *testing.State, ...)
- func WaitForFieldNotEmpty(tconn *chrome.TestConn, finder *nodewith.Finder) uiauto.Action
- func WaitForFieldTextToBe(tconn *chrome.TestConn, finder *nodewith.Finder, expectedText string) uiauto.Action
- func WaitForFieldTextToBeIgnoringCase(tconn *chrome.TestConn, finder *nodewith.Finder, expectedText string) uiauto.Action
- func WaitForFieldTextToSatisfy(tconn *chrome.TestConn, finder *nodewith.Finder, description string, ...) uiauto.Action
- type InputEval
- type InputModality
Constants ¶
This section is empty.
Variables ¶
var PKCandidatesFinder = nodewith.Role(role.ImeCandidate).Onscreen()
PKCandidatesFinder is the finder for candidates in the IME candidates window.
Functions ¶
func ExtractExternalFilesFromMap ¶
func ExtractExternalFilesFromMap(messages map[InputModality]data.Message, inputMethods []ime.InputMethod) []string
ExtractExternalFilesFromMap returns the file names contained in messages for selected input methods.
func GetNthCandidateText ¶
GetNthCandidateText returns the candidate text in the specified position in the candidates window.
func GetNthCandidateTextAndThen ¶
func GetNthCandidateTextAndThen(tconn *chrome.TestConn, n int, fn func(text string) uiauto.Action) uiauto.Action
GetNthCandidateTextAndThen returns an action that performs two steps in sequence: 1) Get the specified candidate. 2) Pass the specified candidate into provided function and runs the returned action. This is used when an action depends on the text of a candidate.
func RunSubTest ¶
func RunSubTest(ctx context.Context, s *testing.State, cr *chrome.Chrome, testName string, action uiauto.Action)
RunSubTest is designed to run an action as a subtest. It reserves 5s for general cleanup, dumping ui tree and screenshot on error.
func RunSubtestsPerInputMethodAndMessage ¶
func RunSubtestsPerInputMethodAndMessage(ctx context.Context, uc *useractions.UserContext, s *testing.State, inputMethods []ime.InputMethod, messages []data.Message, subtest func(testName string, inputData data.InputData) func(ctx context.Context, s *testing.State))
RunSubtestsPerInputMethodAndMessage runs subtest that uses testName and inputdata on every combination of given input methods and messages.
func RunSubtestsPerInputMethodAndModalidy ¶
func RunSubtestsPerInputMethodAndModalidy(ctx context.Context, tconn *chrome.TestConn, s *testing.State, inputMethods []ime.InputMethod, messages map[InputModality]data.Message, subtest func(testName string, modality InputModality, inputData data.InputData) func(ctx context.Context, s *testing.State))
RunSubtestsPerInputMethodAndModalidy runs subtest that uses testName and inputdata on every combination of given input methods and messages.
func WaitForFieldNotEmpty ¶
WaitForFieldNotEmpty returns an action checking whether the input field value is not empty.
func WaitForFieldTextToBe ¶
func WaitForFieldTextToBe(tconn *chrome.TestConn, finder *nodewith.Finder, expectedText string) uiauto.Action
WaitForFieldTextToBe returns an action checking whether the input field value equals given text. The text is case sensitive.
func WaitForFieldTextToBeIgnoringCase ¶
func WaitForFieldTextToBeIgnoringCase(tconn *chrome.TestConn, finder *nodewith.Finder, expectedText string) uiauto.Action
WaitForFieldTextToBeIgnoringCase returns an action checking whether the input field value equals given text. The text is case insensitive.
Types ¶
type InputModality ¶
type InputModality string
InputModality describes the available input modalities.
const ( InputWithVK InputModality = "Virtual Keyboard" InputWithVoice InputModality = "Voice" InputWithHandWriting InputModality = "Handwriting" InputWithPK InputModality = "Physical Keyboard" )
Valid values for InputModality.