Class: Playwright::TimeoutSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/playwright/timeout_settings.rb

Constant Summary collapse

DEFAULT_TIMEOUT =
30000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ TimeoutSettings

Returns a new instance of TimeoutSettings.



5
6
7
# File 'lib/playwright/timeout_settings.rb', line 5

def initialize(parent = nil)
  @parent = parent
end

Instance Attribute Details

#default_navigation_timeout=(value) ⇒ Object (writeonly)

Sets the attribute default_navigation_timeout

Parameters:

  • value

    the value to set the attribute default_navigation_timeout to.



9
10
11
# File 'lib/playwright/timeout_settings.rb', line 9

def default_navigation_timeout=(value)
  @default_navigation_timeout = value
end

#default_timeout=(value) ⇒ Object (writeonly)

Sets the attribute default_timeout

Parameters:

  • value

    the value to set the attribute default_timeout to.



9
10
11
# File 'lib/playwright/timeout_settings.rb', line 9

def default_timeout=(value)
  @default_timeout = value
end

Instance Method Details



11
12
13
# File 'lib/playwright/timeout_settings.rb', line 11

def navigation_timeout
  @default_navigation_timeout || @default_timeout || @parent&.navigation_timeout || DEFAULT_TIMEOUT
end

#timeoutObject



15
16
17
# File 'lib/playwright/timeout_settings.rb', line 15

def timeout
  @default_timeout || @parent&.timeout || DEFAULT_TIMEOUT
end