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

47 lines
1.5 KiB
TypeScript
Raw Permalink Normal View History

2017-04-14 03:57:42 +02:00
import {browser} from 'protractor';
import {TaskOverviewPage} from "../page-object/task/task-overview.po";
import {TaskEditPage} from "../page-object/task/task-edit.po";
2017-04-18 00:16:04 +02:00
/**
2017-04-18 00:50:52 +02:00
* E2E Test für seitenübergreifende
2017-04-18 00:16:04 +02:00
* Interaktionen beim Erstellen einer neuen Aufagbe
*
* @author FHartwich
*/
2017-04-14 03:57:42 +02:00
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');
})
});