One feature people don't realize is that Robot can actually be quite speedy. Opening and closing a browser window is very slow, on the order of 1-2 seconds. Depending on the application, this can be done once, saving 1-2 seconds for *every* test! For my Very Important Cat Voting Booth, this is the case.
Here's the magic bit:
*** Settings ***
Resource resource.robot
Test Setup Reset Votes
Suite Setup Open Browser To Voting Page
Suite Teardown Close All Browsers
*** Test Cases ***
Valid Page
Votes Not Available
Register Up Vote
Vote Up
Element Text Should Be vote-count-up 1
Element Text Should Be vote-count-down 0
I can run four (admittedly modest) browser-level tests, in a full real browser, in four seconds! This includes going back and forth to my Flask-SocketIO server, interacting with Redis, and other things. I'm quite happy with this result.
As a heavy Test Driven Development (TDD) guy, with the above speed I can do full browser-level tests as TDD! I don't have to wait until I absolutely *have* to run UI tests, they can be fast enough for running many times an hour, to give me very fast development feedback.
Full source code here: https://github.com/johntellsall/aws-realtime-metrics
No comments:
Post a Comment