-
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.
Merge branch 'master' of https://github.com/folio-org/stripes-testing …
…into FAT-16557
- Loading branch information
Showing
11 changed files
with
333 additions
and
22 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
cypress/e2e/inventory/settings/instance-date-types/update-instance-date-type-name.cy.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,68 @@ | ||
import { Permissions } from '../../../../support/dictionary'; | ||
import Users from '../../../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../../../support/utils/stringTools'; | ||
|
||
describe('Inventory', () => { | ||
describe('Settings', () => { | ||
describe('Classification browse', () => { | ||
let user; | ||
let originalDateType; | ||
|
||
const testData = { | ||
totalAmountOfDateTypes: 15, | ||
dateTypeSource: 'folio', | ||
keyToUpdate: 'name', | ||
newName: `Fortlaufende Ressource - Update zur Einstellung der Veröffentlichung ${getRandomPostfix()}`, | ||
}; | ||
|
||
before('Create user, get data', () => { | ||
cy.getAdminToken(); | ||
cy.getInstanceDateTypesViaAPI().then((response) => { | ||
originalDateType = response.instanceDateTypes[response.instanceDateTypes.length - 1]; | ||
}); | ||
cy.createTempUser([ | ||
Permissions.uiInventorySettingsConfigureClassificationBrowse.gui, | ||
Permissions.crudClassificationIdentifierTypes.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
}); | ||
}); | ||
|
||
after('Delete user', () => { | ||
cy.getAdminToken(); | ||
// restore the original instance date type name | ||
cy.patchInstanceDateTypeViaAPI( | ||
originalDateType.id, | ||
testData.keyToUpdate, | ||
originalDateType.name, | ||
); | ||
Users.deleteViaApi(user.userId); | ||
}); | ||
|
||
it( | ||
'C506694 Update of Date type\'s "name" (spitfire)', | ||
{ tags: ['criticalPath', 'spitfire'] }, | ||
() => { | ||
cy.patchInstanceDateTypeViaAPI( | ||
originalDateType.id, | ||
testData.keyToUpdate, | ||
testData.newName, | ||
).then(({ status }) => { | ||
expect(status).to.eq(204); | ||
cy.getInstanceDateTypesViaAPI().then((response) => { | ||
expect(response.status).to.eq(200); | ||
expect(response.instanceDateTypes).to.have.lengthOf(testData.totalAmountOfDateTypes); | ||
expect( | ||
response.instanceDateTypes.every((type) => type.source === testData.dateTypeSource), | ||
).to.eq(true); | ||
const updatedDateType = response.instanceDateTypes.filter( | ||
(type) => type.id === originalDateType.id, | ||
)[0]; | ||
expect(updatedDateType.name).to.eq(testData.newName); | ||
}); | ||
}); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
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
68 changes: 68 additions & 0 deletions
68
...e/users/profile-pictures/pp-do-not-display-on-user-record-without-users-can-view-pp.cy.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,68 @@ | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import UserEdit from '../../../support/fragments/users/userEdit'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import UsersCard from '../../../support/fragments/users/usersCard'; | ||
import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; | ||
|
||
describe('Users', () => { | ||
describe('Profile pictures', () => { | ||
const testData = { | ||
externalPictureUrl: | ||
'https://png.pngtree.com/png-vector/20191101/ourmid/pngtree-cartoon-color-simple-male-avatar-png-image_1934459.jpg', | ||
}; | ||
|
||
before('Create test data and login', () => { | ||
cy.getAdminToken(); | ||
cy.getConfigurationsEntry().then((respBody) => { | ||
const id = respBody.id; | ||
respBody.enabled = true; | ||
|
||
cy.updateConfigurationsEntry(id, respBody); | ||
}); | ||
|
||
// create user B | ||
cy.createTempUser().then((userProperties) => { | ||
testData.userB = userProperties; | ||
UserEdit.addProfilePictureViaApi(testData.userB.userId, testData.externalPictureUrl); | ||
}); | ||
|
||
// create user C | ||
cy.createTempUser().then((userProperties) => { | ||
testData.userC = userProperties; | ||
}); | ||
|
||
// create user A | ||
cy.createTempUser([Permissions.uiUsersView.gui]).then((userProperties) => { | ||
testData.userA = userProperties; | ||
|
||
cy.login(testData.userA.username, testData.userA.password, { | ||
path: TopMenu.usersPath, | ||
waiter: UsersSearchPane.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Deleting created entities', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.userA.userId); | ||
Users.deleteViaApi(testData.userB.userId); | ||
Users.deleteViaApi(testData.userC.userId); | ||
}); | ||
|
||
it( | ||
"C442807 Verify that profile pictures don't display on user record without Users: Can view profile pictures (volaris)", | ||
{ tags: ['smoke', 'volaris'] }, | ||
() => { | ||
UsersSearchPane.searchByUsername(testData.userB.username); | ||
UsersCard.waitLoading(); | ||
UsersCard.verifyProfilePictureIsAbsent(); | ||
|
||
UsersSearchPane.resetAllFilters(); | ||
UsersSearchPane.searchByUsername(testData.userC.username); | ||
UsersCard.waitLoading(); | ||
UsersCard.verifyProfilePictureIsAbsent(); | ||
}, | ||
); | ||
}); | ||
}); |
89 changes: 89 additions & 0 deletions
89
cypress/e2e/users/profile-pictures/profile=picture-can-be-updated-via-url.cy.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,89 @@ | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import UserEdit from '../../../support/fragments/users/userEdit'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import UsersCard from '../../../support/fragments/users/usersCard'; | ||
import UsersSearchPane from '../../../support/fragments/users/usersSearchPane'; | ||
|
||
describe('Users', () => { | ||
describe('Profile pictures', () => { | ||
const testData = { | ||
externalPictureUrl: | ||
'https://hips.hearstapps.com/hmg-prod/images/bright-forget-me-nots-royalty-free-image-1677788394.jpg?crop=0.535xw:1.00xh;0.359xw,0&resize=980:*', | ||
newExternalPictureUrl: | ||
'https://hips.hearstapps.com/hmg-prod/images/bright-me-nots-royalty-free-image-1677788394.jpg?crop=0.535xw:1.00xh;0.359xw,0&resize=980:*', | ||
invalidExternalPictureUrl: | ||
'https//hips.hearstapps.com/hmg-prod/images/bright-forget-me-nots-royalty-free-image-1677788394.jpg?crop=0.535xw:1.00xh;0.359xw,0&resize=980:*', | ||
validExternalPictureUrl: | ||
'https://kidlingoo.com/wp-content/uploads/flowers_name_in_english.jpg', | ||
}; | ||
|
||
before('Create test data and login', () => { | ||
cy.getAdminToken(); | ||
cy.getConfigurationsEntry().then((respBody) => { | ||
respBody.enabled = true; | ||
|
||
cy.updateConfigurationsEntry(respBody.id, respBody); | ||
}); | ||
|
||
// create user B | ||
cy.createTempUser().then((userProperties) => { | ||
testData.userB = userProperties; | ||
}); | ||
|
||
// create user A | ||
cy.createTempUser([Permissions.uiUserViewEditDeliteProfilePictores.gui]).then( | ||
(userProperties) => { | ||
testData.userA = userProperties; | ||
|
||
cy.login(testData.userA.username, testData.userA.password, { | ||
path: TopMenu.usersPath, | ||
waiter: UsersSearchPane.waitLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after('Deleting created entities', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.userA.userId); | ||
Users.deleteViaApi(testData.userB.userId); | ||
}); | ||
|
||
it( | ||
'C442797 Verify that profile picture can be updated via URL (volaris)', | ||
{ tags: ['criticalPath', 'volaris'] }, | ||
() => { | ||
UsersSearchPane.searchByUsername(testData.userB.username); | ||
UsersCard.waitLoading(); | ||
UserEdit.openEdit(); | ||
UserEdit.verifyProfileCardIsPresented(); | ||
UserEdit.verifyButtonsStateForProfilePicture([{ value: 'External URL' }]); | ||
UserEdit.setPictureFromExternalUrl(testData.externalPictureUrl); | ||
UserEdit.verifyProfilePictureIsPresent(testData.externalPictureUrl); | ||
UserEdit.saveAndClose(); | ||
UsersCard.waitLoading(); | ||
UsersCard.verifyProfilePictureIsPresent(testData.externalPictureUrl); | ||
|
||
UserEdit.openEdit(); | ||
UserEdit.verifyProfileCardIsPresented(); | ||
UserEdit.verifyButtonsStateForProfilePicture([{ value: 'External URL' }]); | ||
UserEdit.setPictureFromExternalUrl(testData.newExternalPictureUrl, false); | ||
UserEdit.verifyModalWithInvalidUrl( | ||
'The provided URL is valid but does not point to an image file', | ||
); | ||
UserEdit.fillInExternalImageUrlTextField(testData.invalidExternalPictureUrl); | ||
UserEdit.clickSaveButton(); | ||
UserEdit.verifyModalWithInvalidUrl('Invalid image URL'); | ||
|
||
UserEdit.clearExternalImageUrlTextField(); | ||
UserEdit.fillInExternalImageUrlTextField(testData.validExternalPictureUrl); | ||
UserEdit.clickSaveButton(); | ||
cy.wait(3000); | ||
UserEdit.saveAndClose(); | ||
UsersCard.waitLoading(); | ||
UsersCard.verifyProfilePictureIsPresent(testData.validExternalPictureUrl); | ||
}, | ||
); | ||
}); | ||
}); |
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
Oops, something went wrong.