mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4650] Fix and refactor amount, date and date-time widgets (#4957)
* [ADF-4650] Fix and refactor amount, date and date-time widgets * fix e2e tests * Fix people cloud test * Fix e2e date test * fix lint
This commit is contained in:
committed by
Eugenio Romano
parent
624ca9f0ae
commit
479416861f
@@ -97,30 +97,24 @@ describe('People Groups Cloud Component', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
||||
for (let i = 0; i < users.length; i++) {
|
||||
await identityService.deleteIdentityUser(users[i]);
|
||||
}
|
||||
for (let i = 0; i < groups.length; i++) {
|
||||
await groupIdentityService.deleteIdentityGroup(groups[i]);
|
||||
}
|
||||
users.forEach(async (user) => {
|
||||
await identityService.deleteIdentityUser(user);
|
||||
});
|
||||
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
await identityService.deleteIdentityUser(apsUser.idIdentityService);
|
||||
await identityService.deleteIdentityUser(activitiUser.idIdentityService);
|
||||
groups.forEach(async (group) => {
|
||||
await groupIdentityService.deleteIdentityGroup(group);
|
||||
});
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(async () => {
|
||||
await browser.refresh();
|
||||
navigationBarPage.navigateToPeopleGroupCloudPage();
|
||||
peopleGroupCloudComponentPage.checkGroupsCloudComponentTitleIsDisplayed();
|
||||
peopleGroupCloudComponentPage.checkPeopleCloudComponentTitleIsDisplayed();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await browser.refresh();
|
||||
});
|
||||
|
||||
describe('[C297674] Should be able to add filtering to People Cloud Component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -303,7 +297,6 @@ describe('People Groups Cloud Component', () => {
|
||||
`{"firstName":"${activitiUser.firstName}","lastName":"${activitiUser.lastName}",{"firstName":"${noRoleUser.firstName}","lastName":"${noRoleUser.lastName}"]`);
|
||||
browser.sleep(200);
|
||||
expect(peopleCloudComponent.getAssigneeFieldContent()).toBe('');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -86,7 +86,7 @@ describe('Form Component', () => {
|
||||
|
||||
widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
|
||||
widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
|
||||
widget.dateWidget().clickOutsideWidget(fields.dateWidgetId);
|
||||
formPage.saveForm();
|
||||
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
|
||||
formPage.checkErrorLogMessage(message.errorLogDate);
|
||||
|
||||
|
@@ -91,16 +91,14 @@ describe('Date and time widget', () => {
|
||||
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().closeDataTimeWidget();
|
||||
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-17 07:30 PM');
|
||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
||||
taskPage.formFields().saveForm();
|
||||
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be less than');
|
||||
|
||||
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().closeDataTimeWidget();
|
||||
|
||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().removeFromDatetimeWidget(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().closeDataTimeWidget();
|
||||
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-19 07:30 PM');
|
||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
||||
taskPage.formFields().saveForm();
|
||||
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be greater than');
|
||||
});
|
||||
});
|
||||
|
@@ -78,17 +78,17 @@ describe('Date widget', () => {
|
||||
expect(widget.dateWidget().getDateLabel(app.FIELD.date_input)).toContain('Date');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.dateWidget().setDateInput(app.FIELD.date_input, '20-10-2018');
|
||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_input);
|
||||
taskPage.formFields().saveForm();
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C277234] Should be able to set advanced settings for Date widget ', () => {
|
||||
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2017');
|
||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_between_input);
|
||||
taskPage.formFields().saveForm();
|
||||
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be less than 1-10-2018');
|
||||
widget.dateWidget().clearDateInput(app.FIELD.date_between_input);
|
||||
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2019');
|
||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_between_input);
|
||||
taskPage.formFields().saveForm();
|
||||
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be greater than 31-10-2018');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user