From f2b3dfb84c8e9a0a927cee3c3cc7696364ac5abf Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Wed, 31 Jan 2024 22:11:47 +0100 Subject: [PATCH] added upload test --- .../instance/expectedFailures.st | 2 +- .../instance/testUploadFunctionalTest.st | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/expectedFailures.st b/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/expectedFailures.st index e888983df..ef9ccac34 100644 --- a/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/expectedFailures.st +++ b/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/expectedFailures.st @@ -1,7 +1,7 @@ running expectedFailures | todo | - todo := #(testExpiryFunctionalTest testFilterFunctionalTest testUploadFunctionalTest). + todo := #(testExpiryFunctionalTest testFilterFunctionalTest). ^ (GRPlatform current class == (Smalltalk at: #GRGemStonePlatform ifAbsent:[ nil ])) ifTrue: [ #(testContextFunctionalTest), todo "requires https://github.com/GsDevKit/Grease/pull/17 to be merged" ] ifFalse:[ todo ] \ No newline at end of file diff --git a/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/testUploadFunctionalTest.st b/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/testUploadFunctionalTest.st index 8042e8744..e8f7caa7b 100644 --- a/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/testUploadFunctionalTest.st +++ b/repository/Seaside-Tests-Parasol.package/WAWebDriverFunctionalTestCase.class/instance/testUploadFunctionalTest.st @@ -1,5 +1,16 @@ testing testUploadFunctionalTest + + | file | self selectTest: 'WAUploadFunctionalTest'. - - self fail. \ No newline at end of file + + file := GRPlatform current newTemporaryFileReferenceNamed: 'testfile.txt'. + GRPlatform current + writeFileStreamOn: file pathString + do: [ :stream | stream nextPutAll: 'blabla' ] + binary: false. + + (driver findElementByCSSSelector: 'input[type=file]') sendKeys: file pathString. + (driver findElementByCSSSelector: 'input[value=Load]') click. + + self assert: (driver findElementByCSSSelector: 'pre') getText equals: 'blabla' \ No newline at end of file