-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FAT-7708: steps added * FAT-7708: more steps added * FAT-7708: test finished * FAT-7708: additional waiters added * FAT-7708: increased timeout for note type save * FAT-7708: test updated * FAT-7708: updated method * FAT-7708: removed file * file restored * FAT-7708: added test in a new file * FAT-7708: refactored test * FAT-7708: test updated
- Loading branch information
1 parent
f96aa3a
commit 4743edf
Showing
5 changed files
with
152 additions
and
6 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,91 @@ | ||
import uuid from 'uuid'; | ||
import { Permissions } from '../../support/dictionary'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import Users from '../../support/fragments/users/users'; | ||
import NoteTypes from '../../support/fragments/settings/notes/noteTypes'; | ||
import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; | ||
import UsersCard from '../../support/fragments/users/usersCard'; | ||
import AgreementsDetails from '../../support/fragments/agreements/agreementViewDetails'; | ||
import getRandomPostfix, { randomFourDigitNumber } from '../../support/utils/stringTools'; | ||
import { NOTE_TYPES } from '../../support/constants'; | ||
import NewNote from '../../support/fragments/notes/newNote'; | ||
import ExistingNoteEdit from '../../support/fragments/notes/existingNoteEdit'; | ||
|
||
describe('Notes', () => { | ||
const testData = { | ||
customNoteTypeName: `C1304NoteType_${getRandomPostfix()}`, | ||
updatedNoteTypeName: `C1304NoteTypeUPD_${getRandomPostfix()}`, | ||
}; | ||
const noteTypeC1304 = NOTE_TYPES.GENERAL; | ||
const noteC1304 = { title: `Note C1304 ${randomFourDigitNumber()}`, details: 'This is Note 1' }; | ||
|
||
before('Creating data', () => { | ||
cy.getAdminToken(); | ||
NoteTypes.createNoteTypeViaApi({ id: uuid(), name: testData.customNoteTypeName }).then( | ||
(newNoteType) => { | ||
testData.customNoteTypeId = newNoteType.id; | ||
|
||
cy.createTempUser([ | ||
Permissions.uiUsersView.gui, | ||
Permissions.uiAgreementsSearchAndView.gui, | ||
Permissions.moduleeHoldingsEnabled.gui, | ||
Permissions.licensesSearchAndView.gui, | ||
Permissions.uiRequestsView.gui, | ||
Permissions.coursesAll.gui, | ||
Permissions.uiNotesAssignUnassign.gui, | ||
Permissions.uiNotesItemCreate.gui, | ||
Permissions.uiNotesItemView.gui, | ||
Permissions.uiNotesItemEdit.gui, | ||
Permissions.uiNotesSettingsEdit.gui, | ||
]).then((userC1304Properties) => { | ||
testData.userC1304Properties = userC1304Properties; | ||
|
||
cy.loginAsAdmin().then(() => { | ||
cy.visit(TopMenu.usersPath); | ||
UsersSearchPane.waitLoading(); | ||
UsersSearchPane.searchByUsername(testData.userC1304Properties.username); | ||
UsersSearchPane.waitLoading(); | ||
UsersCard.openNotesSection(); | ||
AgreementsDetails.createNote({ ...noteC1304, checkoutApp: false }, noteTypeC1304); | ||
UsersCard.waitLoading(); | ||
// wait for all requests on page to finish | ||
cy.wait(3000); | ||
}); | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after('Deleting created entities', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.userC1304Properties.userId); | ||
NoteTypes.deleteNoteTypeViaApi(testData.customNoteTypeId); | ||
}); | ||
|
||
it('C1304 Settings | Edit a note type (spitfire)', { tags: ['extendedPath', 'spitfire'] }, () => { | ||
cy.login(testData.userC1304Properties.username, testData.userC1304Properties.password).then( | ||
() => { | ||
cy.visit(TopMenu.notesPath); | ||
NoteTypes.waitLoading(); | ||
NoteTypes.checkNewButtonState(); | ||
NoteTypes.clickEditNoteType(testData.customNoteTypeName); | ||
NoteTypes.checkNoteButtonsState(); | ||
NoteTypes.fillInNoteType(testData.updatedNoteTypeName); | ||
NoteTypes.saveNoteType(testData.updatedNoteTypeName); | ||
|
||
cy.visit(TopMenu.usersPath); | ||
UsersSearchPane.waitLoading(); | ||
UsersSearchPane.searchByUsername(testData.userC1304Properties.username); | ||
UsersSearchPane.waitLoading(); | ||
UsersCard.openNotesSection(); | ||
UsersCard.clickNewNoteButton(); | ||
NewNote.verifyNoteTypeExists(testData.updatedNoteTypeName); | ||
NewNote.close(); | ||
UsersCard.openNotesSection(); | ||
UsersCard.openNoteForEdit(noteC1304.title); | ||
ExistingNoteEdit.waitLoading(); | ||
NewNote.verifyNoteTypeExists(testData.updatedNoteTypeName); | ||
}, | ||
); | ||
}); | ||
}); |
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
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