WebDriver/src/WebDriver/WDTimeouts.class.st

71 lines
1.4 KiB
Smalltalk

"
I am a helper class to define WebDriver timeouts.
The following timeouts are defined:
* `script:` defaults to 30'000, specifies when to interrupt a script that is being evaluated. A `nil` value implies that scripts should never be interrupted, but instead run indefinitely.
* `pageLoad:` defaults to 300'000, provides the timeout limit used to interrupt an explicit navigation attempt.
* `implicit:` defaults to 0, specifies a time to wait for the element location strategy to complete when locating an element.
"
Class {
#name : #WDTimeouts,
#superclass : #Object,
#instVars : [
'timeouts'
],
#category : #'WebDriver-Base'
}
{ #category : #accessing }
WDTimeouts >> extract [
^ timeouts
]
{ #category : #accessing }
WDTimeouts >> implicit [
^ timeouts at: #implicit
]
{ #category : #accessing }
WDTimeouts >> implicit: anObject [
timeouts at: #implicit put: anObject
]
{ #category : #initialization }
WDTimeouts >> initialize [
| dict |
dict := Dictionary new.
dict
at: #script put: 30000;
at: #pageLoad put: 300000;
at: #implicit put: 0.
timeouts := dict.
]
{ #category : #accessing }
WDTimeouts >> pageLoad [
^ timeouts at: #pageLoad.
]
{ #category : #accessing }
WDTimeouts >> pageLoad: anObject [
timeouts at: #pageLoad put: anObject
]
{ #category : #accessing }
WDTimeouts >> script [
^ timeouts at: #script.
]
{ #category : #accessing }
WDTimeouts >> script: anObject [
timeouts at: #script put: anObject.
]