summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/cherry_pick
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-24 17:48:57 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-24 19:15:59 +1100
commitb623ecf898e1ac35b0a6093978203a7b5c13c42e (patch)
tree670c2ecdc78e84fbb6dc9988195a6f3a991df217 /pkg/integration/tests/cherry_pick
parentaedfce28459bc59865b516dba2ee480a5d0972f1 (diff)
add helper functions for popups in tests
Diffstat (limited to 'pkg/integration/tests/cherry_pick')
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick.go12
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go22
2 files changed, 13 insertions, 21 deletions
diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go
index 7cbf6a70a..444cf35e4 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick.go
@@ -35,23 +35,21 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
assert.CurrentViewName("subCommits")
assert.SelectedLine(Contains("four"))
- input.PressKeys(keys.Commits.CherryPickCopy)
+ input.Press(keys.Commits.CherryPickCopy)
assert.ViewContent("information", Contains("1 commit copied"))
input.NextItem()
assert.SelectedLine(Contains("three"))
- input.PressKeys(keys.Commits.CherryPickCopy)
+ input.Press(keys.Commits.CherryPickCopy)
assert.ViewContent("information", Contains("2 commits copied"))
input.SwitchToCommitsWindow()
assert.CurrentViewName("commits")
assert.SelectedLine(Contains("two"))
- input.PressKeys(keys.Commits.PasteCommits)
- assert.InAlert()
- assert.CurrentViewContent(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?"))
+ input.Press(keys.Commits.PasteCommits)
+ input.Alert(Equals("Cherry-Pick"), Contains("Are you sure you want to cherry-pick the copied commits onto this branch?"))
- input.Confirm()
assert.CurrentViewName("commits")
assert.SelectedLine(Contains("four"))
input.NextItem()
@@ -60,7 +58,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
assert.SelectedLine(Contains("two"))
assert.ViewContent("information", Contains("2 commits copied"))
- input.PressKeys(keys.Universal.Return)
+ input.Press(keys.Universal.Return)
assert.ViewContent("information", NotContains("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 99005ad8e..377e21e76 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
@@ -26,42 +26,36 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
assert.CurrentViewName("subCommits")
assert.SelectedLine(Contains("second-change-branch unrelated change"))
- input.PressKeys(keys.Commits.CherryPickCopy)
+ input.Press(keys.Commits.CherryPickCopy)
assert.ViewContent("information", Contains("1 commit copied"))
input.NextItem()
assert.SelectedLine(Contains("second change"))
- input.PressKeys(keys.Commits.CherryPickCopy)
+ input.Press(keys.Commits.CherryPickCopy)
assert.ViewContent("information", Contains("2 commits copied"))
input.SwitchToCommitsWindow()
assert.CurrentViewName("commits")
assert.SelectedLine(Contains("first change"))
- input.PressKeys(keys.Commits.PasteCommits)
- assert.InAlert()
- assert.CurrentViewContent(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?"))
+ input.Press(keys.Commits.PasteCommits)
+ input.Alert(Equals("Cherry-Pick"), Contains("Are you sure you want to cherry-pick the copied commits onto this branch?"))
- input.Confirm()
-
- assert.CurrentViewContent(Contains("Conflicts!"))
- input.Confirm()
+ input.AcceptConfirmation(Equals("Auto-merge failed"), Contains("Conflicts!"))
assert.CurrentViewName("files")
assert.SelectedLine(Contains("file"))
// not using Confirm() convenience method because I suspect we might change this
// keybinding to something more bespoke
- input.PressKeys(keys.Universal.Confirm)
+ input.Press(keys.Universal.Confirm)
assert.CurrentViewName("mergeConflicts")
// picking 'Second change'
input.NextItem()
input.PrimaryAction()
- assert.InConfirm()
- assert.CurrentViewContent(Contains("all merge conflicts resolved. Continue?"))
- input.Confirm()
+ input.AcceptConfirmation(Equals("continue"), Contains("all merge conflicts resolved. Continue?"))
assert.CurrentViewName("files")
assert.WorkingTreeFileCount(0)
@@ -81,7 +75,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
assert.SelectedLine(Contains("first change"))
assert.ViewContent("information", Contains("2 commits copied"))
- input.PressKeys(keys.Universal.Return)
+ input.Press(keys.Universal.Return)
assert.ViewContent("information", NotContains("commits copied"))
},
})