| 177 | } |
| 178 | |
| 179 | func (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 | |
| 214 | func (self *IntegrationTest) HeadlessDimensions() (int, int) { |
| 215 | if self.width == 0 && self.height == 0 { |