Skip to content

Commit 11d299f

Browse files
Add retry logic
1 parent 34322ee commit 11d299f

1 file changed

Lines changed: 56 additions & 45 deletions

File tree

cypress/e2e/lists/create-list/add-new-list.cy.js

Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,64 @@ import Users from '../../../support/fragments/users/users';
55
import { getTestEntityValue } from '../../../support/utils/stringTools';
66

77
describe('Lists', () => {
8-
describe('Add new list', () => {
9-
let userData = {};
10-
const listData = {
11-
name: getTestEntityValue('list'),
12-
};
8+
describe(
9+
'Add new list',
10+
{
11+
retries: {
12+
runMode: 1,
13+
},
14+
},
15+
() => {
16+
let userData = {};
17+
let listData;
18+
19+
beforeEach('Create test data', () => {
20+
listData = {
21+
name: getTestEntityValue('list'),
22+
};
1323

14-
before('Create test data', () => {
15-
cy.getAdminToken();
16-
cy.createTempUser([
17-
Permissions.listsEdit.gui,
18-
Permissions.usersViewRequests.gui,
19-
Permissions.uiOrdersCreate.gui,
20-
Permissions.inventoryAll.gui,
21-
Permissions.loansAll.gui,
22-
Permissions.uiOrganizationsViewEditCreate.gui,
23-
]).then((userProperties) => {
24-
userData = userProperties;
24+
cy.createTempUser([
25+
Permissions.listsEdit.gui,
26+
Permissions.usersViewRequests.gui,
27+
Permissions.uiOrdersCreate.gui,
28+
Permissions.inventoryAll.gui,
29+
Permissions.loansAll.gui,
30+
Permissions.uiOrganizationsViewEditCreate.gui,
31+
]).then((userProperties) => {
32+
userData = userProperties;
33+
});
2534
});
26-
});
2735

28-
after('Delete test data', () => {
29-
cy.getAdminToken();
30-
Lists.deleteListByNameViaApi(listData.name);
31-
Users.deleteViaApi(userData.userId);
32-
});
36+
afterEach('Delete test data', () => {
37+
cy.getAdminToken();
38+
Lists.deleteListByNameViaApi(listData.name);
39+
Users.deleteViaApi(userData.userId);
40+
});
3341

34-
it(
35-
'C411705 Verify that created new list is visible on the "Lists" landing page (corsair)',
36-
{ tags: ['smoke', 'corsair', 'shiftLeft', 'C411705'] },
37-
() => {
38-
cy.login(userData.username, userData.password, {
39-
path: TopMenu.listsPath,
40-
waiter: Lists.waitLoading,
41-
});
42-
Lists.openNewListPane();
43-
Lists.setName(listData.name);
44-
Lists.setDescription(listData.name);
45-
Lists.selectRecordType('Loans');
46-
Lists.selectVisibility('Shared');
47-
Lists.selectStatus('Active');
48-
Lists.saveList();
49-
Lists.verifySuccessCalloutMessage(`List ${listData.name} saved.`);
50-
Lists.closeListDetailsPane();
51-
Lists.findResultRowIndexByContent(listData.name).then((rowIndex) => {
52-
Lists.checkResultSearch(listData, rowIndex);
53-
});
54-
},
55-
);
56-
});
42+
it(
43+
'C411705 Verify that created new list is visible on the "Lists" landing page (corsair)',
44+
{ tags: ['smoke', 'corsair', 'shiftLeft', 'C411705'] },
45+
() => {
46+
cy.login(userData.username, userData.password, {
47+
path: TopMenu.listsPath,
48+
waiter: Lists.waitLoading,
49+
});
50+
Lists.openNewListPane();
51+
Lists.setName(listData.name);
52+
Lists.setDescription(listData.name);
53+
Lists.selectRecordType('Loans');
54+
Lists.selectVisibility('Shared');
55+
Lists.selectStatus('Active');
56+
Lists.saveList();
57+
Lists.verifySuccessCalloutMessage(`List ${listData.name} saved.`);
58+
Lists.verifyRecordsNumber('No');
59+
cy.wait(4000);
60+
Lists.closeListDetailsPane();
61+
Lists.findResultRowIndexByContent(listData.name).then((rowIndex) => {
62+
Lists.checkResultSearch(listData, rowIndex);
63+
});
64+
},
65+
);
66+
},
67+
);
5768
});

0 commit comments

Comments
 (0)