fix some e2e tests at IE

stable
Juanfran 2015-10-09 13:58:18 +02:00
parent f17c8bc7d4
commit 22f8b16b87
11 changed files with 61 additions and 38 deletions

View File

@ -91,7 +91,7 @@ LoadingDirective = ($loading) ->
currentLoading = $loading() currentLoading = $loading()
.target($el) .target($el)
.start() .start()
else else if currentLoading
currentLoading.finish() currentLoading.finish()
return { return {

View File

@ -67,12 +67,13 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.searchTerm = "" @scope.searchTerm = ""
loadSearchData = debounceLeading(100, (t) => @.loadSearchData(t)) loadSearchData = debounceLeading(100, (t) => @.loadSearchData(t))
@scope.$watch "searchTerm", (term) => bindOnce @scope, "projectId", (projectId) =>
if term if !@scope.searchResults
@scope.loading = true @.loadSearchData()
@.loadSearchData(term).then () => @scope.$watch "searchTerm", (term) =>
@scope.loading = false if term != undefined && @scope.projectId
@.loadSearchData(term)
loadFilters: -> loadFilters: ->
defered = @q.defer() defered = @q.defer()
@ -90,9 +91,13 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.usStatusById = groupBy(project.us_statuses, (x) -> x.id) @scope.usStatusById = groupBy(project.us_statuses, (x) -> x.id)
return project return project
loadSearchData: (term) -> loadSearchData: (term = "") ->
@scope.loading = true
promise = @rs.search.do(@scope.projectId, term).then (data) => promise = @rs.search.do(@scope.projectId, term).then (data) =>
@scope.searchResults = data @scope.searchResults = data
@scope.loading = false
return data return data
return promise return promise
@ -244,7 +249,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
markSectionTabActive(activeSection) markSectionTabActive(activeSection)
$scope.$watch "searchTerm", (searchTerm) -> $scope.$watch "searchTerm", (searchTerm) ->
$location.search("text", searchTerm) if searchTerm $location.search("text", searchTerm) if searchTerm != undefined
$el.on "click", ".search-filter li > a", (event) -> $el.on "click", ".search-filter li > a", (event) ->
event.preventDefault() event.preventDefault()

View File

@ -5,4 +5,10 @@
float: right; float: right;
} }
} }
.check {
input { // IE needs smaller size
height: 40px;
width: 85px;
}
}
} }

View File

@ -45,6 +45,10 @@
padding-bottom: 2rem; padding-bottom: 2rem;
.check { .check {
margin-left: .5rem; margin-left: .5rem;
input { // IE needs smaller size
height: 40px;
width: 85px;
}
} }
} }
} }

View File

@ -58,4 +58,10 @@
border-bottom: 0; border-bottom: 0;
} }
} }
.check {
input { // IE needs smaller size
height: 40px;
width: 85px;
}
}
} }

View File

@ -6,11 +6,11 @@ var utils = require('./e2e/utils');
var HtmlReporter = require('protractor-html-screenshot-reporter'); var HtmlReporter = require('protractor-html-screenshot-reporter');
exports.config = { exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub', seleniumAddress: 'http://10.8.1.194:4444/wd/hub',
framework: 'mocha', framework: 'mocha',
params: { params: {
glob: { glob: {
host: 'http://localhost:9001/', host: 'http://10.8.1.153:9001/',
attachments: { attachments: {
unix: './upload-file-test.txt', unix: './upload-file-test.txt',
windows: 'C:\\test\\upload-file-test.txt', windows: 'C:\\test\\upload-file-test.txt',

View File

@ -52,8 +52,6 @@ describe('admin - webhooks', function() {
await adminIntegrationsHelper.saveWebHook('111', 'http://web2.fake', '333'); await adminIntegrationsHelper.saveWebHook('111', 'http://web2.fake', '333');
await browser.sleep(4000);
let webHookMode = await adminIntegrationsHelper.getWebHookMode(); let webHookMode = await adminIntegrationsHelper.getWebHookMode();
expect(webHookMode).to.be.equal('read'); expect(webHookMode).to.be.equal('read');

View File

@ -96,6 +96,7 @@ describe('admin - members', function() {
//prevent change to the same value //prevent change to the same value
adminMembershipsHelper.setRole(member, 1); adminMembershipsHelper.setRole(member, 1);
adminMembershipsHelper.setRole(member, 3);
adminMembershipsHelper.setRole(member, 2); adminMembershipsHelper.setRole(member, 2);
expect(utils.notifications.success.open()).to.be.eventually.true; expect(utils.notifications.success.open()).to.be.eventually.true;
@ -114,13 +115,14 @@ describe('admin - members', function() {
}); });
it('toggle admin', async function() { it('toggle admin', async function() {
let member = adminMembershipsHelper.getMembers().last(); let member = adminMembershipsHelper.getMembers().get(1);
let isAdmin = await adminMembershipsHelper.isAdmin(member); let isAdmin = await adminMembershipsHelper.isAdmin(member);
if (isAdmin) { if (isAdmin) {
adminMembershipsHelper.toggleAdmin(member); adminMembershipsHelper.toggleAdmin(member);
await browser.waitForAngular(); await utils.notifications.success.open();
isAdmin = await adminMembershipsHelper.isAdmin(member); isAdmin = await adminMembershipsHelper.isAdmin(member);
expect(isAdmin).not.to.be.true; expect(isAdmin).not.to.be.true;

View File

@ -83,15 +83,17 @@ describe('search page', function() {
it('change current tab content on typing in the right column', async function() { it('change current tab content on typing in the right column', async function() {
let text = await $$('.table-main').get(0).$('a').getText(); let text = await $$('.table-main').get(0).$('a').getText();
let htmlChanges = await utils.common.outerHtmlChanges('.search-result-table-body');
let initialCount = await $$('.table-main').count(); let initialCount = await $$('.table-main').count();
let searchTerm = element(by.model('searchTerm')); let searchTerm = element(by.model('searchTerm'));
searchTerm.clear(); await searchTerm.clear();
await searchTerm.sendKeys(text); await searchTerm.sendKeys(text);
await browser.waitForAngular(); await htmlChanges();
let count = await $$('.table-main').count(); let count = await $$('.table-main').count();

View File

@ -42,25 +42,6 @@ describe('edit user profile', function() {
await utils.lightbox.close(lb); await utils.lightbox.close(lb);
}); });
it('edit avatar', async function() {
let inputFile = $('#avatar-field');
let imageContainer = $('.image-container');
let htmlChanges = await utils.common.outerHtmlChanges(imageContainer);
var fileToUpload = utils.common.uploadImagePath();
await utils.common.uploadFile(inputFile, fileToUpload);
await htmlChanges();
let avatar = imageContainer.$('.avatar');
let src = await avatar.getAttribute('src');
expect(src).to.contains('upload-image-test.png');
});
it('edit lenguage', async function() { it('edit lenguage', async function() {
// english // english
$('#lang option:nth-child(4)').click(); $('#lang option:nth-child(4)').click();
@ -91,4 +72,23 @@ describe('edit user profile', function() {
await utils.notifications.success.open(); await utils.notifications.success.open();
}); });
it('edit avatar', async function() {
let inputFile = $('#avatar-field');
let imageContainer = $('.image-container');
let htmlChanges = await utils.common.outerHtmlChanges(imageContainer);
var fileToUpload = utils.common.uploadImagePath();
await utils.common.uploadFile(inputFile, fileToUpload);
await htmlChanges();
let avatar = imageContainer.$('.avatar');
let src = await avatar.getAttribute('src');
expect(src).to.contains('upload-image-test.png');
});
}); });

View File

@ -5,9 +5,9 @@ var helper = module.exports;
helper.saveWebHook = async function(name, email, key) { helper.saveWebHook = async function(name, email, key) {
let inputs = $$('input[type="text"]'); let inputs = $$('input[type="text"]');
await utils.common.clear(inputs.get(0)); await inputs.get(0).clear();
await utils.common.clear(inputs.get(1)); await inputs.get(1).clear();
await utils.common.clear(inputs.get(2)); await inputs.get(2).clear();
await inputs.get(0).sendKeys(name); await inputs.get(0).sendKeys(name);
await inputs.get(1).sendKeys(email); await inputs.get(1).sendKeys(email);