33 lines
734 B
TypeScript
33 lines
734 B
TypeScript
import { browser, element, by} from 'protractor';
|
|
import { ExpectedConditions as EC} from 'protractor';
|
|
import {EditTaskPage} from './edit-task.po';
|
|
|
|
export class TaskListPage {
|
|
|
|
navigateTo() {
|
|
return browser.get('/tasks');
|
|
}
|
|
|
|
searchForTasks(term: string) {
|
|
element(by.css('#search-tasks')).sendKeys(term);
|
|
browser.sleep(500);
|
|
}
|
|
|
|
getTaskCount() {
|
|
return element.all(by.className('task-list-entry')).count();
|
|
}
|
|
|
|
gotoNewTaskView() {
|
|
element(by.linkText('Neue Aufgabe anlegen')).click();
|
|
return new EditTaskPage();
|
|
}
|
|
|
|
checkTaskDisplayed(text: string) {
|
|
const taskLink = element(by.linkText(text));
|
|
browser.wait(EC.presenceOf(taskLink), 10000);
|
|
return taskLink.isDisplayed();
|
|
}
|
|
|
|
}
|
|
|