Moving inspector utilities to Clouseau
This commit is contained in:
parent
25d4aa0c57
commit
194dbdaf14
|
@ -13,6 +13,7 @@ BaselineOfWebDriver >> baseline: spec [
|
|||
spec
|
||||
package: 'WebDriver'
|
||||
];
|
||||
baseline: 'Clouseau' with: [ spec repository: 'https://gitea.lyrion.ch/zilti/clouseau' ];
|
||||
baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON/repository' ];
|
||||
baseline: 'OSSubprocess' with: [ spec repository: 'github://pharo-contributions/OSSubprocess:master/repository' ]
|
||||
]
|
||||
|
|
|
@ -116,21 +116,14 @@ WDElement >> element: anObject [
|
|||
{ #category : #'private - utilities' }
|
||||
WDElement >> inspectionWDElement [
|
||||
<inspectorPresentationOrder: 10 title: 'DOM Element'>
|
||||
| presenter attrItems attrPresenter screenshotPresenter |
|
||||
attrItems := OrderedCollection new.
|
||||
self attributes keysAndValuesDo: [ :aKey :aValue | attrItems add: { aKey -> aValue } ].
|
||||
| presenter attrPresenter screenshotPresenter |
|
||||
|
||||
attrPresenter := SpBoxLayout newTopToBottom
|
||||
add: (SpLabelPresenter new label: ('Infos about the "{1}" element:' format: {self name}); yourself)
|
||||
expand: false
|
||||
fill: false
|
||||
padding: 5;
|
||||
add: (SpTablePresenter new
|
||||
addColumn: (SpStringTableColumn title: 'Attribute' evaluated: [ :anObject | (anObject at: 1) key ]);
|
||||
addColumn: (SpStringTableColumn title: 'Value' evaluated: [ :anObject | (anObject at: 1) value ]);
|
||||
items: attrItems;
|
||||
alternateRowsColor
|
||||
)
|
||||
add: self attributes asStringTablePresenter
|
||||
expand: true
|
||||
fill: true
|
||||
padding: 5;
|
||||
|
|
|
@ -167,27 +167,12 @@ WebDriver >> inspectionWebDriver [
|
|||
fill: true
|
||||
padding: 5;
|
||||
add: (SpLabelPresenter new label: 'Preferences'; yourself) expand: false fill: false padding: 5;
|
||||
add: (SpTreeTablePresenter new
|
||||
addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :anObject | anObject key ]);
|
||||
addColumn: (SpStringTableColumn title: 'Value' evaluated: [ :anObject | anObject value ]);
|
||||
roots: prefs;
|
||||
children: [ :anItem | anItem value isDictionary ifTrue: [ anItem value ] ifFalse: [ false ] ])
|
||||
add: prefs asStringTreeTablePresenter
|
||||
expand: true
|
||||
fill: true
|
||||
padding: 5;
|
||||
add: (SpLabelPresenter new label: 'Session Capabilities'; yourself) expand: false fill: false padding: 5;
|
||||
add: (SpTreeTablePresenter new
|
||||
addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :anObject |
|
||||
anObject isDictionary
|
||||
ifTrue: [ anObject isEmpty ifTrue: [ '' ] ifFalse: [ anObject keys at: 1 ] ]
|
||||
ifFalse: [ anObject key ] ]);
|
||||
addColumn: (SpStringTableColumn title: 'Value' evaluated: [ :anObject |
|
||||
anObject isDictionary ifTrue: [ '' ] ifFalse: [ anObject value ] ]);
|
||||
roots: (capabilities ifNil: [ { } ] ifNotNil: [ capabilities ] );
|
||||
children: [ :anItem |
|
||||
anItem value isDictionary
|
||||
ifTrue: [ anItem value isEmpty ifTrue: [ {} ] ifFalse: [ anItem value ] ]
|
||||
ifFalse: [ {} ] ] )
|
||||
add: capabilities asStringTreeTablePresenter
|
||||
expand: true
|
||||
fill: true
|
||||
padding: 5
|
||||
|
|
Loading…
Reference in New Issue