mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
* Trigger alpha * [ADF-4807] Automation tests for date min/max validation * Removing identityUser changes
69 lines
2.8 KiB
TypeScript
69 lines
2.8 KiB
TypeScript
/*!
|
|
* @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');
|
|
});
|
|
|
|
});
|