Merge pull request #216 from Alfresco/adding_data_automation_id_for_search

Adding data automation id for search
This commit is contained in:
Mario Romano
2016-06-17 17:32:40 +01:00
committed by GitHub
3 changed files with 12 additions and 12 deletions

View File

@@ -1,8 +1,8 @@
<table *ngIf="results && results.length && searchTerm" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
<table data-automation-id="autocomplete_results" *ngIf="results && results.length && searchTerm" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
<tbody>
<tr *ngFor="let result of results; let idx = index">
<td><a href="#" (click)="onItemClick(result, $event)">{{result.entry.name}}</a></td>
<td><a attr.data-automation-id="autocomplete_result_for_{{result.entry.name}}" href="#" (click)="onItemClick(result, $event)">{{result.entry.name}}</a></td>
</tr>
</tbody>
</table>
<p *ngIf="errorMessage">{{ 'SEARCH.RESULTS.ERROR' | translate:{errorMessage: errorMessage} }}</p>
<p data-automation-id="autocomplete_error_message" *ngIf="errorMessage">{{ 'SEARCH.RESULTS.ERROR' | translate:{errorMessage: errorMessage} }}</p>

View File

@@ -4,7 +4,7 @@
<i class="material-icons">search</i>
</label>
<div [class]="getTextFieldHolderClassName()">
<input class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()"
<input class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()" data-automation-id="search_input"
id="searchControl" [ngFormControl]="searchControl" [(ngModel)]="searchTerm" (focus)="onFocus($event)" (blur)="onBlur($event)">
<label class="mdl-textfield__label" for="searchControl">{{'SEARCH.CONTROL.LABEL' | translate}}</label>
</div>

View File

@@ -1,6 +1,6 @@
<p *ngIf="results && results.length">{{ 'SEARCH.RESULTS.SUMMARY' | translate:{numResults: results.length, searchTerm: searchTerm} }}</p>
<p *ngIf="results&& results.length == 0">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}</p>
<table *ngIf="results && results.length && searchTerm" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
<p data-automation-id="search_result_found" *ngIf="results && results.length">{{ 'SEARCH.RESULTS.SUMMARY' | translate:{numResults: results.length, searchTerm: searchTerm} }}</p>
<p data-automation-id="search_no_result_found" *ngIf="results&& results.length == 0">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}</p>
<table data-automation-id="search_result_table" *ngIf="results && results.length && searchTerm" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
<thead>
<tr>
<th>
@@ -18,13 +18,13 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let result of results; let idx = index" >
<td><img src="{{getDocumentThumbnailUrl(result)}}" /></td>
<td>{{result.entry.name}}</td>
<td>{{result.entry.modifiedByUser.displayName}}</td>
<td attr.data-automation-id=file_{{result.entry.name}}>{{result.entry.name}}</td>
<td attr.data-automation-id=file_{{result.entry.name}}_{{result.entry.modifiedByUser.displayName}}>{{result.entry.modifiedByUser.displayName}}</td>
<td>{{result.entry.modifiedAt}}</td>
</tr>
</tbody>
</table>
<p *ngIf="errorMessage">{{ 'SEARCH.RESULTS.ERROR' | translate:{errorMessage: errorMessage} }}</p>
<p data-automation-id="search_error_message" *ngIf="errorMessage">{{ 'SEARCH.RESULTS.ERROR' | translate:{errorMessage: errorMessage} }}</p>