Skip to content

Commit

Permalink
implemented new tests on list permissions FAT-16533 FAT-16534
Browse files Browse the repository at this point in the history
  • Loading branch information
ostapwd committed Sep 30, 2024
1 parent 2e42c95 commit f727601
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions cypress/e2e/lists/permissions/lists-refresh-permissions.cy.js
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();
});
});
});

0 comments on commit f727601

Please sign in to comment.