MCPcopy
hub / github.com/jesseduffield/lazygit / Run

Method Run

pkg/integration/components/test.go:179–212  ·  view source on GitHub ↗
(gui integrationTypes.GuiDriver)

Source from the content-addressed store, hash-verified

177}
178
179func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver) {
180 pwd, err := os.Getwd()
181 if err != nil {
182 panic(err)
183 }
184
185 shell := NewShell(
186 pwd,
187 // passing the full environment because it's already been filtered down
188 // in the parent process.
189 os.Environ(),
190 func(errorMsg string) { gui.Fail(errorMsg) },
191 )
192 keys := gui.Keys()
193 testDriver := NewTestDriver(gui, shell, keys, InputDelay())
194
195 if InputDelay() > 0 {
196 // Setting caption to clear the options menu from whatever it starts with
197 testDriver.SetCaption("")
198 testDriver.SetCaptionPrefix("")
199 }
200
201 self.run(testDriver, keys)
202
203 gui.CheckAllToastsAcknowledged()
204
205 if InputDelay() > 0 {
206 // Clear whatever caption there was so it doesn't linger
207 testDriver.SetCaption("")
208 testDriver.SetCaptionPrefix("")
209 // the dev would want to see the final state if they're running in slow mode
210 testDriver.Wait(2000)
211 }
212}
213
214func (self *IntegrationTest) HeadlessDimensions() (int, int) {
215 if self.width == 0 && self.height == 0 {

Callers 2

TestManualFailureFunction · 0.95
TestSuccessFunction · 0.95

Implementers 1

IntegrationTestpkg/integration/components/test.go

Calls 10

SetCaptionMethod · 0.95
SetCaptionPrefixMethod · 0.95
WaitMethod · 0.95
NewShellFunction · 0.85
NewTestDriverFunction · 0.85
InputDelayFunction · 0.85
FailMethod · 0.65
KeysMethod · 0.65
runMethod · 0.65

Tested by 2

TestManualFailureFunction · 0.76
TestSuccessFunction · 0.76