mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6107] Replaced SearchDateRange component with SearchDateRangeAdvanced Component (#9023)
* [ACS-6107] Removed date range component from ADF content-services * [ACS-6107] Removed references of date range component in code * [ACS-6107] Updated documentation to replace occurrences of date range component with date-range-advanced-tabbed component * [ACS-6107] Renamed DateRangeAdvanced to DateRange. Renamed DateRangeAdvancedTabbed to DateRangeTabbed * [ACS-6107] Fixed missing export of SearchDateRangeTabbedComponent * [ACS-6107] Replaced occurrences of date-range-advanced with date-range in HTML and Unit Tests automation ids * [ACS-6107] Documentation corrections * [ACS-6107] Reverted unneeded documentation formatting * [ACS-6107] Reverted unneeded documentation formatting * [ACS-6107] Reverted unneeded documentation formatting * [ACS-6107] Migrated unneeded E2E test case to unit test * [ACS-6107] Removed search-date-range E2E * [ACS-6107] Resolved PR comments. Removed date-range-filter.page.ts. Removed unused translation keys. Updated documentation to refer proper comment name * [ACS-6107] Updated documentation for SearchDateRange component to mention the change from original configuration to the newer configuration * [ACS-6107] Corrected wrong version in documentation * [ci:force] * [ACS-6107] Removed unneeded file * [ACS-6107] Updated unit tests and mock data after rebase * [ci:force] * [ACS-6107] Revert unneeded change. Remove unneeded file * [ci:force] * [ACS-6107] Updated E2E search config * [ci:force] * [ACS-6107] Updated E2E expects after component changes * [ci:force]
This commit is contained in:
@@ -1,141 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* 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 { protractor, ElementFinder, $ } from 'protractor';
|
||||
import { DatePickerCalendarPage } from '../../../core/pages/material/date-picker-calendar.page';
|
||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||
|
||||
export class DateRangeFilterPage {
|
||||
fromField = '[data-automation-id="date-range-from-input"]';
|
||||
fromDateToggle = '[data-automation-id="date-range-from-date-toggle"]';
|
||||
toField = '[data-automation-id="date-range-to-input"]';
|
||||
toDateToggle = '[data-automation-id="date-range-to-date-toggle"]';
|
||||
applyButton = '[data-automation-id="date-range-apply-btn"]';
|
||||
clearButton = '[data-automation-id="date-range-clear-btn"]';
|
||||
fromErrorMessage = '[data-automation-id="date-range-from-error"]';
|
||||
toErrorMessage = '[data-automation-id="date-range-to-error"]';
|
||||
filter: ElementFinder;
|
||||
|
||||
constructor(filter: ElementFinder) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
async getFromDate(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.filter.$(this.fromField));
|
||||
}
|
||||
|
||||
async putFromDate(date): Promise<void> {
|
||||
await this.checkFromFieldIsDisplayed();
|
||||
await BrowserActions.clearSendKeys(this.filter.$(this.fromField), date);
|
||||
await this.filter.$(this.fromField).sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async getFromCalendarSelectedDate(): Promise<string> {
|
||||
const datePicker = await this.openFromDatePicker();
|
||||
const selectedDate = await datePicker.getSelectedDate();
|
||||
await datePicker.closeDatePicker();
|
||||
return selectedDate;
|
||||
}
|
||||
|
||||
async openFromDatePicker(): Promise<DatePickerCalendarPage> {
|
||||
await BrowserActions.click(this.filter.$(this.fromDateToggle));
|
||||
|
||||
const datePicker = new DatePickerCalendarPage();
|
||||
await datePicker.checkDatePickerIsDisplayed();
|
||||
return datePicker;
|
||||
}
|
||||
|
||||
async openToDatePicker(): Promise<DatePickerCalendarPage> {
|
||||
await BrowserActions.click(this.filter.$(this.toDateToggle));
|
||||
const datePicker = new DatePickerCalendarPage();
|
||||
await datePicker.checkDatePickerIsDisplayed();
|
||||
return datePicker;
|
||||
}
|
||||
|
||||
async clickFromField(): Promise<void> {
|
||||
await BrowserActions.click(this.filter.$(this.fromField));
|
||||
}
|
||||
|
||||
async checkFromErrorMessageIsDisplayed(msg: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromErrorMessage));
|
||||
const text = await BrowserActions.getText(this.filter.$(this.fromErrorMessage));
|
||||
await expect(text).toEqual(msg);
|
||||
}
|
||||
|
||||
async checkFromErrorMessageIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.fromErrorMessage));
|
||||
}
|
||||
|
||||
async checkFromFieldIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromField));
|
||||
}
|
||||
|
||||
async checkFromDateToggleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromDateToggle));
|
||||
}
|
||||
|
||||
async getToDate(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.filter.$(this.toField));
|
||||
}
|
||||
|
||||
async putToDate(date): Promise<void> {
|
||||
await this.checkToFieldIsDisplayed();
|
||||
await BrowserActions.clearSendKeys($(this.toField), date);
|
||||
await this.filter.$(this.toField).sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async clickToField(): Promise<void> {
|
||||
await BrowserActions.click(this.filter.$(this.toField));
|
||||
}
|
||||
|
||||
async checkToErrorMessageIsDisplayed(msg): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toErrorMessage));
|
||||
const text = await BrowserActions.getText(this.filter.$(this.toErrorMessage));
|
||||
await expect(text).toEqual(msg);
|
||||
}
|
||||
|
||||
async checkToFieldIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toField));
|
||||
}
|
||||
|
||||
async checkToDateToggleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toDateToggle));
|
||||
}
|
||||
|
||||
async clickApplyButton(): Promise<void> {
|
||||
await BrowserActions.click(this.filter.$(this.applyButton));
|
||||
}
|
||||
|
||||
async checkApplyButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.applyButton));
|
||||
}
|
||||
|
||||
async checkApplyButtonIsEnabled(): Promise<void> {
|
||||
const isEnabled = await this.filter.$(this.applyButton).isEnabled();
|
||||
await expect(isEnabled).toBe(true);
|
||||
}
|
||||
|
||||
async checkApplyButtonIsDisabled(): Promise<void> {
|
||||
const isEnabled = await this.filter.$(this.applyButton).isEnabled();
|
||||
await expect(isEnabled).toBe(false);
|
||||
}
|
||||
|
||||
async checkClearButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.clearButton));
|
||||
}
|
||||
}
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
export * from './search-categories.page';
|
||||
export * from './date-range-filter.page';
|
||||
export * from './number-range-filter.page';
|
||||
export * from './search-check-list.page';
|
||||
export * from './search-radio.page';
|
||||
|
@@ -19,7 +19,6 @@ import { ElementFinder } from 'protractor';
|
||||
import { SearchTextPage } from './search-text.page';
|
||||
import { SearchCheckListPage } from './search-check-list.page';
|
||||
import { SearchRadioPage } from './search-radio.page';
|
||||
import { DateRangeFilterPage } from './date-range-filter.page';
|
||||
import { NumberRangeFilterPage } from './number-range-filter.page';
|
||||
import { SearchSliderPage } from './search-slider.page';
|
||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||
@@ -39,10 +38,6 @@ export class SearchCategoriesPage {
|
||||
return new SearchRadioPage(filter);
|
||||
}
|
||||
|
||||
static dateRangeFilter(filter: ElementFinder): DateRangeFilterPage {
|
||||
return new DateRangeFilterPage(filter);
|
||||
}
|
||||
|
||||
static numberRangeFilter(filter: ElementFinder): NumberRangeFilterPage {
|
||||
return new NumberRangeFilterPage(filter);
|
||||
}
|
||||
|
Reference in New Issue
Block a user