From 194dbdaf1478e12367b22082c6bab816d42c9e8d Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Wed, 18 May 2022 19:04:42 +0200 Subject: [PATCH] Moving inspector utilities to Clouseau --- .../BaselineOfWebDriver.class.st | 1 + src/WebDriver/WDElement.class.st | 11 ++--------- src/WebDriver/WebDriver.class.st | 19 ++----------------- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/BaselineOfWebDriver/BaselineOfWebDriver.class.st b/src/BaselineOfWebDriver/BaselineOfWebDriver.class.st index d491aac..2fed1a8 100644 --- a/src/BaselineOfWebDriver/BaselineOfWebDriver.class.st +++ b/src/BaselineOfWebDriver/BaselineOfWebDriver.class.st @@ -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' ] ] diff --git a/src/WebDriver/WDElement.class.st b/src/WebDriver/WDElement.class.st index f743835..3bd5962 100644 --- a/src/WebDriver/WDElement.class.st +++ b/src/WebDriver/WDElement.class.st @@ -116,21 +116,14 @@ WDElement >> element: anObject [ { #category : #'private - utilities' } WDElement >> inspectionWDElement [ - | 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; diff --git a/src/WebDriver/WebDriver.class.st b/src/WebDriver/WebDriver.class.st index 2831442..2a69028 100644 --- a/src/WebDriver/WebDriver.class.st +++ b/src/WebDriver/WebDriver.class.st @@ -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