angular4-testing/project-manager/e2e/task/create-new-task.e2e-spec.ts

47 lines
1.5 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 Testsuite für seitenübergreifende
* Interaktionen beim Erstellen einer neuen Aufagbe
*
* @author FHartwich
*/
describe('Create New Task Form', function () {
it('should redirect to "New Task Form" and contain new entry in list after creation with valid title and assignee-email', () => {
const testTitle = 'valid title';
const testEmail = 'testuser@test.com';
browser.get('/tasks');
const taskOverviewPage = new TaskOverviewPage;
taskOverviewPage.validateSearchFieldValue('');
const taskEditPage = taskOverviewPage.clickNeueAufgabe();
taskEditPage.clearEnterTitle(testTitle);
taskEditPage.clearInsertEmail(testEmail);
taskEditPage.submitTaskForm().verifyNewTask(testTitle);
});
it('should show error-message on title entered being too short', () => {
const testTitle = 'xyz';
browser.get('/tasks/new');
const taskEditPage = new TaskEditPage(true);
taskEditPage.clearEnterTitle(testTitle);
taskEditPage.clearEnterDescription('');
taskEditPage.validateError('title');
});
it('should show error-message on email entered not matching pattern', () => {
const testEmail = 'wrong@mail.';
browser.get('/tasks/new');
const taskEditPage = new TaskEditPage(true);
taskEditPage.clearInsertEmail(testEmail);
taskEditPage.clearEnterDescription('');
taskEditPage.validateError('email');
})
});