Fixing user stories e2e tests

stable
Alejandro Alonso 2017-02-27 10:47:00 +01:00
parent e2ed2ff7ae
commit d233ea2ef2
2 changed files with 14 additions and 5 deletions

View File

@ -34,6 +34,8 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
templateEdit = $template.get("task/related-task-row-edit.html", true)
link = ($scope, $el, $attrs, $model) ->
@childScope = $scope.$new()
saveTask = debounce 2000, (task) ->
task.subject = $el.find('input').val()
@ -53,7 +55,10 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
return promise
renderEdit = (task) ->
$el.html($compile(templateEdit({task: task}))($scope))
@childScope.$destroy()
@childScope = $scope.$new()
$el.off()
$el.html($compile(templateEdit({task: task}))(childScope))
$el.find(".task-name input").val(task.subject)
@ -72,6 +77,8 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
renderView($model.$modelValue)
renderView = (task) ->
@childScope.$destroy()
@childScope = $scope.$new()
$el.off()
perms = {
@ -79,7 +86,7 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
delete_task: $scope.project.my_permissions.indexOf("delete_task") != -1
}
$el.html($compile(templateView({task: task, perms: perms}))($scope))
$el.html($compile(templateView({task: task, perms: perms}))(childScope))
$el.on "click", ".edit-task", ->
renderEdit($model.$modelValue)

View File

@ -32,15 +32,17 @@ helper.createRelatedTasks = function(name, status, assigned_to) {
let form = $('.related-task-create-form');
return helper.relatedTaskForm(form, status, assigned_to);
return helper.relatedTaskForm(form, name, status, assigned_to);
};
helper.editRelatedTasks = function(taskIndex, name, status, assigned_to) {
helper.editRelatedTasks = async function(taskIndex, name, status, assigned_to) {
let task = helper.relatedTasks().get(taskIndex);
task.$('.edit-task').click();
return helper.relatedTaskForm(task, status, assigned_to);
helper.relatedTaskForm(task, name, status, assigned_to);
await browser.sleep(30000);
};
helper.editRelatedTasksEnabled = function() {