Skip to content

Instantly share code, notes, and snippets.

@ndmanvar
Last active December 1, 2016 01:27
Show Gist options
  • Save ndmanvar/03200763c2cd58fb9669884dea9aed3d to your computer and use it in GitHub Desktop.
Save ndmanvar/03200763c2cd58fb9669884dea9aed3d to your computer and use it in GitHub Desktop.
before(:each) do | test |
browser = Selenium::WebDriver.for(:remote, :url => 'https://ondemand.saucelabs.com:443/wd/hub', { :browserName => 'chrome' })
end
it 'this is my test' do
browser.get('http://www.yahoo.com')
browser.element(:id => 'abc').click()
assertTrue(browser.element('def').visible?)
end
after(:each) do | test |
sessionid = @browser.session_id
browser.quit()
insight_result = SauceInsights.get(test.name, sessionid, {
:didTotalXHRsIncrease => true,
:maxXHRResponseTime => '500ms',
:hasJSConsoleError => true
})
result = !!test.exception && insight_result
SauceRest.update_job(ssesionid, result)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment