-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: upload files with required inputs in native automation (#8092)
<!-- Thank you for your contribution. Before making a PR, please read our contributing guidelines at https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution We recommend creating a *draft* PR, so that you can mark it as 'ready for review' when you are done. --> ## Purpose UploadAutomation is fixed in order to upload required inputs in Native Automation mode. ## Approach Remove the required attribute from the file input before uploading. Initialize the addInternalEventAfterListener on inputs form 'submit' event for returning the required attributes back. ## References closes #8079 ## Pre-Merge TODO - [x] Write tests for your proposed changes - [x] Make sure that existing tests do not fail --------- Co-authored-by: aleks-pro <alexander.prokhorov@hotmail.com>
- Loading branch information
Showing
5 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 14 additions & 10 deletions
24
test/functional/fixtures/api/es-next/upload/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Upload</title> | ||
</head> | ||
<body> | ||
<form action="/file-upload" method="POST" enctype="multipart/form-data"> | ||
<input type="file" id="file" name="file"> | ||
<input type="submit" id="submit"> | ||
</form> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Upload</title> | ||
</head> | ||
<body> | ||
<form action="/file-upload" method="POST" enctype="multipart/form-data"> | ||
<input type="file" id="file" name="file" /> | ||
<input type="submit" id="submit" /> | ||
</form> | ||
<form action="/file-upload" method="POST" enctype="multipart/form-data"> | ||
<input type="file" id="fileRequired" name="fileRequired" required /> | ||
<input type="submit" id="submitRequired" /> | ||
</form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters