summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui_driver.go
diff options
context:
space:
mode:
authorSimon Whitaker <sw@netcetera.org>2023-08-06 14:55:14 +0100
committerSimon Whitaker <sw@netcetera.org>2023-08-07 15:10:28 +0100
commited1547e0cb60d9234fe901f8b3330fbae2e1fd87 (patch)
treee6e9a7459d817609cd10222b64e70fa61f837c32 /pkg/gui/gui_driver.go
parent579791e7bc8261e9ed578f882f4b8b11a486bf78 (diff)
Add a Click() primitive to the integration test library
Diffstat (limited to 'pkg/gui/gui_driver.go')
-rw-r--r--pkg/gui/gui_driver.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/gui/gui_driver.go b/pkg/gui/gui_driver.go
index 6d859eddb..7fd51c952 100644
--- a/pkg/gui/gui_driver.go
+++ b/pkg/gui/gui_driver.go
@@ -45,6 +45,14 @@ func (self *GuiDriver) PressKey(keyStr string) {
self.waitTillIdle()
}
+func (self *GuiDriver) Click(x, y int) {
+ self.gui.g.ReplayedEvents.MouseEvents <- gocui.NewTcellMouseEventWrapper(
+ tcell.NewEventMouse(x, y, tcell.ButtonPrimary, 0),
+ 0,
+ )
+ self.waitTillIdle()
+}
+
// wait until lazygit is idle (i.e. all processing is done) before continuing
func (self *GuiDriver) waitTillIdle() {
<-self.isIdleChan