Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@devtools: Enable file uploads by changing input elements' value #5347

Merged
merged 7 commits into from May 2, 2020

Conversation

nextlevelbeard
Copy link
Member

Proposed changes

Enables files uploads though input elements of type file by changing their value with addValue/setValue commands. Fixes #5090 , thanks to @takeya0x86

Usage (same as webdriver protocol)

input.setValue("/Users/user/files/file.txt") // Single
input.setValue("/Users/user/files/file.txt\n/Users/user/files/file2.txt") //Multiple
// also for addValue

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an actual e2e test using http://guinea-pig.webdriver.io/index.html? It has a simple file upload form.

e2e/element.test.js Outdated Show resolved Hide resolved
e2e/element.test.js Outdated Show resolved Hide resolved
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 awesome, thanks!

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label May 2, 2020
@christian-bromann christian-bromann merged commit 63da01a into webdriverio:master May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Bug Fix 🐛 PRs that contain bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

devtools: Cannot upload files though input elements
2 participants