Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C409495: Filters section: Users filter (Firebird) (TaaS) #2416

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
@@ -0,0 +1,43 @@
import permissions from '../../../support/dictionary/permissions';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, move file to bulk-edit/logs
bulk-edit-filter-section-user-filter-page.cy.js

import TopMenu from '../../../support/fragments/topMenu';
import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane';
import users from '../../../support/fragments/users/users';

let user;
describe('bulk-edit', () => {
before('create test users', () => {
cy.createTempUser([
permissions.bulkEditLogsView.gui,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permissions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what need to be done here? I gave required permissions as per testcase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just code convension Premissions

permissions.bulkEditCsvView.gui,
permissions.bulkEditView.gui,
]).then((userProperties) => {
user = userProperties;
cy.login(user.username, user.password, {
path: TopMenu.bulkEditPath,
waiter: BulkEditSearchPane.waitLoading,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed precondtion from TC
The FOLIO contains completed Bulk Edit jobs, jobs were run by different Users
Ask AQA from Firebird team how to do this (Guliyashnar Nayimova (nayimovag))

});
});

after('delete test data', () => {
cy.getAdminToken();
users.deleteViaApi(user.userId);
});

it('Filters section: Users filter', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add TC id, tags and names for dev teams. See other tests

BulkEditSearchPane.openLogsSearch();
BulkEditSearchPane.verifyLogsPane();
BulkEditSearchPane.checkHoldingsCheckbox();
BulkEditSearchPane.checkItemsCheckbox();
BulkEditSearchPane.checkUsersCheckbox();
BulkEditSearchPane.verifyLogsTableHeaders();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed some expected results from Step2
Missed lots of expected results. Please add it

BulkEditSearchPane.clickUserAccordion();
BulkEditSearchPane.clickChooseUserUnderUserAccordion();
BulkEditSearchPane.searchAndSelectUser('Test_All');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the user 'Test_All'?
I suppose need to create User via API in before section and delete it in after section
See another tests
Users.createViaApi...

BulkEditSearchPane.xAppearsNextToUser();
BulkEditSearchPane.resetAllBtnIsDisabled(false);
BulkEditSearchPane.clickOnXAppearsNextToUser();
BulkEditSearchPane.clickChooseUserUnderUserAccordion();
BulkEditSearchPane.searchUser('AJDKSF');
});
});
31 changes: 31 additions & 0 deletions cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js
Expand Up @@ -15,11 +15,14 @@ import {
MultiColumnListRow,
TextField,
Image,
SelectionList,
IconButton,
} from '../../../../interactors';
import { ListRow } from '../../../../interactors/multi-column-list';

const bulkEditIcon = Image({ alt: 'View and manage bulk edit' });
const logsStartDateAccordion = Accordion('Started');
const logsUsersAccordion = Accordion('User');
const logsEndDateAccordion = Accordion('Ended');
const applyBtn = Button('Apply');
const logsResultPane = Pane({ id: 'bulk-edit-logs-pane' });
Expand Down Expand Up @@ -47,6 +50,8 @@ const logsStatusesAccordion = Accordion('Statuses');
const saveAndClose = Button('Save and close');
const textFildTo = TextField('To');
const textFildFrom = TextField('From');
const buttonChooseUser = Button('Select control\nChoose user');
const xIconButtonUser = IconButton('Clear selected filters for "[object Object]"');
const confirmChanges = Button('Confirm changes');
const triggerBtn = DropdownMenu().find(Button('File that was used to trigger the bulk edit'));
const errorsEncounteredBtn = DropdownMenu().find(
Expand Down Expand Up @@ -82,6 +87,14 @@ export default {
cy.expect(searchButton.has({ disabled: isDisabled }));
},

xAppearsNextToUser() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verifyUserAccordionHasXIcon() {
cy.expect(Section({ id: 'userId'}).find(Button({icon: 'times-circle-solid' })).exists())
}

cy.expect(xIconButtonUser.exists());
},

clickOnXAppearsNextToUser() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearUserAccordion() {
cy.expect(Section({ id: 'userId'}).find(Button({icon: 'times-circle-solid' })).click())
}

cy.get('[icon="times-circle-solid"]').eq(1).click();
},

resetAllBtnIsDisabled(isDisabled) {
cy.expect(resetAllButton.has({ disabled: isDisabled }));
},
Expand Down Expand Up @@ -917,6 +930,24 @@ export default {
]);
},

clickUserAccordion() {
cy.do(logsUsersAccordion.clickHeader());
},

clickChooseUserUnderUserAccordion() {
cy.do(logsUsersAccordion.find(buttonChooseUser).click());
},

searchUser(name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verifyUserIsNotInUserList() {
cy.do([Selection(id...).open(), SelectionList().find(SelectionOption(name)).absent()]);
}

SelectionList().filter(name);
cy.get('[placeholder="Filter options list"]').type(name);
cy.contains('List is empty').should('be.visible');
cy.contains('No matching option').should('be.visible');
},
searchAndSelectUser(name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cy.do([Selection(id...).open(), SelectionList().select(user)]);

clickChooseUserUnderUserAccordion is redundant

cy.do([SelectionList().filter(name), SelectionList().select(including(name))]);
},

fillLogsEndDate(fromDate, toDate) {
cy.do([
logsEndDateAccordion.clickHeader(),
Expand Down