Add state checks to test/saucelabs.js.