-
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 #906 from DFE-Digital/137749-cypress-sponsored-pat…
…h-school-overview 137749 Cypress - sponsored path - school overview
- Loading branch information
Showing
7 changed files
with
291 additions
and
96 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: 16 additions & 21 deletions
37
...PrepareConversions/Dfe.PrepareConversions.CypressTests/cypress/pages/projectAssignment.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 |
---|---|---|
@@ -1,31 +1,26 @@ | ||
/// <reference types ='Cypress'/> | ||
|
||
export const selectors = { | ||
assignInput: '[id="delivery-officer"]', | ||
unassignLink: '[id="unassign-link"]', | ||
saveButton: '[class="govuk-button"]' | ||
}; | ||
|
||
export const path = 'project-assignment'; | ||
import BasePage from "./BasePage"; | ||
|
||
class ProjectAssignment { | ||
export default class ProjectAssignment extends BasePage { | ||
static selectors = { | ||
assignInput: '[id="delivery-officer"]', | ||
unassignLink: '[id="unassign-link"]', | ||
saveButton: '[class="govuk-button"]' | ||
}; | ||
|
||
checkProjectAssignmentPage() { | ||
cy.url().should('include', path); | ||
} | ||
static path = 'project-assignment'; | ||
|
||
assignProject(deliveryOfficer) { | ||
this.checkProjectAssignmentPage(); | ||
cy.get(selectors.assignInput).click() | ||
cy.get(selectors.assignInput).type(`${deliveryOfficer}{enter}`); | ||
cy.get(selectors.saveButton).click(); | ||
static assignProject(deliveryOfficer) { | ||
cy.checkPath(this.path); | ||
cy.get(this.selectors.assignInput).click() | ||
cy.get(this.selectors.assignInput).type(`${deliveryOfficer}{enter}`); | ||
cy.get(this.selectors.saveButton).click(); | ||
}; | ||
|
||
unassignProject() { | ||
this.checkProjectAssignmentPage(); | ||
cy.get(selectors.unassignLink).click() | ||
static unassignProject() { | ||
cy.checkPath(this.path) | ||
cy.get(this.selectors.unassignLink).click() | ||
}; | ||
|
||
}; | ||
|
||
export default new ProjectAssignment(); |
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
47 changes: 29 additions & 18 deletions
47
Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests/cypress/pages/projectTaskList.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 |
---|---|---|
@@ -1,31 +1,42 @@ | ||
/// <reference types ='Cypress'/> | ||
|
||
export const selectors = { | ||
assignProjectButton: 'a[href*="project-assignment"]', | ||
assignedUser: '[data-id="assigned-user"]', | ||
notificationMessage: '[id="notification-message"]' | ||
} | ||
import BasePage from "./BasePage"; | ||
|
||
export const path = 'task-list'; | ||
export default class ProjectTaskList extends BasePage { | ||
|
||
class ProjectTaskList { | ||
|
||
checkProjectPage() { | ||
cy.url().should('include', path); | ||
static selectors = { | ||
assignProjectButton: 'a[href*="project-assignment"]', | ||
assignedUser: '[data-id="assigned-user"]', | ||
notificationMessage: '[id="notification-message"]', | ||
schoolOverviewLink: 'a[href*="/school-overview"]', | ||
schoolOverviewStatus: '[id="school-overview-status"]' | ||
} | ||
|
||
selectAssignProject() { | ||
cy.get(selectors.assignProjectButton).click(); | ||
static path = 'task-list'; | ||
|
||
static selectAssignProject() { | ||
cy.checkPath(this.path); | ||
cy.get(this.selectors.assignProjectButton).click(); | ||
}; | ||
|
||
getAssignedUser() { | ||
return cy.get(selectors.assignedUser); | ||
static getAssignedUser() { | ||
cy.checkPath(this.path); | ||
return cy.get(this.selectors.assignedUser); | ||
} | ||
|
||
getNotificationMessage() { | ||
return cy.get(selectors.notificationMessage); | ||
static getNotificationMessage() { | ||
cy.checkPath(this.path); | ||
return cy.get(this.selectors.notificationMessage); | ||
} | ||
|
||
}; | ||
static selectSchoolOverview() { | ||
cy.checkPath(this.path); | ||
cy.get(this.selectors.schoolOverviewLink).click() | ||
} | ||
|
||
export default new ProjectTaskList(); | ||
static getSchoolOverviewStatus() { | ||
cy.checkPath(this.path); | ||
return cy.get(this.selectors.schoolOverviewStatus); | ||
} | ||
|
||
}; |
Oops, something went wrong.