A few small bugfixes

This commit is contained in:
Daniel Ziltener 2023-04-25 17:19:00 +02:00
parent 05b5ee8a1b
commit 3fe7d16a0d
5 changed files with 55 additions and 57 deletions

View File

@ -10,14 +10,14 @@ Class {
#category : #'WebDriver-Tests-Base' #category : #'WebDriver-Tests-Base'
} }
{ #category : #running } { #category : #'tests - before' }
WDElementTest >> setUp [ WDElementTest >> setUp [
super setUp. super setUp.
driver := WebDriver start: #Firefox. driver := WebDriver start: #Firefox.
driver session. driver session.
] ]
{ #category : #running } { #category : #'tests - after' }
WDElementTest >> tearDown [ WDElementTest >> tearDown [
driver deleteSession. driver deleteSession.
driver finalize. driver finalize.

View File

@ -2,25 +2,11 @@
I represent a DOM element. I represent a DOM element.
For the Responsibility part: Three sentences about my main responsibilities - what I do, what I know. For the Responsibility part: Three sentences about my main responsibilities - what I do, what I know.
For the Collaborators Part: State my main collaborators and one line about how I interact with them.
Public API and Key Messages
- message one
- message two
- (for bonus points) how to create instances.
One simple example is simply gorgeous.
Internal Representation and Key Implementation Points.
Instance Variables Instance Variables
driver: <Object> driver: <Object> The active WebDriver from which this element was received
element: <Object> element: <Object> The actual WebDriver element
Implementation Points
" "
Class { Class {
#name : #WDElement, #name : #WDElement,

View File

@ -54,7 +54,7 @@ WDTimeouts >> pageLoad [
{ #category : #accessing } { #category : #accessing }
WDTimeouts >> pageLoad: anObject [ WDTimeouts >> pageLoad: anObject [
timeouts at: #pageLoad put: #anObject timeouts at: #pageLoad put: anObject
] ]
{ #category : #accessing } { #category : #accessing }

View File

@ -33,7 +33,6 @@ Class {
'server', 'server',
'port', 'port',
'sessionId', 'sessionId',
'prefs',
'capabilities' 'capabilities'
], ],
#category : #'WebDriver-Base' #category : #'WebDriver-Base'
@ -68,11 +67,6 @@ WebDriver class >> startWithOptions: options [
^ self subclassResponsibility. ^ self subclassResponsibility.
] ]
{ #category : #accessing }
WebDriver >> atPref: prefKey put: prefVal [
prefs at: prefKey put: prefVal.
]
{ #category : #navigation } { #category : #navigation }
WebDriver >> back [ WebDriver >> back [
@ -163,36 +157,56 @@ WebDriver >> forward [
{ #category : #'private - utilities' } { #category : #'private - utilities' }
WebDriver >> inspectionWebDriver [ WebDriver >> inspectionWebDriver [
<inspectorPresentationOrder: 10 title: 'Browser'> <inspectorPresentationOrder: 10 title: 'Browser'>
| presenter browserInfo | | presenter browserInfo |
browserInfo := self browserDetails. browserInfo := self browserDetails.
presenter := SpBoxLayout newTopToBottom presenter := SpBoxLayout newTopToBottom
add: (SpLabelPresenter new label: 'Connection Infos'; yourself) expand: false fill: false padding: 5; add: (SpLabelPresenter new
add: (SpTablePresenter new label: 'Connection Infos';
addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :anObject | anObject at: #title ] ); yourself)
addColumn: (SpStringTableColumn title: 'Value' evaluated: [ :anObject | anObject at: #text ] ); expand: false
items: { fill: false
Dictionary new at: #title put: 'Browser'; at: #text put: (browserInfo at: #name); yourself. padding: 5;
Dictionary new at: #title put: 'Driver'; at: #text put: (browserInfo at: #driver); yourself. add: (SpTablePresenter new
Dictionary new at: #title put: 'Address'; at: #text put: ('http://{1}:{2}/' format: {server.port}); yourself. addColumn: (SpStringTableColumn
}) title: 'Key'
expand: true evaluated: [ :anObject | anObject at: #title ]);
fill: true addColumn: (SpStringTableColumn
padding: 5; title: 'Value'
add: (SpLabelPresenter new label: 'Preferences') expand: false fill: false padding: 5; evaluated: [ :anObject | anObject at: #text ]);
add: prefs asStringTreeTablePresenter items: {
expand: true (Dictionary new
fill: true at: #title put: 'Browser';
padding: 5; at: #text put: (browserInfo at: #name);
add: (SpLabelPresenter new label: 'Session Capabilities') expand: false fill: false padding: 5; yourself).
add: capabilities asStringTreeTablePresenter (Dictionary new
expand: true at: #title put: 'Driver';
fill: true at: #text put: (browserInfo at: #driver);
padding: 5 yourself).
yourself. (Dictionary new
presenter := SpPresenter new layout: presenter; yourself. at: #title put: 'Address';
^ presenter. at: #text put: ('http://{1}:{2}/' format: {
server.
port });
yourself) })
expand: true
fill: true
padding: 5;
add:
(SpLabelPresenter new label: 'Session Capabilities')
expand: false
fill: false
padding: 5;
add: capabilities asStringTreeTablePresenter
expand: true
fill: true
padding: 5 yourself.
presenter := SpPresenter new
layout: presenter;
yourself.
^ presenter
] ]
{ #category : #'private - utilities' } { #category : #'private - utilities' }

View File

@ -36,15 +36,13 @@ WebDriverGeckodriver >> browserDetails [
{ #category : #'private - utilities' } { #category : #'private - utilities' }
WebDriverGeckodriver >> constructCapabilities: caps [ WebDriverGeckodriver >> constructCapabilities: caps [
^ { #desiredCapabilities capabilities := caps.
-> ^ { (#capabilities -> caps) } asDictionary
({ #moz:firefoxOptions -> ({ #prefs -> caps } asDictionary) }
asDictionary) } asDictionary.
] ]
{ #category : #initialization } { #category : #initialization }
WebDriverGeckodriver >> initialize [ WebDriverGeckodriver >> initialize [
prefs := Dictionary new.
] ]
{ #category : #'private - utilities' } { #category : #'private - utilities' }