More tests

This commit is contained in:
Daniel Ziltener 2022-05-17 14:28:56 +02:00
parent d056622e43
commit ca242b4d3b
2 changed files with 13 additions and 4 deletions

View File

@ -27,6 +27,15 @@ WDElementTest >> tearDown [
{ #category : #tests }
WDElementTest >> testAttributeReading [
| element |
driver url: ''.
element := driver findElement: '' using: ''.
driver url: 'https://ddg.co'.
element := driver findElement: '#logo_homepage_link' using: WDLocationStrategy cssSelector.
self assert: (element attribute: 'href') equals: '/about'.
]
{ #category : #tests }
WDElementTest >> testTextReading [
| element |
driver url: 'https://ddg.co'.
element := driver findElement: '#logo_homepage_link' using: WDLocationStrategy cssSelector.
self assert: (element text) equals: 'About DuckDuckGo'.
]

View File

@ -4,7 +4,7 @@ I implement the specifics and quirks to remote control a Firefox instance using
Class {
#name : #WebDriverGeckodriver,
#superclass : #WebDriver,
#category : #WebDriver
#category : #'WebDriver-Base'
}
{ #category : #testing }
@ -18,7 +18,7 @@ WebDriverGeckodriver class >> startWithOptions: options [
subproc := OSSUnixSubprocess new
command: 'geckodriver'.
[ subproc run ] fork.
(Delay forSeconds: 1) wait.
(Delay forSeconds: 0.1) wait.
^ self new
browser: subproc
server: '127.0.0.1'