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

@ -3,24 +3,10 @@ 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
label: 'Connection Infos';
yourself)
expand: false
fill: false
padding: 5;
add: (SpTablePresenter new add: (SpTablePresenter new
addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :anObject | anObject at: #title ] ); addColumn: (SpStringTableColumn
addColumn: (SpStringTableColumn title: 'Value' evaluated: [ :anObject | anObject at: #text ] ); title: 'Key'
evaluated: [ :anObject | anObject at: #title ]);
addColumn: (SpStringTableColumn
title: 'Value'
evaluated: [ :anObject | anObject at: #text ]);
items: { items: {
Dictionary new at: #title put: 'Browser'; at: #text put: (browserInfo at: #name); yourself. (Dictionary new
Dictionary new at: #title put: 'Driver'; at: #text put: (browserInfo at: #driver); yourself. at: #title put: 'Browser';
Dictionary new at: #title put: 'Address'; at: #text put: ('http://{1}:{2}/' format: {server.port}); yourself. at: #text put: (browserInfo at: #name);
}) yourself).
(Dictionary new
at: #title put: 'Driver';
at: #text put: (browserInfo at: #driver);
yourself).
(Dictionary new
at: #title put: 'Address';
at: #text put: ('http://{1}:{2}/' format: {
server.
port });
yourself) })
expand: true expand: true
fill: true fill: true
padding: 5; padding: 5;
add: (SpLabelPresenter new label: 'Preferences') expand: false fill: false padding: 5; add:
add: prefs asStringTreeTablePresenter (SpLabelPresenter new label: 'Session Capabilities')
expand: true expand: false
fill: true fill: false
padding: 5; padding: 5;
add: (SpLabelPresenter new label: 'Session Capabilities') expand: false fill: false padding: 5;
add: capabilities asStringTreeTablePresenter add: capabilities asStringTreeTablePresenter
expand: true expand: true
fill: true fill: true
padding: 5 padding: 5 yourself.
presenter := SpPresenter new
layout: presenter;
yourself. yourself.
presenter := SpPresenter new layout: presenter; yourself. ^ presenter
^ 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' }