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

41 lines
1.4 KiB
TypeScript
Raw 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";
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');
})
});