-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cypress): add first Cypress real test
Validate if primary forest loss on Indonesia dashboard is an image instead a real widget. Reference #4593
- Loading branch information
1 parent
a992318
commit 898cae4
Showing
4 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Feature: duckduckgo.com | ||
Scenario: visiting the frontpage | ||
When I visit duckduckgo.com | ||
Then I should see a search bar |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
When('I visit duckduckgo.com', () => { | ||
cy.visit('https://www.duckduckgo.com'); | ||
}); | ||
|
||
Then('I should see a search bar', () => { | ||
cy.get('input#searchbox_input').should( | ||
'have.attr', | ||
'placeholder', | ||
'Search the web without being tracked' | ||
); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Feature: Indonesia TCL Image | ||
Scenario: Indonesia Dashboard should show an image instead the real Primay Forest Loss Widget | ||
When I visit Dashboard | ||
And I select Indonesia | ||
Then I should see an image of Indonesia Primary Forest Loss |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'; | ||
import { | ||
goToDashboardFromHome, | ||
selectCountryOnDashboard, | ||
} from '../../api/navigation-api'; | ||
|
||
When('I visit Dashboard', () => { | ||
goToDashboardFromHome(); | ||
}); | ||
|
||
When('I select Indonesia', () => { | ||
selectCountryOnDashboard('Indonesia'); | ||
}); | ||
|
||
Then('I should see an image of Indonesia Primary Forest Loss', () => { | ||
cy.get('[data-cy="indonesia-img"').should('exist'); | ||
}); |