AssertRenderScreen is the same as [Body.AssertRender] except that it asserts the rendered image of the entire screen, not just this body. It should be used for multi-scene tests like those of snackbars and dialogs.
(t imagex.TestingT, filename string, fun ...func())
| 40 | // rendered image of the entire screen, not just this body. It should be used for |
| 41 | // multi-scene tests like those of snackbars and dialogs. |
| 42 | func (b *Body) AssertRenderScreen(t imagex.TestingT, filename string, fun ...func()) { |
| 43 | b.runAndShowNewWindow() |
| 44 | for i := 0; i < len(fun); i++ { |
| 45 | fun[i]() |
| 46 | b.waitNoEvents() |
| 47 | } |
| 48 | if len(fun) == 0 { |
| 49 | // we didn't get it above |
| 50 | b.waitNoEvents() |
| 51 | } |
| 52 | |
| 53 | system.AssertCapture(t, filename) |
| 54 | b.Close() |
| 55 | } |
| 56 | |
| 57 | // runAndShowNewWindow runs a new window and waits for it to be shown. |
| 58 | func (b *Body) runAndShowNewWindow() { |