Module: BrowserStackCucumber

Defined in:
lib/browserstack/version.rb,
lib/browserstack/wait_until.rb,
lib/browserstack/with_rescue.rb,
lib/browserstack/browserstack.rb

Defined Under Namespace

Modules: RetryHelper, WaitUntil Classes: Config

Constant Summary collapse

VERSION =
'0.1.1'

Class Method Summary collapse

Class Method Details

.around_hook_impl(scenario, block) ⇒ Object



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/browserstack/browserstack.rb', line 183

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



219
220
221
222
223
# File 'lib/browserstack/browserstack.rb', line 219

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

.before_hook_implObject



176
177
178
179
180
# File 'lib/browserstack/browserstack.rb', line 176

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