diff --git a/pkg/integration/components/actions.go b/pkg/integration/components/actions.go new file mode 100644 index 000000000..8489a52f8 --- /dev/null +++ b/pkg/integration/components/actions.go @@ -0,0 +1,19 @@ +package components + +// for running common actions +type Actions struct { + t *TestDriver +} + +func (self *Actions) ContinueMerge() { + self.t.Views().current().Press(self.t.keys.Universal.CreateRebaseOptionsMenu) + + self.t.ExpectMenu(). + Title(Equals("Rebase Options")). + Select(Contains("continue")). + Confirm() +} + +func (self *Actions) ContinueRebase() { + self.ContinueMerge() +} diff --git a/pkg/integration/components/test_driver.go b/pkg/integration/components/test_driver.go index dc6fd421f..d4ca76662 100644 --- a/pkg/integration/components/test_driver.go +++ b/pkg/integration/components/test_driver.go @@ -42,17 +42,8 @@ func (self *TestDriver) typeContent(content string) { } } -func (self *TestDriver) ContinueMerge() { - self.Views().current().Press(self.keys.Universal.CreateRebaseOptionsMenu) - - self.ExpectMenu(). - Title(Equals("Rebase Options")). - Select(Contains("continue")). - Confirm() -} - -func (self *TestDriver) ContinueRebase() { - self.ContinueMerge() +func (self *TestDriver) Actions() *Actions { + return &Actions{t: self} } // for when you want to allow lazygit to process something before continuing diff --git a/pkg/integration/tests/interactive_rebase/one.go b/pkg/integration/tests/interactive_rebase/one.go index fdfc2db52..d6d01239a 100644 --- a/pkg/integration/tests/interactive_rebase/one.go +++ b/pkg/integration/tests/interactive_rebase/one.go @@ -61,7 +61,7 @@ var One = NewIntegrationTest(NewIntegrationTestArgs{ Contains("commit 01"), ). Tap(func() { - t.ContinueRebase() + t.Actions().ContinueRebase() }). Lines( Contains("commit 02"),