-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #922 from DFE-Digital/137739-cypress-sponsored-rat…
…ionale 137739 Cypress sponsored Add rationale test
- Loading branch information
Showing
3 changed files
with
63 additions
and
2 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
37 changes: 37 additions & 0 deletions
37
Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests/cypress/pages/rationale.js
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,37 @@ | ||
/// <reference types ='Cypress'/> | ||
|
||
import BasePage from "./BasePage"; | ||
|
||
export default class Rationale extends BasePage { | ||
static selectors = { | ||
rationaleLink: '[data-test="change-rationale-for-trust"]', | ||
rationaleInput: '[id="trust-rationale"]', | ||
rationaleValue: '[id="rationale-for-trust"]', | ||
saveButton: '[class="govuk-button"]', | ||
completeCheckbox: '[id="rationale-complete"]' | ||
}; | ||
|
||
static path = 'confirm-project-trust-rationale'; | ||
|
||
static changeRationale(rationale) { | ||
cy.checkPath(this.path); | ||
cy.get(this.selectors.rationaleLink).click() | ||
cy.get(this.selectors.rationaleInput).clear().type(rationale); | ||
cy.get(this.selectors.saveButton).click(); | ||
}; | ||
|
||
static getRationale() { | ||
cy.checkPath(this.path) | ||
return cy.get(this.selectors.rationaleValue); | ||
}; | ||
|
||
static markComplete() { | ||
cy.checkPath(this.path); | ||
cy.get(this.selectors.completeCheckbox).check(); | ||
} | ||
|
||
static markIncomplete() { | ||
cy.checkPath(this.path); | ||
cy.get(this.selectors.completeCheckbox).uncheck(); | ||
} | ||
}; |