-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add two tests and supporting PO items
- Loading branch information
1 parent
3d45abb
commit dcf0d2e
Showing
2 changed files
with
40 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -64,6 +64,26 @@ describe("Testing the components of the Trust contacts page", () => { | |
.checkSuccessPopup('Changes made to the SFSO (Schools financial support and oversight) lead name and email were updated') | ||
.checkErrorPopupNotPresent(); | ||
}); | ||
|
||
it(`Checks that when cancelling the edit of a TRM contact that I am taken back to the previous page and that entered data is not saved`, () => { | ||
contactsPage | ||
.editTrustRelationshipManager("Should Notbe Seen", "[email protected]") | ||
.clickContactUpdateCancelButton() | ||
.checkTrustRelationshipManagerIsNotUpdated(); | ||
|
||
navigation | ||
.checkCurrentURLIsCorrect(`/trusts/contacts/in-dfe?uid=${uid}`); | ||
}); | ||
|
||
it.only(`Checks that when cancelling the edit of a SFSO contact that I am taken back to the previous page and that entered data is not saved`, () => { | ||
contactsPage | ||
.editSfsoLead("Should Notbe Seen", "[email protected]") | ||
.clickContactUpdateCancelButton() | ||
.checkSfsoLeadIsNotUpdated(); | ||
|
||
navigation | ||
.checkCurrentURLIsCorrect(`/trusts/contacts/in-dfe?uid=${uid}`); | ||
}); | ||
}); | ||
|
||
describe(`On the edit Trust relationship manager contact details page for a ${typeOfTrust}`, () => { | ||
|
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 |
---|---|---|
|
@@ -20,7 +20,8 @@ class ContactsPage { | |
editContacts: { | ||
nameInput: () => cy.get('[name="Name"]'), | ||
emailInput: () => cy.get('[name="Email"]'), | ||
saveButton: () => cy.contains('Save and continue') | ||
saveButton: () => cy.contains('Save and continue'), | ||
cancelButton: () => cy.contains('Cancel') | ||
}, | ||
|
||
accountingOfficer: { | ||
|
@@ -59,6 +60,12 @@ class ContactsPage { | |
}, | ||
}; | ||
|
||
|
||
public clickContactUpdateCancelButton(): this { | ||
this.elements.editContacts.cancelButton().click(); | ||
return this; | ||
} | ||
|
||
public editTrustRelationshipManager(name: string, email: string): this { | ||
const { trustRelationshipManager, editContacts } = this.elements; | ||
trustRelationshipManager.editLink().click(); | ||
|
@@ -74,6 +81,18 @@ class ContactsPage { | |
return this; | ||
} | ||
|
||
public checkTrustRelationshipManagerIsNotUpdated(): this { | ||
this.elements.trustRelationshipManager.name().should('not.contain.text', 'Should Notbe Seen'); | ||
this.elements.trustRelationshipManager.email().should('not.contain.text', '[email protected]'); | ||
return this; | ||
} | ||
|
||
public checkSfsoLeadIsNotUpdated(): this { | ||
this.elements.schoolsFinancialSupportOversight.name().should('not.contain.text', 'Should Notbe Seen'); | ||
this.elements.schoolsFinancialSupportOversight.email().should('not.contain.text', '[email protected]'); | ||
return this; | ||
} | ||
|
||
public editSfsoLead(name: string, email: string): this { | ||
const { schoolsFinancialSupportOversight, editContacts: EditContacts } = this.elements; | ||
schoolsFinancialSupportOversight.editLink().click(); | ||
|