From f54506affb11ea4cfae61086b22e0efe7f59c4ea Mon Sep 17 00:00:00 2001 From: ddl-kavya <91882851+ddl-kavya@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:43:48 +0530 Subject: [PATCH] QE-13283 use absolute path for file upload (#365) Jira: [QE-13283](https://dominodatalab.atlassian.net/browse/QE-13283) Issue: Using relative path is failing to upload files. Solution: Use absolute path when uploading files. [QE-13283]: https://dominodatalab.atlassian.net/browse/QE-13283?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Xin Dong <104880864+ddl-xin@users.noreply.github.com> --- CHANGELOG.md | 3 +++ pyproject.toml | 2 +- src/cucu/steps/file_input_steps.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a773b7d..4a994c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project closely adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.162.0 +- Fix - use absolute path when uploading files using drag and drop + ## 0.161.0 - Change - add .txt as browser console log file suffix diff --git a/pyproject.toml b/pyproject.toml index 65cd5682..5e03fd80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cucu" -version = "0.161.0" +version = "0.162.0" license = "MIT" description = "Easy BDD web testing" authors = ["Domino Data Lab "] diff --git a/src/cucu/steps/file_input_steps.py b/src/cucu/steps/file_input_steps.py index 17f9e49b..8025629d 100644 --- a/src/cucu/steps/file_input_steps.py +++ b/src/cucu/steps/file_input_steps.py @@ -72,4 +72,4 @@ def drag_and_drop_file(ctx, name, filepath): f'looked for drag & drop target "{name}" and found "{drop_target_html}"' ) file_input = ctx.browser.execute(JS_DROP_FILE, drop_target, 0, 0) - file_input.send_keys(filepath) + file_input.send_keys(os.path.abspath(filepath))