Skip to content

Commit

Permalink
* FIxed process-service cloud e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
sivakumar414ram committed May 5, 2020
1 parent cc7ccab commit 035286b
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion e2e/pages/adf/process-services/process-filters.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class ProcessFiltersPage {
rows: Locator = by.css('adf-process-instance-list div[class="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
tableBody: ElementFinder = element.all(by.css('adf-datatable div[class="adf-datatable-body"]')).first();
nameColumn: Locator = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[title="Name"] span');
processIcon: ElementFinder = element(by.css('.adf-icon'));
processIcon: ElementFinder = element(by.css('adf-icon[data-automation-id="adf-filter-icon"]'));

async startProcess(): Promise<StartProcessPage> {
await this.clickCreateProcessButton();
Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/adf/process-services/task-filters.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class TaskFiltersPage {

filter;
taskIcon: ElementFinder = element(by.css('.adf-icon'));
taskIcon: ElementFinder = element(by.css('adf-icon[data-automation-id="adf-filter-icon"]'));

constructor(filter: ElementFinder) {
this.filter = filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<button (click)="selectFilterById(filter.id)"
[attr.aria-label]="filter.name | translate"
[id]="filter.id"
[attr.data-automation-id]="filter.name + '_filter'"
[attr.data-automation-id]="filter.key + '_filter'"
mat-button
class="adf-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<adf-icon *ngIf="showIcons" [value]="filter.icon"></adf-icon>
<span class="adf-action-button__label">{{ filter.name | translate }}</span>
class="adf-filter-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<adf-icon data-automation-id="adf-filter-icon" *ngIf="showIcons" [value]="filter.icon"></adf-icon>
<span data-automation-id="adf-filter-label" class="adf-filter-action-button__label">{{ filter.name | translate }}</span>
</button>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
width: 100%;
}

.adf-action-button .adf-action-button__label {
.adf-filter-action-button .adf-filter-action-button__label {
padding-left: 20px;
margin: 0 8px !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('ProcessFiltersCloudComponent', () => {
const fakeGlobalFilter = [
new ProcessFilterCloudModel({
name: 'FakeAllProcesses',
key: 'FakeAllProcesses',
icon: 'adjust',
id: '10',
status: ''
Expand Down Expand Up @@ -278,7 +279,7 @@ describe('ProcessFiltersCloudComponent', () => {
done();
});

const filterButton = fixture.debugElement.nativeElement.querySelector(`[data-automation-id="${fakeGlobalFilter[0].name}_filter"]`);
const filterButton = fixture.debugElement.nativeElement.querySelector(`[data-automation-id="${fakeGlobalFilter[0].key}_filter"]`);
filterButton.click();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<button (click)="selectFilterAndEmit(filter)"
[attr.aria-label]="filter.name | translate"
[id]="filter.id"
[attr.data-automation-id]="filter.name + '_filter'"
[attr.data-automation-id]="filter.key + '_filter'"
mat-button
class="adf-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<adf-icon *ngIf="showIcons" [value]="filter.icon"></adf-icon>
<span class="adf-action-button__label">{{ filter.name | translate }}</span>
class="adf-filter-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<adf-icon data-automation-id="adf-filter-icon" *ngIf="showIcons" [value]="filter.icon"></adf-icon>
<span data-automation-id="adf-filter-label" class="adf-filter-action-button__label">{{ filter.name | translate }}</span>
</button>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
width: 100%;
}

.adf-action-button .adf-action-button__label {
.adf-filter-action-button .adf-filter-action-button__label {
padding-left: 20px;
margin: 0 8px !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe('TaskFiltersCloudComponent', () => {

fixture.detectChanges();
spyOn(component, 'selectFilterAndEmit').and.stub();
const filterButton = fixture.debugElement.nativeElement.querySelector(`[data-automation-id="${fakeGlobalFilter[1].name}_filter"]`);
const filterButton = fixture.debugElement.nativeElement.querySelector(`[data-automation-id="${fakeGlobalFilter[1].key}_filter"]`);

filterButton.click();
expect(component.selectFilterAndEmit).toHaveBeenCalledWith(fakeGlobalFilter[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[id]="filter.id"
[attr.data-automation-id]="filter.name + '_filter'"
mat-button
class="adf-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<adf-icon *ngIf="showIcon" [value]="getFilterIcon(filter.icon)"></adf-icon>
<span class="adf-action-button__label">{{ filter.name | translate }}</span>
class="adf-filter-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<adf-icon data-automation-id="adf-filter-icon" *ngIf="showIcon" [value]="getFilterIcon(filter.icon)"></adf-icon>
<span data-automation-id="adf-filter-label" class="adf-filter-action-button__label">{{ filter.name | translate }}</span>
</button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
width: 100%;
}

.adf-action-button .adf-action-button__label {
.adf-filter-action-button .adf-filter-action-button__label {
padding-left: 20px;
margin: 0 8px !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[id]="filter.id"
[attr.data-automation-id]="filter.name + '_filter'"
mat-button
class="adf-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
class="adf-filter-action-button adf-full-width" fxLayout="row" fxLayoutAlign="space-between center">
<ng-container *ngIf="showIcon">
<adf-icon [value]="getFilterIcon(filter.icon)"></adf-icon>
<adf-icon data-automation-id="adf-filter-icon" [value]="getFilterIcon(filter.icon)"></adf-icon>
</ng-container>
<span class="adf-action-button__label">{{ filter.name | translate }}</span>
<span data-automation-id="adf-filter-label" class="adf-filter-action-button__label">{{ filter.name | translate }}</span>
</button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
width: 100%;
}

.adf-action-button .adf-action-button__label {
.adf-filter-action-button .adf-filter-action-button__label {
padding-left: 20px;
margin: 0 8px !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ProcessFiltersCloudComponentPage {

processFilters: ElementFinder = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));

activeFilter: ElementFinder = element(by.css('.adf-active'));
activeFilter: ElementFinder = element(by.css('.adf-active [data-automation-id="adf-filter-label"]'));
processFiltersList: ElementFinder = element(by.css('adf-cloud-process-filters'));

async checkProcessFilterIsDisplayed(filterName: string): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TaskFiltersCloudComponentPage {

filter: ElementFinder;
taskFilters: ElementFinder = element(by.css(`mat-expansion-panel[data-automation-id='Task Filters']`));
activeFilter: ElementFinder = element(by.css('.adf-active'));
activeFilter: ElementFinder = element(by.css('.adf-active [data-automation-id="adf-filter-label"]'));

async checkTaskFilterIsDisplayed(filterName: string): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
Expand Down
2 changes: 1 addition & 1 deletion lib/testing/src/lib/process-services/pages/filters.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class FiltersPage {

accordionMenu: ElementFinder = element(by.css('.app-processes-menu mat-accordion'));
buttonWindow: ElementFinder = element(by.css('div > button[data-automation-id="btn-start-process"] > div'));
processIcon: ElementFinder = element(by.css('.adf-icon'));
processIcon: ElementFinder = element(by.css('adf-icon[data-automation-id="adf-filter-icon"]'));

async clickFilterButton(filterElement: ElementFinder): Promise<void> {
await BrowserActions.click(filterElement);
Expand Down

0 comments on commit 035286b

Please sign in to comment.