Module: BrowserCrawler::DSL::SignIn

Included in:
Engine
Defined in:
lib/browser_crawler/dsl/sign_in.rb

Instance Method Summary collapse

Instance Method Details

#o365_login(force: true) ⇒ Object



17
18
19
20
21
22
# File 'lib/browser_crawler/dsl/sign_in.rb', line 17

def (force: true)
  if force || page.has_content?('Stay signed in?')
    check 'DontShowAgain'
    click_on 'Yes'
  end
end

#o365_stay_signed_in(force: true) ⇒ Object



24
25
26
27
28
29
# File 'lib/browser_crawler/dsl/sign_in.rb', line 24

def o365_stay_signed_in(force: true)
  if force || page.has_content?('Stay signed in?')
    check 'DontShowAgain'
    click_on 'Yes'
  end
end

#pingfed_login(force: true) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/browser_crawler/dsl/sign_in.rb', line 9

def (force: true)
  if force || page.has_content?('Enter your credentials')
    fill_in 'input_username', with: ENV.fetch('username')
    fill_in 'input_password', with: ENV.fetch('password')
    click_on 'Login'
  end
end

#pingfed_o365_login(force: true) ⇒ Object



31
32
33
34
# File 'lib/browser_crawler/dsl/sign_in.rb', line 31

def (force: true)
  (force: force)
  o365_stay_signed_in(force: force)
end

#sign_inObject



4
5
6
7
# File 'lib/browser_crawler/dsl/sign_in.rb', line 4

def 
  visit '/'
  
end