Getting the test result so it can be passed on the SauceLabs

22 views
Skip to first unread message

goncalo.s...@gmail.com

unread,
Mar 29, 2017, 9:49:01 AM3/29/17
to Geb User Mailing List
Hello,

I am using GEB with Spock and SauceLabs.

Is there any way where I can get the test result of a test ran on SauceLabs and the job ID, so that I can via the SauceREST API mark the job as passed or failed?

Thank you in advance,
Best Regards,
Goncalo

Marcin Erdmann

unread,
Apr 2, 2017, 3:28:15 AM4/2/17
to Geb User Mailing List
As far as I understand,  SauceLabs job ID is the same as webdriver session id. You can obtain an instance of WebDriver from Browser.getDriver(), and in case of driving a browser in SauceLabs it will be an instance of RemoteWebDriver which has a getSessionId() method.

With regards to detecting test results you will need to probably write a global Spock extension which registers a org.spockframework.runtime.IRunListener with appropriate implementations of afterFeature(FeatureInfo) and error(ErrorInfo) and potentially afterIteration(IterationInfo) as well.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/d0842969-8bb0-4a99-b169-71af02e3ca53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages