-
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.
* implemented new tests on list permissions FAT-16533 FAT-16534
- Loading branch information
Showing
5 changed files
with
181 additions
and
7 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
67 changes: 67 additions & 0 deletions
67
cypress/e2e/lists/permissions/lists-refresh-permissions.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,67 @@ | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
import Lists from '../../../support/fragments/lists/lists'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import { getTestEntityValue } from '../../../support/utils/stringTools'; | ||
|
||
describe('lists', () => { | ||
describe('permissions', () => { | ||
const userData = {}; | ||
const listData = { | ||
name: `C411821-${getTestEntityValue('test_list')}`, | ||
description: `C411821-${getTestEntityValue('test_list_description')}`, | ||
recordType: 'Users', | ||
fqlQuery: '', | ||
isActive: true, | ||
isPrivate: false, | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([ | ||
Permissions.listsCreateEditRefresh.gui, | ||
Permissions.usersViewRequests.gui, | ||
Permissions.uiOrdersCreate.gui, | ||
Permissions.inventoryAll.gui, | ||
Permissions.loansAll.gui, | ||
Permissions.uiOrganizationsViewEditCreate.gui, | ||
]) | ||
.then((userProperties) => { | ||
userData.username = userProperties.username; | ||
userData.password = userProperties.password; | ||
userData.userId = userProperties.userId; | ||
}) | ||
.then(() => { | ||
Lists.buildQueryOnActiveUsers().then((query) => { | ||
Lists.createQueryViaApi(query).then((createdQuery) => { | ||
listData.queryId = createdQuery.queryId; | ||
listData.fqlQuery = createdQuery.fqlQuery; | ||
listData.fields = ['users.active', 'user.id']; | ||
|
||
Lists.createViaApi(listData).then((body) => { | ||
listData.id = body.id; | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken(); | ||
Lists.deleteViaApi(listData.id); | ||
Users.deleteViaApi(userData.userId); | ||
}); | ||
|
||
it('C411821 Refresh list: Not canned lists (corsair)', { tags: ['smoke', 'corsair'] }, () => { | ||
cy.login(userData.username, userData.password, { | ||
path: TopMenu.listsPath, | ||
waiter: Lists.waitLoading, | ||
}); | ||
Lists.verifyListIsPresent(listData.name); | ||
Lists.openList(listData.name); | ||
Lists.openActions(); | ||
Lists.refreshList(); | ||
Lists.waitForCompilingToComplete(); | ||
}); | ||
}); | ||
}); |
78 changes: 78 additions & 0 deletions
78
cypress/e2e/lists/permissions/lists-view-permissions.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,78 @@ | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
import Lists from '../../../support/fragments/lists/lists'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import { getTestEntityValue } from '../../../support/utils/stringTools'; | ||
|
||
describe('lists', () => { | ||
describe('permissions', () => { | ||
const userData = {}; | ||
const listData = { | ||
name: `C418651-${getTestEntityValue('test_list')}`, | ||
description: `C418651-${getTestEntityValue('test_list_description')}`, | ||
recordType: 'Users', | ||
fqlQuery: '', | ||
isActive: true, | ||
isPrivate: false, | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([ | ||
Permissions.listsView.gui, | ||
Permissions.usersViewRequests.gui, | ||
Permissions.uiOrdersCreate.gui, | ||
Permissions.inventoryAll.gui, | ||
Permissions.loansAll.gui, | ||
Permissions.uiOrganizationsViewEditCreate.gui, | ||
]) | ||
.then((userProperties) => { | ||
userData.username = userProperties.username; | ||
userData.password = userProperties.password; | ||
userData.userId = userProperties.userId; | ||
}) | ||
.then(() => { | ||
Lists.buildQueryOnActiveUsers().then((query) => { | ||
Lists.createQueryViaApi(query).then((createdQuery) => { | ||
listData.queryId = createdQuery.queryId; | ||
listData.fqlQuery = createdQuery.fqlQuery; | ||
listData.fields = ['users.active', 'user.id']; | ||
|
||
Lists.createViaApi(listData).then((body) => { | ||
listData.id = body.id; | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken(); | ||
Lists.deleteViaApi(listData.id); | ||
Users.deleteViaApi(userData.userId); | ||
}); | ||
|
||
it('C418651 Lists (Enable): Can view lists (corsair)', { tags: ['smoke', 'corsair'] }, () => { | ||
cy.login(userData.username, userData.password, { | ||
path: TopMenu.listsPath, | ||
waiter: Lists.waitLoading, | ||
}); | ||
Lists.verifyNewButtonDoesNotExist(); | ||
Lists.verifyListIsPresent(listData.name); | ||
Lists.selectActiveLists(); | ||
Lists.selectInactiveLists(); | ||
Lists.selectPrivateLists(); | ||
Lists.selectSharedLists(); | ||
Lists.selectRecordTypeFilter(listData.recordType); | ||
Lists.resetAllFilters(); | ||
|
||
Lists.openList(listData.name); | ||
Lists.openActions(); | ||
Lists.verifyRefreshListButtonDoesNotExist(); | ||
Lists.verifyEditListButtonDoesNotExist(); | ||
Lists.verifyDuplicateListButtonDoesNotExist(); | ||
Lists.verifyDeleteListButtonDoesNotExist(); | ||
Lists.verifyExportListButtonDoesNotExist(); | ||
}); | ||
}); | ||
}); |
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