diff options
-rw-r--r-- | test/netsurf/monkey-test-plans.mdwn | 273 |
1 files changed, 131 insertions, 142 deletions
diff --git a/test/netsurf/monkey-test-plans.mdwn b/test/netsurf/monkey-test-plans.mdwn index 7c54c76..7fef22e 100644 --- a/test/netsurf/monkey-test-plans.mdwn +++ b/test/netsurf/monkey-test-plans.mdwn @@ -55,163 +55,152 @@ Examples A test will fail if NetSurf exits with a non-zero return code. -[[!format yaml """ -title: start and stop browser -group: basic -steps: -- action: launch -- action: quit -"""]] + title: start and stop browser + group: basic + steps: + - action: launch + - action: quit There are `launch` and `quit` actions. -[[!format yaml """ -title: start and stop browser without JS -group: basic -steps: -- action: launch - args: - - enable_javascript=0 -- action: quit -"""]] + title: start and stop browser without JS + group: basic + steps: + - action: launch + args: + - enable_javascript=0 + - action: quit Use actions to get the browser to do things. -[[!format yaml """ -title: resource scheme -group: basic -steps: -- action: launch - language: en -- action: window-new - tag: win1 -- action: navigate - window: win1 - url: resource:does-not-exist -- action: block - conditions: - - window: win1 - status: complete -- action: plot-check - - text-contains: Not found - - text-contains: Error 404 -- action: navigate - window: win1 - url: resource:netsurf.png -- action: block - conditions: - - window: win1 - status: complete -- action: plot-check - - bitmap-count: 1 -- action: window-close - - window: win1 -- action: quit -"""]] + title: resource scheme + group: basic + steps: + - action: launch + language: en + - action: window-new + tag: win1 + - action: navigate + window: win1 + url: resource:does-not-exist + - action: block + conditions: + - window: win1 + status: complete + - action: plot-check + - text-contains: Not found + - text-contains: Error 404 + - action: navigate + window: win1 + url: resource:netsurf.png + - action: block + conditions: + - window: win1 + status: complete + - action: plot-check + - bitmap-count: 1 + - action: window-close + - window: win1 + - action: quit + Can make multiple windows fetch stuff at the same time, without block actions. -[[!format yaml """ -title: simultanious page fetches -group: real-world -steps: -- action: launch - language: en -- action: window-new - tag: win1 -- action: window-new - tag: win2 -- action: window-new - tag: win3 -- action: window-new - tag: win4 -- action: navigate - window: win1 - url: http://www.bbc.co.uk/news -- action: navigate - window: win2 - url: http://www.amazon.co.uk/ -- action: navigate - window: win3 - url: http://www.theregister.co.uk/ -- action: navigate - window: win4 - url: http://www.arstechnica.co.uk/ -- action: block - conditions: - - window: *all* - status: complete -- action: window-close - window: win1 -- action: window-close - window: win2 -- action: quit -"""]] + title: simultanious page fetches + group: real-world + steps: + - action: launch + language: en + - action: window-new + tag: win1 + - action: window-new + tag: win2 + - action: window-new + tag: win3 + - action: window-new + tag: win4 + - action: navigate + window: win1 + url: http://www.bbc.co.uk/news + - action: navigate + window: win2 + url: http://www.amazon.co.uk/ + - action: navigate + window: win3 + url: http://www.theregister.co.uk/ + - action: navigate + window: win4 + url: http://www.arstechnica.co.uk/ + - action: block + conditions: + - window: *all* + status: complete + - action: window-close + window: win1 + - action: window-close + window: win2 + - action: quit Can quit during navigate, to check cleanup in intermediate states. Note: this requires the test to run multiple times. -[[!format yaml """ -title: quitting mid-fetch -group: cleanup -steps: -- action: repeat - min: 0 - step: 50 - name: sleepytimer - actions: - - action: launch - - action: window-new - tag: win1 - - action: navigate - window: win1 - url: http://www.bbc.co.uk/news - - action: sleep-ms - time: sleepytimer - conditions: - - window: win1 - status: complete - breaks: sleepytimer - - action: quit -"""]] + title: quitting mid-fetch + group: cleanup + steps: + - action: repeat + min: 0 + step: 50 + name: sleepytimer + actions: + - action: launch + - action: window-new + tag: win1 + - action: navigate + window: win1 + url: http://www.bbc.co.uk/news + - action: sleep-ms + time: sleepytimer + conditions: + - window: win1 + status: complete + breaks: sleepytimer + - action: quit Can start and stop timers. -[[!format yaml """ -title: cache test -group: performance -steps: -- action: launch - language: en -- action: timer-start - tag: timer1 -- action: window-new - tag: win1 -- action: navigate - window: win1 - url: http://www.bbc.co.uk/news -- action: block - conditions: - - window: win1 - status: complete -- action: timer-stop - timer: timer1 -- action: timer-start - tag: timer2 -- action: window-new - tag: win2 -- action: navigate - window: win2 - url: http://www.bbc.co.uk/news -- action: block - conditions: - - window: win2 - status: complete -- action: timer-stop - timer: timer2 -- action: timer-check - condition: timer2 < timer1 -- action: quit -"""]] + title: cache test + group: performance + steps: + - action: launch + language: en + - action: timer-start + tag: timer1 + - action: window-new + tag: win1 + - action: navigate + window: win1 + url: http://www.bbc.co.uk/news + - action: block + conditions: + - window: win1 + status: complete + - action: timer-stop + timer: timer1 + - action: timer-start + tag: timer2 + - action: window-new + tag: win2 + - action: navigate + window: win2 + url: http://www.bbc.co.uk/news + - action: block + conditions: + - window: win2 + status: complete + - action: timer-stop + timer: timer2 + - action: timer-check + condition: timer2 < timer1 + - action: quit |