Skip to content

Commit

Permalink
Create the uploaded file from inside RobotFramework
Browse files Browse the repository at this point in the history
according to
https://github.com/mozilla/geckodriver/releases/tag/v0.34.0 and
https://firefox-source-docs.mozilla.org/testing/geckodriver/Usage.html#running-firefox-in-a-container-based-package

> When Firefox is packaged inside a container (e.g. Snap, Flatpak),
> it may see a different filesystem to the host....

> This is known to affect launching the default Firefox shipped with Ubuntu 22.04+

while Firefox doesn't seem to hang this may be what's causing the
failure to find an existing file for upload. If FF thinks that that
filesystem is different then that could be it! Therefore generate a
temporary file and use it during testing.
  • Loading branch information
atodorov committed Mar 7, 2024
1 parent 538d70e commit d31cefb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ _EOF_
rlRun -t -c "robot tests/ui/test_upload_file.robot"

# verify file is there
rlRun -t -c "curl -k -D- --silent $HTTPS/uploads/attachments/testplans_testplan/1/test_upload_file.robot | grep '200 OK'"
rlRun -t -c "curl -k -D- --silent $HTTPS/uploads/attachments/testplans_testplan/1/hello-robots.txt | grep '200 OK'"
fi
rlPhaseEnd

Expand Down
4 changes: 3 additions & 1 deletion tests/ui/test_upload_file.robot
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*** Settings ***
Library OperatingSystem
Library SeleniumLibrary

*** Variables ***
Expand All @@ -25,7 +26,8 @@ Uploading file works via file upload
Title Should Be Kiwi TCMS - Dashboard

Go To ${TEST_PLAN_URL}
Choose File id:id_attachment_file ${CURDIR}${/}test_upload_file.robot
Create File ${TEMPDIR}${/}hello-robots.txt Hello Robots
Choose File id:id_attachment_file ${TEMPDIR}${/}hello-robots.txt
Click Button Add attachment
Page Should Contain Your attachment was uploaded

Expand Down

0 comments on commit d31cefb

Please sign in to comment.