-
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.
* Fix extended tests Thunderjet * Implement FAT-12537 * Implement FAT-12537 ---------
- Loading branch information
1 parent
a039d1c
commit 7d0a74f
Showing
3 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
.../organizations/add-privileged-donor-information-in-not-a-vendor-organization-record.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,76 @@ | ||
import permissions from '../../support/dictionary/permissions'; | ||
import Organizations from '../../support/fragments/organizations/organizations'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import Users from '../../support/fragments/users/users'; | ||
import getRandomPostfix from '../../support/utils/stringTools'; | ||
import NewOrganization from '../../support/fragments/organizations/newOrganization'; | ||
|
||
describe('Organizations', () => { | ||
const organization = { | ||
name: `1_autotest_name_${getRandomPostfix()}`, | ||
status: 'Active', | ||
code: `autotest_code_${getRandomPostfix()}`, | ||
isVendor: false, | ||
isDonor: true, | ||
erpCode: `ERP-${getRandomPostfix()}`, | ||
}; | ||
const firstContact = { ...NewOrganization.defaultContact }; | ||
const secondContact = { | ||
firstName: `2AT_FN_${getRandomPostfix()}`, | ||
lastName: `2AT_LN_${getRandomPostfix()}`, | ||
}; | ||
let user; | ||
|
||
before(() => { | ||
cy.getAdminToken(); | ||
Organizations.createOrganizationViaApi(organization).then((response) => { | ||
organization.id = response; | ||
}); | ||
cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); | ||
Organizations.searchByParameters('Name', organization.name); | ||
Organizations.selectOrganization(organization.name); | ||
Organizations.editOrganization(); | ||
Organizations.addNewDonorContact(firstContact); | ||
Organizations.closeContact(); | ||
Organizations.addDonorContactToOrganization(firstContact); | ||
Organizations.checkDonorContactIsAdd(firstContact); | ||
Organizations.saveOrganization(); | ||
cy.createTempUser([ | ||
permissions.uiOrganizationsViewEdit.gui, | ||
permissions.uiOrganizationsViewEditCreateDeletePrivilegedDonorInformation.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
cy.login(user.username, user.password, { | ||
path: TopMenu.organizationsPath, | ||
waiter: Organizations.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after(() => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(user.userId); | ||
Organizations.getOrganizationViaApi({ query: `name="${organization.name}"` }).then( | ||
(returnedOrganization) => { | ||
Organizations.deleteOrganizationViaApi(returnedOrganization.id); | ||
}, | ||
); | ||
}); | ||
|
||
it( | ||
'C423690 Add privileged donor information in Organization (NOT a vendor) record (thunderjet)', | ||
{ tags: ['criticalPath', 'thunderjet'] }, | ||
() => { | ||
Organizations.searchByParameters('Name', organization.name); | ||
Organizations.selectOrganization(organization.name); | ||
Organizations.editOrganization(); | ||
Organizations.addNewDonorContact(secondContact); | ||
Organizations.closeContact(); | ||
Organizations.addDonorContactToOrganization(secondContact); | ||
Organizations.checkDonorContactIsAdd(secondContact); | ||
Organizations.cancelOrganization(); | ||
Organizations.keepEditingOrganization(); | ||
Organizations.saveOrganization(); | ||
}, | ||
); | ||
}); |
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