61 lines
2.1 KiB
TypeScript
61 lines
2.1 KiB
TypeScript
import {browser} from 'protractor';
|
|
import {TaskOverviewPage} from "../page-object/task/task-overview.po";
|
|
import {TaskEditPage} from "../page-object/task/task-edit.po";
|
|
|
|
|
|
/**
|
|
* E2E Test für die seitenübergreifende Interaktion beim
|
|
* Bearbeiten von Aufgaben
|
|
*
|
|
* @author FHartwich
|
|
*/
|
|
describe('Edit Task Form', function () {
|
|
|
|
const dbTask = {
|
|
id: 3,
|
|
title: "Ersten Prototyp mit Angular 2.0 entwickeln",
|
|
description: "Der Prototyp soll zeigen, wie Routing und HTTP-Anbindung umgesetzt werden können.",
|
|
tags: [],
|
|
state: "IN_PROGRESS",
|
|
assignee: {
|
|
name: "Christoph Höller",
|
|
email: ""
|
|
}
|
|
};
|
|
|
|
const newTitle = 'Ersten Prototyp mit Angular 4.0 entwickelt';
|
|
|
|
it('should load task with its values in edit form', () => {
|
|
browser.get('/tasks');
|
|
const taskOverviewPage = new TaskOverviewPage;
|
|
taskOverviewPage.validateSearchFieldValue('');
|
|
const taskEditPage = taskOverviewPage.clickTask(dbTask.title);
|
|
// check for correct url - test input field values
|
|
taskEditPage.validateCurrentUrl('tasks/edit/' + dbTask.id);
|
|
TaskEditPage.validateInput('title', dbTask.title);
|
|
TaskEditPage.validateInput('description', dbTask.description);
|
|
TaskEditPage.validateInput('state', dbTask.state);
|
|
TaskEditPage.validateInput('assignee_name', dbTask.assignee['name'])
|
|
TaskEditPage.validateInput('assignee_email', dbTask.assignee['email'])
|
|
});
|
|
|
|
it('should have updated title in overview after edit, but same task id as before', () => {
|
|
browser.get('/tasks/edit/' + dbTask.id);
|
|
const taskEditPage = new TaskEditPage(false);
|
|
taskEditPage.clearEnterTitle(newTitle);
|
|
let taskOverviewPage = taskEditPage.submitTaskForm();
|
|
// validate that ID is kept after change
|
|
taskOverviewPage.verifyNewTask(newTitle);
|
|
taskOverviewPage.clickTask(newTitle).validateCurrentUrl('tasks/edit/' + dbTask.id);
|
|
});
|
|
|
|
it('should have return to Overview after cancel button click', () => {
|
|
browser.get('/tasks/edit/' + dbTask.id);
|
|
const taskEditPage = new TaskEditPage(false);
|
|
const taskOverviewPage = taskEditPage.cancelSubmitTask();
|
|
taskOverviewPage.verifyNewTask(newTitle);
|
|
});
|
|
|
|
});
|
|
|