[ACA-990] add tests for Recent Files, Shared Files and location redirect (#105)

* add tests for Recent Files and Shared Files list views
add tests for location redirect

* small fix
This commit is contained in:
Adina Parpalita
2017-12-04 06:10:23 +02:00
committed by Cilibiu Bogdan
parent 39458aa97a
commit 43b020ca51
8 changed files with 403 additions and 51 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { ElementFinder, ElementArrayFinder, by } from 'protractor';
import { ElementFinder, ElementArrayFinder, by, promise } from 'protractor';
import { Menu } from '../menu/menu';
import { Component } from '../component';
@@ -34,4 +34,22 @@ export class ToolbarBreadcrumb extends Component {
getNthItem(nth: number): ElementFinder {
return this.items.get(nth - 1);
}
getItemsCount(): promise.Promise<number> {
return this.items.count();
}
getFirstItemName(): promise.Promise<string> {
return this.items.get(0).getAttribute('title');
}
getCurrentItem(): promise.Promise<ElementFinder> {
return this.getItemsCount()
.then(count => this.getNthItem(count));
}
getCurrentItemName(): promise.Promise<string> {
return this.getCurrentItem()
.then(node => node.getAttribute('title'));
}
}