From 53e06b71aecd2ddaf80516627ba223ac2adc5420 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 27 Dec 2022 21:25:11 +1100 Subject: add tap function --- pkg/integration/tests/cherry_pick/cherry_pick.go | 43 ++++++++++------------ .../tests/cherry_pick/cherry_pick_conflicts.go | 39 ++++++++++---------- 2 files changed, 39 insertions(+), 43 deletions(-) (limited to 'pkg/integration/tests/cherry_pick') diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go index 75c060b34..de9e0a645 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick.go @@ -42,11 +42,10 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Contains("base"), ). // copy commits 'four' and 'three' - Press(keys.Commits.CherryPickCopy) - - input.Views().Information().Content(Contains("1 commit copied")) - - input.Views().SubCommits(). + Press(keys.Commits.CherryPickCopy). + Tap(func() { + input.Views().Information().Content(Contains("1 commit copied")) + }). SelectNextItem(). Press(keys.Commits.CherryPickCopy) @@ -59,29 +58,27 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Contains("one"), Contains("base"), ). - Press(keys.Commits.PasteCommits) - - input.ExpectAlert(). - Title(Equals("Cherry-Pick")). - Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")). - Confirm() - - input.Views().Commits(). - IsFocused(). + Press(keys.Commits.PasteCommits). + Tap(func() { + input.ExpectAlert(). + Title(Equals("Cherry-Pick")). + Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")). + Confirm() + }). Lines( Contains("four"), Contains("three"), Contains("two"), Contains("one"), Contains("base"), - ) - - // we need to manually exit out of cherrry pick mode - input.Views().Information().Content(Contains("2 commits copied")) - - input.Views().Commits(). - PressEscape() - - input.Views().Information().Content(DoesNotContain("commits copied")) + ). + Tap(func() { + // we need to manually exit out of cherry pick mode + input.Views().Information().Content(Contains("2 commits copied")) + }). + PressEscape(). + Tap(func() { + input.Views().Information().Content(DoesNotContain("commits copied")) + }) }, }) diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go index 9b97be5db..9c02cc8d0 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go @@ -31,11 +31,10 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ Contains("second-change-branch unrelated change"), Contains("second change"), ). - Press(keys.Commits.CherryPickCopy) - - input.Views().Information().Content(Contains("1 commit copied")) - - input.Views().SubCommits(). + Press(keys.Commits.CherryPickCopy). + Tap(func() { + input.Views().Information().Content(Contains("1 commit copied")) + }). SelectNextItem(). Press(keys.Commits.CherryPickCopy) @@ -80,20 +79,20 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{ Contains("second change"), Contains("first change"), ). - SelectNextItem() - - // because we picked 'Second change' when resolving the conflict, - // we now see this commit as having replaced First Change with Second Change, - // as opposed to replacing 'Original' with 'Second change' - input.Views().Main(). - Content(Contains("-First Change")). - Content(Contains("+Second Change")) - - input.Views().Information().Content(Contains("2 commits copied")) - - input.Views().Commits(). - PressEscape() - - input.Views().Information().Content(DoesNotContain("commits copied")) + SelectNextItem(). + Tap(func() { + // because we picked 'Second change' when resolving the conflict, + // we now see this commit as having replaced First Change with Second Change, + // as opposed to replacing 'Original' with 'Second change' + input.Views().Main(). + Content(Contains("-First Change")). + Content(Contains("+Second Change")) + + input.Views().Information().Content(Contains("2 commits copied")) + }). + PressEscape(). + Tap(func() { + input.Views().Information().Content(DoesNotContain("commits copied")) + }) }, }) -- cgit v1.2.3