Module: BrowserStackCucumber
- Defined in:
- lib/browserstack/version.rb,
lib/browserstack/wait_until.rb,
lib/browserstack/with_rescue.rb,
lib/browserstack/browserstack.rb,
lib/browserstack/jenkins_formatter.rb
Defined Under Namespace
Modules: RetryHelper, WaitUntil Classes: Config, JenkinsFormatter
Constant Summary collapse
- VERSION =
'0.3'
Class Method Summary collapse
Class Method Details
.around_hook_impl(scenario, block) ⇒ Object
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/browserstack/browserstack.rb', line 226 def around_hook_impl(scenario, block) #::Capybara.current_driver = :browser_stack #set additional job details here (project, build, name etc) #init selenium session #driver = ::Capybara.current_session.driver #noinspection RubyUnusedLocalVariable my_browser = BrowserStackCucumber::Config.init_browser(scenario) #set sessions details for BrowserStack here #Job = ... # This allow us to execute steps (n) times unless scenario.instance_of? ::Cucumber::Ast::OutlineTable::ExampleRow scenario.steps.each do |step| step.instance_variable_set(:@skip_invoke, false) end end block.call # Quit the driver to allow for the generation of a new session_id BrowserStackCucumber::Config.close_browser #report job status to BrowserStack #unless job.nil? # job.passed = !scenario.failed? # job.save #end BrowserStackCucumber::Config.update_session_status(!scenario.failed?) end |
.at_exit_impl ⇒ Object
263 264 265 266 267 |
# File 'lib/browserstack/browserstack.rb', line 263 def at_exit_impl ::BrowserStackCucumber::Config.close_browser_force #do global shutdown (i.e. tunnel) #check for global errors end |
.before_hook_impl ⇒ Object
218 219 220 221 222 |
# File 'lib/browserstack/browserstack.rb', line 218 def before_hook_impl #::Capybara.default_driver = :browser_stack #::Capybara.current_driver = :browser_stack @browser = BrowserStackCucumber::Config.browser end |