-
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 #925 from DFE-Digital/137746-cyrpess-sponsored-per…
…formance 137746 cypress sponsored School Performance Information
- Loading branch information
Showing
3 changed files
with
78 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
43 changes: 43 additions & 0 deletions
43
Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests/cypress/pages/performance.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,43 @@ | ||
/// <reference types ='Cypress'/> | ||
|
||
import BasePage from "./BasePage"; | ||
|
||
export default class Performance extends BasePage { | ||
static selectors = { | ||
ofstedInfoLink: '[data-test="change-school-performance-additional-information"]', | ||
ofstedInfoInput: '[id="additional-information"]', | ||
ofstedInfoValue: '[id="additional-information"]', | ||
keyStageLink: (keyStageNumber) => `[data-test="change-key-stage-${keyStageNumber}-additional-information"]`, | ||
keyStageInput: '[id="additional-information"]', | ||
keyStageValue: '[id="additional-information"]', | ||
saveButton: '[class="govuk-button"]' | ||
}; | ||
|
||
static ofstedPath = 'school-performance-ofsted-information'; | ||
static keyStagePath = (keyStageNumber) => `key-stage-${keyStageNumber}-performance-tables`; | ||
|
||
static changeOfstedInfo(additionalInfo) { | ||
cy.checkPath(this.ofstedPath); | ||
cy.get(this.selectors.ofstedInfoLink).click() | ||
cy.get(this.selectors.ofstedInfoInput).clear().type(additionalInfo); | ||
cy.get(this.selectors.saveButton).click(); | ||
}; | ||
|
||
static getOfstedInfo() { | ||
cy.checkPath(this.ofstedPath) | ||
return cy.get(this.selectors.ofstedInfoValue); | ||
}; | ||
|
||
static changeKeyStageInfo(keyStageNumber, additionalInfo) { | ||
cy.checkPath(this.keyStagePath(keyStageNumber)); | ||
cy.get(this.selectors.keyStageLink(keyStageNumber)).click() | ||
cy.get(this.selectors.keyStageInput).clear().type(additionalInfo); | ||
cy.get(this.selectors.saveButton).click(); | ||
}; | ||
|
||
static getKeyStageInfo(keyStageNumber) { | ||
cy.checkPath(this.keyStagePath(keyStageNumber)) | ||
return cy.get(this.selectors.keyStageValue); | ||
}; | ||
|
||
}; |
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