mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4807] Automation tests for date min/max validation (#5008)
* Trigger alpha * [ADF-4807] Automation tests for date min/max validation * Removing identityUser changes
This commit is contained in:
committed by
Eugenio Romano
parent
53471eae84
commit
8ee3e25caf
68
e2e/process-services-cloud/form-field/date-widget.e2e.ts
Normal file
68
e2e/process-services-cloud/form-field/date-widget.e2e.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
LoginSSOPage,
|
||||
SettingsPage,
|
||||
Widget,
|
||||
BrowserActions, FormPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { customDateFormAPS2 } from '../../resources/forms/custom-date-form';
|
||||
import { FormCloudDemoPage } from '../../pages/adf/demo-shell/process-services-cloud/cloudFormDemoPage';
|
||||
|
||||
describe('Form Field Component - Dropdown Widget', () => {
|
||||
const loginSSOPage = new LoginSSOPage();
|
||||
const settingsPage = new SettingsPage();
|
||||
const widget = new Widget();
|
||||
const dateWidget = widget.dateWidget();
|
||||
|
||||
const formDemoPage = new FormCloudDemoPage();
|
||||
const formJson = JSON.parse(customDateFormAPS2);
|
||||
const formPage = new FormPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await settingsPage.setProviderBpmSso(
|
||||
browser.params.config.bpmHost,
|
||||
browser.params.config.oauth2.host,
|
||||
browser.params.config.identityHost);
|
||||
await loginSSOPage.loginSSOIdentityService(browser.params.identityUser.email, browser.params.identityUser.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
const urlFormDemoPage = `${browser.params.testConfig.adf.url}/form-cloud`;
|
||||
await BrowserActions.getUrl(urlFormDemoPage);
|
||||
});
|
||||
|
||||
it('[C313199] Should display the validation for min and max date values with custom date format', async () => {
|
||||
await formDemoPage.setConfigToEditor(formJson);
|
||||
await dateWidget.setDateInput('datefield', '18-7-19');
|
||||
await formPage.saveForm();
|
||||
await expect(await dateWidget.getErrorMessage('datefield'))
|
||||
.toBe('Can\'t be less than 19-7-19', 'Min date validation is not working');
|
||||
await dateWidget.clearDateInput('datefield');
|
||||
await dateWidget.setDateInput('datefield', '20-7-19');
|
||||
await formPage.saveForm();
|
||||
await expect(await dateWidget.getErrorMessage('datefield'))
|
||||
.toBe('Can\'t be greater than 19-8-19', 'Max date validation is not working');
|
||||
await dateWidget.clearDateInput('datefield');
|
||||
await dateWidget.setDateInput('datefield', '19-7-19');
|
||||
await formPage.saveForm();
|
||||
await dateWidget.checkErrorMessageIsNotDisplayed('datefield');
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user