Documentation
¶
Index ¶
- Constants
- func KeyPressDelay() int
- func RunTests(tests []*IntegrationTest, logf func(format string, formatArgs ...interface{}), ...) error
- func TestNameFromFilePath(path string) string
- type AlertDriver
- type CommitMessagePanelDriver
- func (self *CommitMessagePanelDriver) AddNewline() *CommitMessagePanelDriver
- func (self *CommitMessagePanelDriver) Cancel()
- func (self *CommitMessagePanelDriver) Clear() *CommitMessagePanelDriver
- func (self *CommitMessagePanelDriver) Confirm()
- func (self *CommitMessagePanelDriver) InitialText(expected *Matcher) *CommitMessagePanelDriver
- func (self *CommitMessagePanelDriver) Type(value string) *CommitMessagePanelDriver
- type Common
- type ConfirmationDriver
- type FileSystem
- type Git
- type GitVersionRestriction
- type IntegrationTest
- func (self *IntegrationTest) Description() string
- func (self *IntegrationTest) ExtraCmdArgs() string
- func (self *IntegrationTest) Name() string
- func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver)
- func (self *IntegrationTest) SetupConfig(config *config.AppConfig)
- func (self *IntegrationTest) SetupRepo(shell *Shell)
- func (self *IntegrationTest) ShouldRunForGitVersion(version *git_commands.GitVersion) bool
- func (self *IntegrationTest) Skip() bool
- type Matcher
- type MenuDriver
- func (self *MenuDriver) Cancel()
- func (self *MenuDriver) Confirm()
- func (self *MenuDriver) Lines(matchers ...*Matcher) *MenuDriver
- func (self *MenuDriver) Select(option *Matcher) *MenuDriver
- func (self *MenuDriver) Title(expected *Matcher) *MenuDriver
- func (self *MenuDriver) TopLines(matchers ...*Matcher) *MenuDriver
- type NewIntegrationTestArgs
- type Paths
- type Popup
- type PromptDriver
- func (self *PromptDriver) Cancel()
- func (self *PromptDriver) Clear() *PromptDriver
- func (self *PromptDriver) Confirm()
- func (self *PromptDriver) ConfirmFirstSuggestion()
- func (self *PromptDriver) ConfirmSuggestion(matcher *Matcher)
- func (self *PromptDriver) InitialText(expected *Matcher) *PromptDriver
- func (self *PromptDriver) SuggestionLines(matchers ...*Matcher) *PromptDriver
- func (self *PromptDriver) SuggestionTopLines(matchers ...*Matcher) *PromptDriver
- func (self *PromptDriver) Title(expected *Matcher) *PromptDriver
- func (self *PromptDriver) Type(value string) *PromptDriver
- type SearchDriver
- type Shell
- func (self *Shell) Checkout(name string) *Shell
- func (self *Shell) Clone(repoName string) *Shell
- func (self *Shell) CloneIntoRemote(name string) *Shell
- func (self *Shell) CloneIntoSubmodule(submoduleName string) *Shell
- func (self *Shell) Commit(message string) *Shell
- func (self *Shell) ContinueMerge() *Shell
- func (self *Shell) CopyHelpFile(source string, destination string) *Shell
- func (self *Shell) CreateAnnotatedTag(name string, message string, ref string) *Shell
- func (self *Shell) CreateDir(path string) *Shell
- func (self *Shell) CreateFile(path string, content string) *Shell
- func (self *Shell) CreateFileAndAdd(fileName string, fileContents string) *Shell
- func (self *Shell) CreateLightweightTag(name string, ref string) *Shell
- func (self *Shell) CreateNCommits(n int) *Shell
- func (self *Shell) CreateNCommitsStartingAt(n, startIndex int) *Shell
- func (self *Shell) DeleteFile(path string) *Shell
- func (self *Shell) DeleteFileAndAdd(fileName string) *Shell
- func (self *Shell) EmptyCommit(message string) *Shell
- func (self *Shell) GitAdd(path string) *Shell
- func (self *Shell) GitAddAll() *Shell
- func (self *Shell) HardReset(ref string) *Shell
- func (self *Shell) Merge(name string) *Shell
- func (self *Shell) NewBranch(name string) *Shell
- func (self *Shell) RemoveRemoteBranch(remoteName string, branch string) *Shell
- func (self *Shell) Revert(ref string) *Shell
- func (self *Shell) RunCommand(cmdStr string) *Shell
- func (self *Shell) RunShellCommand(cmdStr string) *Shell
- func (self *Shell) RunShellCommandExpectError(cmdStr string) *Shell
- func (self *Shell) SetBranchUpstream(branch string, upstream string) *Shell
- func (self *Shell) SetConfig(key string, value string) *Shell
- func (self *Shell) Stash(message string) *Shell
- func (self *Shell) StashWithMessage(message string) *Shell
- func (self *Shell) UpdateFile(path string, content string) *Shell
- func (self *Shell) UpdateFileAndAdd(fileName string, fileContents string) *Shell
- type TestDriver
- func (self *TestDriver) Common() *Common
- func (self *TestDriver) ExpectClipboard(matcher *Matcher)
- func (self *TestDriver) ExpectPopup() *Popup
- func (self *TestDriver) ExpectSearch() *SearchDriver
- func (self *TestDriver) ExpectToast(matcher *Matcher)
- func (self *TestDriver) Fail(message string)
- func (self *TestDriver) FileSystem() *FileSystem
- func (self *TestDriver) Git() *Git
- func (self *TestDriver) GlobalPress(keyStr string)
- func (self *TestDriver) Log(message string)
- func (self *TestDriver) LogUI(message string)
- func (self *TestDriver) Shell() *Shell
- func (self *TestDriver) Views() *Views
- func (self *TestDriver) Wait(milliseconds int)
- type ViewDriver
- func (self *ViewDriver) ContainsLines(matchers ...*Matcher) *ViewDriver
- func (self *ViewDriver) Content(matcher *Matcher) *ViewDriver
- func (self *ViewDriver) Focus() *ViewDriver
- func (self *ViewDriver) IsEmpty() *ViewDriver
- func (self *ViewDriver) IsFocused() *ViewDriver
- func (self *ViewDriver) LineCount(expectedCount int) *ViewDriver
- func (self *ViewDriver) Lines(matchers ...*Matcher) *ViewDriver
- func (self *ViewDriver) NavigateToLine(matcher *Matcher) *ViewDriver
- func (self *ViewDriver) Press(keyStr string) *ViewDriver
- func (self *ViewDriver) PressEnter() *ViewDriver
- func (self *ViewDriver) PressEscape() *ViewDriver
- func (self *ViewDriver) PressPrimaryAction() *ViewDriver
- func (self *ViewDriver) SelectNextItem() *ViewDriver
- func (self *ViewDriver) SelectPreviousItem() *ViewDriver
- func (self *ViewDriver) SelectedLine(matcher *Matcher) *ViewDriver
- func (self *ViewDriver) SelectedLineIdx(expected int) *ViewDriver
- func (self *ViewDriver) SelectedLines(matchers ...*Matcher) *ViewDriver
- func (self *ViewDriver) Self() *ViewDriver
- func (self *ViewDriver) Tap(f func()) *ViewDriver
- func (self *ViewDriver) Title(expected *Matcher) *ViewDriver
- func (self *ViewDriver) TopLines(matchers ...*Matcher) *ViewDriver
- type Views
- func (self *Views) AppStatus() *ViewDriver
- func (self *Views) Branches() *ViewDriver
- func (self *Views) CommitFiles() *ViewDriver
- func (self *Views) CommitMessage() *ViewDriver
- func (self *Views) Commits() *ViewDriver
- func (self *Views) Confirmation() *ViewDriver
- func (self *Views) Files() *ViewDriver
- func (self *Views) Information() *ViewDriver
- func (self *Views) Main() *ViewDriver
- func (self *Views) Menu() *ViewDriver
- func (self *Views) MergeConflicts() *ViewDriver
- func (self *Views) PatchBuilding() *ViewDriver
- func (self *Views) PatchBuildingSecondary() *ViewDriver
- func (self *Views) ReflogCommits() *ViewDriver
- func (self *Views) RemoteBranches() *ViewDriver
- func (self *Views) Remotes() *ViewDriver
- func (self *Views) Search() *ViewDriver
- func (self *Views) Secondary() *ViewDriver
- func (self *Views) Staging() *ViewDriver
- func (self *Views) StagingSecondary() *ViewDriver
- func (self *Views) Stash() *ViewDriver
- func (self *Views) Status() *ViewDriver
- func (self *Views) SubCommits() *ViewDriver
- func (self *Views) Submodules() *ViewDriver
- func (self *Views) Suggestions() *ViewDriver
- func (self *Views) Tags() *ViewDriver
Constants ¶
const ( TEST_NAME_ENV_VAR = "TEST_NAME" SANDBOX_ENV_VAR = "SANDBOX" GIT_CONFIG_GLOBAL_ENV_VAR = "GIT_CONFIG_GLOBAL" )
const ClearKey = "<c-u>"
TODO: soft-code this
const IS_SELECTED_RULE_NAME = "is selected"
Variables ¶
This section is empty.
Functions ¶
func KeyPressDelay ¶
func KeyPressDelay() int
this is the delay in milliseconds between keypresses defaults to zero
func RunTests ¶
func RunTests( tests []*IntegrationTest, logf func(format string, formatArgs ...interface{}), runCmd func(cmd *exec.Cmd) error, testWrapper func(test *IntegrationTest, f func() error), sandbox bool, keyPressDelay int, maxAttempts int, ) error
This function lets you run tests either from within `go test` or from a regular binary. The reason for having two separate ways of testing is that `go test` isn't great at showing what's actually happening during the test, but it's still good at running tests in telling you about their results.
func TestNameFromFilePath ¶
Types ¶
type AlertDriver ¶
type AlertDriver struct {
// contains filtered or unexported fields
}
func (*AlertDriver) Cancel ¶
func (self *AlertDriver) Cancel()
func (*AlertDriver) Confirm ¶
func (self *AlertDriver) Confirm()
func (*AlertDriver) Content ¶
func (self *AlertDriver) Content(expected *Matcher) *AlertDriver
asserts that the alert view has the expected content
func (*AlertDriver) Title ¶
func (self *AlertDriver) Title(expected *Matcher) *AlertDriver
asserts that the alert view has the expected title
type CommitMessagePanelDriver ¶
type CommitMessagePanelDriver struct {
// contains filtered or unexported fields
}
func (*CommitMessagePanelDriver) AddNewline ¶
func (self *CommitMessagePanelDriver) AddNewline() *CommitMessagePanelDriver
func (*CommitMessagePanelDriver) Cancel ¶
func (self *CommitMessagePanelDriver) Cancel()
func (*CommitMessagePanelDriver) Clear ¶
func (self *CommitMessagePanelDriver) Clear() *CommitMessagePanelDriver
func (*CommitMessagePanelDriver) Confirm ¶
func (self *CommitMessagePanelDriver) Confirm()
func (*CommitMessagePanelDriver) InitialText ¶
func (self *CommitMessagePanelDriver) InitialText(expected *Matcher) *CommitMessagePanelDriver
asserts on the text initially present in the prompt
func (*CommitMessagePanelDriver) Type ¶
func (self *CommitMessagePanelDriver) Type(value string) *CommitMessagePanelDriver
type Common ¶
type Common struct {
// contains filtered or unexported fields
}
for running common actions
func (*Common) AcknowledgeConflicts ¶
func (self *Common) AcknowledgeConflicts()
func (*Common) ConfirmDiscardLines ¶
func (self *Common) ConfirmDiscardLines()
func (*Common) ContinueMerge ¶
func (self *Common) ContinueMerge()
func (*Common) ContinueOnConflictsResolved ¶
func (self *Common) ContinueOnConflictsResolved()
func (*Common) ContinueRebase ¶
func (self *Common) ContinueRebase()
func (*Common) SelectPatchOption ¶
type ConfirmationDriver ¶
type ConfirmationDriver struct {
// contains filtered or unexported fields
}
func (*ConfirmationDriver) Cancel ¶
func (self *ConfirmationDriver) Cancel()
func (*ConfirmationDriver) Confirm ¶
func (self *ConfirmationDriver) Confirm()
func (*ConfirmationDriver) Content ¶
func (self *ConfirmationDriver) Content(expected *Matcher) *ConfirmationDriver
asserts that the confirmation view has the expected content
func (*ConfirmationDriver) Title ¶
func (self *ConfirmationDriver) Title(expected *Matcher) *ConfirmationDriver
asserts that the confirmation view has the expected title
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func (*FileSystem) FileContent ¶
func (self *FileSystem) FileContent(path string, matcher *Matcher)
Asserts that the file at the given path has the given content
func (*FileSystem) PathNotPresent ¶
func (self *FileSystem) PathNotPresent(path string)
This does _not_ check the files panel, it actually checks the filesystem
func (*FileSystem) PathPresent ¶
func (self *FileSystem) PathPresent(path string)
This does _not_ check the files panel, it actually checks the filesystem
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
func (*Git) CurrentBranchName ¶
type GitVersionRestriction ¶
type GitVersionRestriction struct {
// contains filtered or unexported fields
}
func Before ¶
func Before(version string) GitVersionRestriction
Verifies the version is before the given version (exclusive)
func From ¶
func From(version string) GitVersionRestriction
Verifies the version is at least the given version (inclusive)
func Includes ¶
func Includes(versions ...string) GitVersionRestriction
type IntegrationTest ¶
type IntegrationTest struct {
// contains filtered or unexported fields
}
func NewIntegrationTest ¶
func NewIntegrationTest(args NewIntegrationTestArgs) *IntegrationTest
func (*IntegrationTest) Description ¶
func (self *IntegrationTest) Description() string
func (*IntegrationTest) ExtraCmdArgs ¶
func (self *IntegrationTest) ExtraCmdArgs() string
func (*IntegrationTest) Name ¶
func (self *IntegrationTest) Name() string
func (*IntegrationTest) Run ¶
func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver)
func (*IntegrationTest) SetupConfig ¶
func (self *IntegrationTest) SetupConfig(config *config.AppConfig)
func (*IntegrationTest) SetupRepo ¶
func (self *IntegrationTest) SetupRepo(shell *Shell)
func (*IntegrationTest) ShouldRunForGitVersion ¶
func (self *IntegrationTest) ShouldRunForGitVersion(version *git_commands.GitVersion) bool
func (*IntegrationTest) Skip ¶
func (self *IntegrationTest) Skip() bool
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
for making assertions on string values
func Anything ¶
func Anything() *Matcher
this matcher has no rules meaning it always passes the test. Use this when you don't care what value you're dealing with.
func DoesNotContain ¶
func MatchesRegexp ¶
func (*Matcher) DoesNotContain ¶
func (*Matcher) IsSelected ¶
special rule that is only to be used in the TopLines and Lines methods, as a way of asserting that a given line is selected.
func (*Matcher) MatchesRegexp ¶
type MenuDriver ¶
type MenuDriver struct {
// contains filtered or unexported fields
}
func (*MenuDriver) Cancel ¶
func (self *MenuDriver) Cancel()
func (*MenuDriver) Confirm ¶
func (self *MenuDriver) Confirm()
func (*MenuDriver) Lines ¶
func (self *MenuDriver) Lines(matchers ...*Matcher) *MenuDriver
func (*MenuDriver) Select ¶
func (self *MenuDriver) Select(option *Matcher) *MenuDriver
func (*MenuDriver) Title ¶
func (self *MenuDriver) Title(expected *Matcher) *MenuDriver
asserts that the popup has the expected title
func (*MenuDriver) TopLines ¶
func (self *MenuDriver) TopLines(matchers ...*Matcher) *MenuDriver
type NewIntegrationTestArgs ¶
type NewIntegrationTestArgs struct {
// Briefly describes what happens in the test and what it's testing for
Description string
// prepares a repo for testing
SetupRepo func(shell *Shell)
// takes a config and mutates. The mutated context will end up being passed to the gui
SetupConfig func(config *config.AppConfig)
// runs the test
Run func(t *TestDriver, keys config.KeybindingConfig)
// additional args passed to lazyaws
ExtraCmdArgs string
// for when a test is flakey
Skip bool
// to run a test only on certain git versions
GitVersion GitVersionRestriction
}
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
convenience struct for easily getting directories within our test directory. We have one test directory for each test, found in test/results.
func (Paths) Actual ¶
when a test first runs, it's situated in a repo called 'repo' within this directory. In its setup step, the test is allowed to create other repos alongside the 'repo' repo in this directory, for example, creating remotes or repos to add as submodules.
func (Paths) ActualRepo ¶
this is the 'repo' directory within the 'actual' directory, where a lazyaws test will start within.
type Popup ¶
type Popup struct {
// contains filtered or unexported fields
}
func (*Popup) Alert ¶
func (self *Popup) Alert() *AlertDriver
func (*Popup) CommitMessagePanel ¶
func (self *Popup) CommitMessagePanel() *CommitMessagePanelDriver
func (*Popup) Confirmation ¶
func (self *Popup) Confirmation() *ConfirmationDriver
func (*Popup) Menu ¶
func (self *Popup) Menu() *MenuDriver
func (*Popup) Prompt ¶
func (self *Popup) Prompt() *PromptDriver
type PromptDriver ¶
type PromptDriver struct {
// contains filtered or unexported fields
}
func (*PromptDriver) Cancel ¶
func (self *PromptDriver) Cancel()
func (*PromptDriver) Clear ¶
func (self *PromptDriver) Clear() *PromptDriver
func (*PromptDriver) Confirm ¶
func (self *PromptDriver) Confirm()
func (*PromptDriver) ConfirmFirstSuggestion ¶
func (self *PromptDriver) ConfirmFirstSuggestion()
func (*PromptDriver) ConfirmSuggestion ¶
func (self *PromptDriver) ConfirmSuggestion(matcher *Matcher)
func (*PromptDriver) InitialText ¶
func (self *PromptDriver) InitialText(expected *Matcher) *PromptDriver
asserts on the text initially present in the prompt
func (*PromptDriver) SuggestionLines ¶
func (self *PromptDriver) SuggestionLines(matchers ...*Matcher) *PromptDriver
func (*PromptDriver) SuggestionTopLines ¶
func (self *PromptDriver) SuggestionTopLines(matchers ...*Matcher) *PromptDriver
func (*PromptDriver) Title ¶
func (self *PromptDriver) Title(expected *Matcher) *PromptDriver
asserts that the popup has the expected title
func (*PromptDriver) Type ¶
func (self *PromptDriver) Type(value string) *PromptDriver
type SearchDriver ¶
type SearchDriver struct {
// contains filtered or unexported fields
}
func (*SearchDriver) Cancel ¶
func (self *SearchDriver) Cancel()
func (*SearchDriver) Clear ¶
func (self *SearchDriver) Clear() *SearchDriver
func (*SearchDriver) Confirm ¶
func (self *SearchDriver) Confirm()
func (*SearchDriver) InitialText ¶
func (self *SearchDriver) InitialText(expected *Matcher) *SearchDriver
asserts on the text initially present in the prompt
func (*SearchDriver) Type ¶
func (self *SearchDriver) Type(value string) *SearchDriver
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
this is for running shell commands, mostly for the sake of setting up the repo but you can also run the commands from within lazyaws to emulate things happening in the background.
func (*Shell) CloneIntoRemote ¶
creates a clone of the repo in a sibling directory and adds the clone as a remote, then fetches it.
func (*Shell) CloneIntoSubmodule ¶
func (*Shell) ContinueMerge ¶
func (*Shell) CopyHelpFile ¶
Help files are located at test/files from the root the lazyaws repo. E.g. You may want to create a pre-commit hook file there, then call this function to copy it into your test repo.
func (*Shell) CreateAnnotatedTag ¶
func (*Shell) CreateFileAndAdd ¶
convenience method for creating a file and adding it
func (*Shell) CreateLightweightTag ¶
func (*Shell) CreateNCommits ¶
creates commits 01, 02, 03, ..., n with a new file in each The reason for padding with zeroes is so that it's easier to do string matches on the commit messages when there are many of them
func (*Shell) CreateNCommitsStartingAt ¶
func (*Shell) DeleteFile ¶
func (*Shell) DeleteFileAndAdd ¶
convenience method for deleting a file and adding it
func (*Shell) EmptyCommit ¶
func (*Shell) RemoveRemoteBranch ¶
func (*Shell) RunCommand ¶
func (*Shell) RunShellCommand ¶
func (*Shell) RunShellCommandExpectError ¶
func (*Shell) SetBranchUpstream ¶
e.g. branch: 'master', upstream: 'origin/master'
func (*Shell) StashWithMessage ¶
type TestDriver ¶
type TestDriver struct {
// contains filtered or unexported fields
}
func NewTestDriver ¶
func NewTestDriver(gui integrationTypes.GuiDriver, shell *Shell, keys config.KeybindingConfig, pushKeyDelay int) *TestDriver
func (*TestDriver) Common ¶
func (self *TestDriver) Common() *Common
func (*TestDriver) ExpectClipboard ¶
func (self *TestDriver) ExpectClipboard(matcher *Matcher)
func (*TestDriver) ExpectPopup ¶
func (self *TestDriver) ExpectPopup() *Popup
for interacting with popups
func (*TestDriver) ExpectSearch ¶
func (self *TestDriver) ExpectSearch() *SearchDriver
func (*TestDriver) ExpectToast ¶
func (self *TestDriver) ExpectToast(matcher *Matcher)
func (*TestDriver) Fail ¶
func (self *TestDriver) Fail(message string)
for when you just want to fail the test yourself. This runs callbacks to ensure we render the error after closing the gui.
func (*TestDriver) FileSystem ¶
func (self *TestDriver) FileSystem() *FileSystem
for making assertions on the file system
func (*TestDriver) Git ¶
func (self *TestDriver) Git() *Git
for making assertions through git itself
func (*TestDriver) GlobalPress ¶
func (self *TestDriver) GlobalPress(keyStr string)
Should only be used in specific cases where you're doing something weird! E.g. invoking a global keybinding from within a popup. You probably shouldn't use this function, and should instead go through a view like t.Views().Commit().Focus().Press(...)
func (*TestDriver) Log ¶
func (self *TestDriver) Log(message string)
func (*TestDriver) LogUI ¶
func (self *TestDriver) LogUI(message string)
func (*TestDriver) Shell ¶
func (self *TestDriver) Shell() *Shell
allows the user to run shell commands during the test to emulate background activity
func (*TestDriver) Views ¶
func (self *TestDriver) Views() *Views
for making assertions on lazyaws views
func (*TestDriver) Wait ¶
func (self *TestDriver) Wait(milliseconds int)
for when you want to allow lazyaws to process something before continuing
type ViewDriver ¶
type ViewDriver struct {
// contains filtered or unexported fields
}
func (*ViewDriver) ContainsLines ¶
func (self *ViewDriver) ContainsLines(matchers ...*Matcher) *ViewDriver
asserts that somewhere in the view there are consequetive lines matching the given matchers.
func (*ViewDriver) Content ¶
func (self *ViewDriver) Content(matcher *Matcher) *ViewDriver
asserts on the content of the view i.e. the stuff within the view's frame.
func (*ViewDriver) Focus ¶
func (self *ViewDriver) Focus() *ViewDriver
focus the view (assumes the view is a side-view)
func (*ViewDriver) IsEmpty ¶
func (self *ViewDriver) IsEmpty() *ViewDriver
returns true if the view is a list view and it contains no items
func (*ViewDriver) IsFocused ¶
func (self *ViewDriver) IsFocused() *ViewDriver
asserts that the view is focused
func (*ViewDriver) LineCount ¶
func (self *ViewDriver) LineCount(expectedCount int) *ViewDriver
func (*ViewDriver) Lines ¶
func (self *ViewDriver) Lines(matchers ...*Matcher) *ViewDriver
asserts that the view has lines matching the given matchers. One matcher must be passed for each line. If you only care about the top n lines, use the TopLines method instead. If you only care about a subset of lines, use the ContainsLines method instead.
func (*ViewDriver) NavigateToLine ¶
func (self *ViewDriver) NavigateToLine(matcher *Matcher) *ViewDriver
this will look for a list item in the current panel and if it finds it, it will enter the keypresses required to navigate to it. The test will fail if: - the user is not in a list item - no list item is found containing the given text - multiple list items are found containing the given text in the initial page of items
NOTE: this currently assumes that BufferLines returns all the lines that can be accessed. If this changes in future, we'll need to update this code to first attempt to find the item in the current page and failing that, jump to the top of the view and iterate through all of it, looking for the item.
func (*ViewDriver) Press ¶
func (self *ViewDriver) Press(keyStr string) *ViewDriver
func (*ViewDriver) PressEnter ¶
func (self *ViewDriver) PressEnter() *ViewDriver
i.e. pressing space
func (*ViewDriver) PressEscape ¶
func (self *ViewDriver) PressEscape() *ViewDriver
i.e. pressing escape
func (*ViewDriver) PressPrimaryAction ¶
func (self *ViewDriver) PressPrimaryAction() *ViewDriver
i.e. pressing space
func (*ViewDriver) SelectNextItem ¶
func (self *ViewDriver) SelectNextItem() *ViewDriver
i.e. pressing down arrow
func (*ViewDriver) SelectPreviousItem ¶
func (self *ViewDriver) SelectPreviousItem() *ViewDriver
i.e. pressing up arrow
func (*ViewDriver) SelectedLine ¶
func (self *ViewDriver) SelectedLine(matcher *Matcher) *ViewDriver
asserts on the selected line of the view. If your view has multiple lines selected, but also has a concept of a cursor position, this will assert on the line that the cursor is on. Otherwise it will assert on the first line of the selection.
func (*ViewDriver) SelectedLineIdx ¶
func (self *ViewDriver) SelectedLineIdx(expected int) *ViewDriver
asserts on the index of the selected line. 0 is the first index, representing the line at the top of the view.
func (*ViewDriver) SelectedLines ¶
func (self *ViewDriver) SelectedLines(matchers ...*Matcher) *ViewDriver
asserts on the lines that are selected in the view. Don't use the `IsSelected` matcher with this because it's redundant.
func (*ViewDriver) Self ¶
func (self *ViewDriver) Self() *ViewDriver
This purely exists as a convenience method for those who hate the trailing periods in multi-line method chains
func (*ViewDriver) Tap ¶
func (self *ViewDriver) Tap(f func()) *ViewDriver
for when you want to make some assertion unrelated to the current view without breaking the method chain
func (*ViewDriver) Title ¶
func (self *ViewDriver) Title(expected *Matcher) *ViewDriver
asserts that the view has the expected title
func (*ViewDriver) TopLines ¶
func (self *ViewDriver) TopLines(matchers ...*Matcher) *ViewDriver
asserts that the view has lines matching the given matchers. So if three matchers are passed, we only check the first three lines of the view. This method is convenient when you have a list of commits but you only want to assert on the first couple of commits.
type Views ¶
type Views struct {
// contains filtered or unexported fields
}
func (*Views) AppStatus ¶
func (self *Views) AppStatus() *ViewDriver
func (*Views) Branches ¶
func (self *Views) Branches() *ViewDriver
func (*Views) CommitFiles ¶
func (self *Views) CommitFiles() *ViewDriver
func (*Views) CommitMessage ¶
func (self *Views) CommitMessage() *ViewDriver
func (*Views) Commits ¶
func (self *Views) Commits() *ViewDriver
func (*Views) Confirmation ¶
func (self *Views) Confirmation() *ViewDriver
func (*Views) Files ¶
func (self *Views) Files() *ViewDriver
func (*Views) Information ¶
func (self *Views) Information() *ViewDriver
func (*Views) Main ¶
func (self *Views) Main() *ViewDriver
func (*Views) Menu ¶
func (self *Views) Menu() *ViewDriver
func (*Views) MergeConflicts ¶
func (self *Views) MergeConflicts() *ViewDriver
func (*Views) PatchBuilding ¶
func (self *Views) PatchBuilding() *ViewDriver
func (*Views) PatchBuildingSecondary ¶
func (self *Views) PatchBuildingSecondary() *ViewDriver
func (*Views) ReflogCommits ¶
func (self *Views) ReflogCommits() *ViewDriver
func (*Views) RemoteBranches ¶
func (self *Views) RemoteBranches() *ViewDriver
func (*Views) Remotes ¶
func (self *Views) Remotes() *ViewDriver
func (*Views) Search ¶
func (self *Views) Search() *ViewDriver
func (*Views) Secondary ¶
func (self *Views) Secondary() *ViewDriver
func (*Views) Staging ¶
func (self *Views) Staging() *ViewDriver
func (*Views) StagingSecondary ¶
func (self *Views) StagingSecondary() *ViewDriver
func (*Views) Stash ¶
func (self *Views) Stash() *ViewDriver
func (*Views) Status ¶
func (self *Views) Status() *ViewDriver
func (*Views) SubCommits ¶
func (self *Views) SubCommits() *ViewDriver
func (*Views) Submodules ¶
func (self *Views) Submodules() *ViewDriver
func (*Views) Suggestions ¶
func (self *Views) Suggestions() *ViewDriver
func (*Views) Tags ¶
func (self *Views) Tags() *ViewDriver