mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[affected:*][ci:force] Fixing e2e - the long painful journey
This commit is contained in:
parent
ec1ab06212
commit
2b85c2aedb
@ -622,7 +622,7 @@
|
||||
"unit": "Byte",
|
||||
"field": "cm:content.size",
|
||||
"min": 0,
|
||||
"max": 18,
|
||||
"max": 4000,
|
||||
"step": 1,
|
||||
"thumbLabel": true
|
||||
}
|
||||
|
@ -136,13 +136,13 @@ describe('CardView Component - properties', () => {
|
||||
await viewerPage.checkInfoSideBarIsDisplayed();
|
||||
await metadataViewPage.clickOnPropertiesTab();
|
||||
|
||||
await CheckboxPage.uncheck(metadataViewPage.defaultPropertiesSwitch);
|
||||
await togglePage.disableToggle(metadataViewPage.defaultPropertiesSwitch);
|
||||
|
||||
await metadataViewPage.checkMetadataGroupIsNotPresent('properties');
|
||||
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
|
||||
await metadataViewPage.checkMetadataGroupIsExpand('Versionable');
|
||||
|
||||
await CheckboxPage.check(metadataViewPage.defaultPropertiesSwitch);
|
||||
await togglePage.enableToggle(metadataViewPage.defaultPropertiesSwitch);
|
||||
|
||||
await metadataViewPage.checkMetadataGroupIsPresent('properties');
|
||||
await metadataViewPage.checkMetadataGroupIsExpand('properties');
|
||||
|
@ -38,8 +38,8 @@ export class MetadataViewPage {
|
||||
multiSwitch = $(`#adf-metadata-multi`);
|
||||
defaultPropertiesSwitch = $('#adf-metadata-default-properties');
|
||||
closeButton = element(by.cssContainingText(`button${materialLocators.Button.class} span`, 'Close'));
|
||||
displayAspect = $(`input[data-placeholder='Display Aspect']`);
|
||||
applyAspect = element(by.cssContainingText(`button span${materialLocators.Button.wrapper}`, 'Apply Aspect'));
|
||||
displayAspect = $(`input[placeholder='Display Aspect']`);
|
||||
applyAspect = element(by.cssContainingText(`button span${materialLocators.Button.label}`, 'Apply Aspect'));
|
||||
saveMetadataButton = $(`[data-automation-id='save-metadata']`);
|
||||
saveGeneralMetadataButton = $(`[data-automation-id='save-general-info-metadata']`);
|
||||
resetMetadataButton = $(`[data-automation-id='reset-metadata']`);
|
||||
|
@ -20,19 +20,19 @@ import { element, by, browser } from 'protractor';
|
||||
|
||||
export class ProcessServiceTabBarPage {
|
||||
|
||||
tasksButton = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class} div`, 'Tasks')).first();
|
||||
processButton = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class} div`, 'Process')).first();
|
||||
reportsButton = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class} div`, 'Reports')).first();
|
||||
tasksButton = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class}`, 'Tasks')).first();
|
||||
processButton = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class}`, 'Process')).first();
|
||||
reportsButton = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class}`, 'Reports')).first();
|
||||
reportsButtonSelected = element.all(by.cssContainingText(`div[class*="${materialLocators.Tab.label.root}"] ${materialLocators.Tab.labels.class} div[aria-selected="true"]`, 'Reports')).first();
|
||||
|
||||
async clickTasksButton(): Promise<void> {
|
||||
await BrowserActions.click(this.tasksButton);
|
||||
await browser.sleep(500);
|
||||
await browser.sleep(100);
|
||||
}
|
||||
|
||||
async clickProcessButton(): Promise<void> {
|
||||
await BrowserActions.click(this.processButton);
|
||||
await browser.sleep(500);
|
||||
await browser.sleep(100);
|
||||
}
|
||||
|
||||
async clickReportsButton(): Promise<void> {
|
||||
|
@ -99,7 +99,7 @@ describe('Search Slider Filter', () => {
|
||||
});
|
||||
|
||||
it('[C276972] Should be keep value when Search Size Slider is collapsed', async () => {
|
||||
const size = 5;
|
||||
const size = 10;
|
||||
|
||||
await searchFilters.checkSizeSliderFilterIsDisplayed();
|
||||
await searchFilters.clickSizeSliderFilterHeader();
|
||||
|
@ -1,14 +1,11 @@
|
||||
<mat-slider
|
||||
[min]="min"
|
||||
[max]="max"
|
||||
[step]="step"
|
||||
class="adf-search-slider"
|
||||
data-automation-id="slider-range" #ngSlider><input matSliderThumb />
|
||||
<input
|
||||
matSliderThumb
|
||||
(change)="onChangedHandler({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value})"
|
||||
#ngSliderThumb="matSliderThumb"
|
||||
[(value)]="value" />
|
||||
data-automation-id="slider-range"
|
||||
[max]="max"
|
||||
[min]="min"
|
||||
[step]="step"
|
||||
[discrete]="thumbLabel">
|
||||
<input matSliderThumb (change)="onChangedHandler()" [(ngModel)]="value">
|
||||
</mat-slider>
|
||||
|
||||
<div class="adf-facet-buttons" *ngIf="!settings?.hideDefaultAction">
|
||||
|
@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatSliderChange } from '@angular/material/slider';
|
||||
import { SearchSliderComponent } from './search-slider.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
@ -49,14 +48,6 @@ describe('SearchSliderComponent', () => {
|
||||
expect(component.thumbLabel).toEqual(settings.thumbLabel);
|
||||
});
|
||||
|
||||
it('should update value on slider change', () => {
|
||||
component.onChangedHandler({ value: 10 } as MatSliderChange);
|
||||
expect(component.value).toEqual(10);
|
||||
|
||||
component.onChangedHandler({ value: 20 } as MatSliderChange);
|
||||
expect(component.value).toEqual(20);
|
||||
});
|
||||
|
||||
it('should update its query part on slider change', () => {
|
||||
const context: any = {
|
||||
queryFragments: {},
|
||||
@ -68,13 +59,15 @@ describe('SearchSliderComponent', () => {
|
||||
component.context = context;
|
||||
component.id = 'contentSize';
|
||||
component.settings = { field: 'cm:content.size' };
|
||||
component.value = 10;
|
||||
fixture.detectChanges();
|
||||
|
||||
component.onChangedHandler({ value: 10 } as MatSliderChange);
|
||||
component.onChangedHandler();
|
||||
expect(context.queryFragments[component.id]).toEqual('cm:content.size:[0 TO 10]');
|
||||
expect(context.update).toHaveBeenCalled();
|
||||
|
||||
component.onChangedHandler({ value: 20 } as MatSliderChange);
|
||||
component.value = 20;
|
||||
component.onChangedHandler();
|
||||
expect(context.queryFragments[component.id]).toEqual('cm:content.size:[0 TO 20]');
|
||||
});
|
||||
|
||||
|
@ -19,7 +19,6 @@ import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { SearchWidget } from '../../models/search-widget.interface';
|
||||
import { SearchWidgetSettings } from '../../models/search-widget-settings.interface';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
import { MatSliderChange } from '@angular/material/slider';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@ -82,8 +81,7 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
|
||||
this.updateQuery(null);
|
||||
}
|
||||
|
||||
onChangedHandler(event: MatSliderChange) {
|
||||
this.value = event.value;
|
||||
onChangedHandler() {
|
||||
if (this.enableChangeUpdate) {
|
||||
this.updateQuery(this.value);
|
||||
}
|
||||
|
@ -44,8 +44,9 @@ export class SearchSliderPage {
|
||||
|
||||
async setValue(value: number): Promise<void> {
|
||||
const elem = this.filter.$(this.slider).$('.mdc-slider__thumb-knob');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elem);
|
||||
await browser.actions().mouseMove(elem, { x: 0, y: 0 }).perform();
|
||||
await browser.actions().mouseDown().mouseMove({x: value * 25, y: 0}).mouseUp().perform();
|
||||
await browser.actions().mouseDown().mouseMove({x: value * 7, y: 0}).mouseUp().perform();
|
||||
}
|
||||
|
||||
async checkSliderIsDisplayed(): Promise<void> {
|
||||
|
@ -31,7 +31,7 @@ export const materialLocators = {
|
||||
Button: {
|
||||
class: '.mat-mdc-button',
|
||||
disabled: 'mat-button-disabled',
|
||||
wrapper: '.mat-mdc-button-wrapper'
|
||||
label: '.mdc-button__label'
|
||||
},
|
||||
Calendar: {
|
||||
root: 'mat-calendar',
|
||||
@ -394,7 +394,7 @@ export const materialLocators = {
|
||||
},
|
||||
label: {
|
||||
class: '.mdc-tab',
|
||||
root: 'mat-tab-label',
|
||||
root: 'mat-mdc-tab-labels',
|
||||
active: {
|
||||
class: '.mdc-tab--active',
|
||||
root: 'mat-tab-label-active'
|
||||
|
@ -24,7 +24,7 @@ export class TogglePage {
|
||||
async enableToggle(toggle: ElementFinder): Promise<void> {
|
||||
const check = await BrowserActions.getAttribute(toggle, 'class');
|
||||
if (check.indexOf(materialLocators.Checked.root) < 0) {
|
||||
const elem = toggle.$$('input').first();
|
||||
const elem = toggle.$$('button').first();
|
||||
await BrowserActions.clickScript(elem);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user