Recall & Review
beginner
What is the main purpose of drag and drop file upload testing?
To verify that users can upload files by dragging them into a designated area on a web page, ensuring the feature works smoothly and files are correctly received.
Click to reveal answer
intermediate
Which Cypress command helps simulate drag and drop file upload?
The
attachFile() command from the cypress-file-upload plugin is commonly used to simulate file uploads, including drag and drop actions.Click to reveal answer
intermediate
Why is it important to test drag and drop file upload with different file types?
Because users may upload various file types, testing ensures the system accepts allowed types and rejects unsupported ones, preventing errors or security issues.
Click to reveal answer
beginner
What is a common locator strategy for the drag and drop area in tests?
Using semantic selectors like
data-cy or aria-label attributes to target the drop zone ensures stable and clear locators.Click to reveal answer
intermediate
How can you verify a successful drag and drop file upload in Cypress?
By asserting that the UI shows the uploaded file name, or that a success message appears, or by checking the backend response confirming the upload.
Click to reveal answer
Which Cypress plugin is commonly used to simulate drag and drop file uploads?
✗ Incorrect
The cypress-file-upload plugin provides the attachFile() command to simulate file uploads including drag and drop.
What is the best way to locate the drag and drop area in your test?
✗ Incorrect
Using data-cy or aria-label attributes creates stable, readable, and accessible locators.
What should you check after simulating a drag and drop file upload?
✗ Incorrect
Verifying the file name or success message confirms the upload worked as expected.
Why test drag and drop uploads with different file types?
✗ Incorrect
Testing different file types ensures the system correctly handles allowed and disallowed files.
Which Cypress command simulates attaching a file to an input element?
✗ Incorrect
attachFile() is the command from cypress-file-upload to simulate file attachment.
Explain how you would write a Cypress test to verify drag and drop file upload functionality.
Think about locating the drop area, simulating the file upload, and checking the result.
You got /4 concepts.
What are key considerations when testing drag and drop file uploads?
Consider what users do and what the system should handle.
You got /4 concepts.