-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui/doc: add cypress test for the documentation link
Refs: #2149
- Loading branch information
1 parent
7a4a611
commit 5d51fd9
Showing
3 changed files
with
26 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: AccessDocumentation | ||
Scenario: Access documentation from the Navbar | ||
Given I log in | ||
Then I can access the documentation from the navbar |
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,21 @@ | ||
import { Then } from 'cypress-cucumber-preprocessor/steps'; | ||
|
||
Then('I can access the documentation from the navbar', () => { | ||
const target_url = Cypress.env('target_url'); | ||
|
||
cy.visit(target_url, { | ||
onBeforeLoad(win) { | ||
// win is the the remote page's window object | ||
// `cy.stub()` stubs the window.open method | ||
cy.stub(win, 'open', url => { | ||
expect(url).to.have.string('/docs/index.html'); | ||
}); | ||
}, | ||
}); | ||
|
||
cy.get('.sc-dropdown') | ||
.eq(1) | ||
.click(); | ||
|
||
cy.get('[data-cy = documentation]').click(); | ||
}); |
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