Skip to content

Commit c5b2ec4

Browse files
Merge pull request #30 from aldimhernandez/4-create-steps-basic-scenario-for-downloadfeature-and-steps-definitions
feat: ✨ add new download test feature and its steps definitions
2 parents bb3bc31 + 6adcc19 commit c5b2ec4

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Feature: File Download
2+
3+
Scenario: Verify file download functionality
4+
Given I visit the demoqa site
5+
When I navigate to the "Elements" section
6+
And I click on the "Upload and Download" section
7+
When I click on the "Download" button
8+
Then The file should be downloaded successfully

cypress/e2e/features/download.feature

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Then, When } from "@badeball/cypress-cucumber-preprocessor";
2+
3+
//TODO: Refactor to POM
4+
When('I navigate to the "Elements" section', () => {
5+
cy.contains("Elements").click();
6+
});
7+
8+
When('I click on the "Upload and Download" section', () => {
9+
cy.contains("Upload and Download").click();
10+
11+
});
12+
13+
When('I click on the "Download" button', () => {
14+
cy.get("#downloadButton").click();
15+
});
16+
17+
Then('The file should be downloaded successfully', () => {
18+
cy.readFile("cypress/downloads/sampleFile.jpeg").should("exist");
19+
});

cypress/e2e/step_definitions/download.cy.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)