Class: Selenium::WebDriver::VirtualAuthenticator

Inherits:
Object
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bridge, authenticator_id, options) ⇒ VirtualAuthenticator

api private Use ‘Driver#add_virtual_authenticator`



30
31
32
33
34
35
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 30

def initialize(bridge, authenticator_id, options)
  @id = authenticator_id
  @bridge = bridge
  @options = options
  @valid = true
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



23
24
25
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 23

def options
  @options
end

Instance Method Details

#add_credential(credential) ⇒ Object



37
38
39
40
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 37

def add_credential(credential)
  credential = credential.as_json
  @bridge.add_credential credential, @id
end

#credentialsObject



42
43
44
45
46
47
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 42

def credentials
  credential_data = @bridge.credentials @id
  credential_data.map do |cred|
    Credential.from_json(cred)
  end
end

#remove!Object



62
63
64
65
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 62

def remove!
  @bridge.remove_virtual_authenticator(@id)
  @valid = false
end

#remove_all_credentialsObject



54
55
56
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 54

def remove_all_credentials
  @bridge.remove_all_credentials @id
end

#remove_credential(credential_id) ⇒ Object



49
50
51
52
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 49

def remove_credential(credential_id)
  credential_id = Credential.encode(credential_id) if credential_id.instance_of?(Array)
  @bridge.remove_credential credential_id, @id
end

#user_verified=(verified) ⇒ Object



58
59
60
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 58

def user_verified=(verified)
  @bridge.user_verified verified, @id
end

#valid?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 67

def valid?
  @valid
end