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.2'

Class Method Summary collapse

Class Method Details

.around_hook_impl(scenario, block) ⇒ Object



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/browserstack/browserstack.rb', line 209

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



end

.at_exit_implObject



245
246
247
248
249
# File 'lib/browserstack/browserstack.rb', line 245

def at_exit_impl
  ::BrowserStackCucumber::Config.close_browser_force
  #do global shutdown (i.e. tunnel)
  #check for global errors
end

.before_hook_implObject



202
203
204
205
206
# File 'lib/browserstack/browserstack.rb', line 202

def before_hook_impl
  #::Capybara.default_driver = :browser_stack
  #::Capybara.current_driver = :browser_stack
  @browser = BrowserStackCucumber::Config.browser
end