fix ie e2e bugs
parent
6ceacb9e25
commit
f17c8bc7d4
|
@ -14,3 +14,4 @@ tmp/
|
||||||
app/config/main.coffee
|
app/config/main.coffee
|
||||||
app/plugins/taiga-front-extras
|
app/plugins/taiga-front-extras
|
||||||
scss-lint.log
|
scss-lint.log
|
||||||
|
e2e/screenshots/
|
||||||
|
|
|
@ -197,6 +197,7 @@ AttachmentsDirective = ($config, $confirm, $templates, $translate) ->
|
||||||
|
|
||||||
$el.on "change", ".attachments-header input", (event) ->
|
$el.on "change", ".attachments-header input", (event) ->
|
||||||
files = _.toArray(event.target.files)
|
files = _.toArray(event.target.files)
|
||||||
|
|
||||||
return if files.length < 1
|
return if files.length < 1
|
||||||
|
|
||||||
$scope.$apply ->
|
$scope.$apply ->
|
||||||
|
|
13
conf.e2e.js
13
conf.e2e.js
|
@ -10,7 +10,13 @@ exports.config = {
|
||||||
framework: 'mocha',
|
framework: 'mocha',
|
||||||
params: {
|
params: {
|
||||||
glob: {
|
glob: {
|
||||||
host: 'http://localhost:9001/'
|
host: 'http://localhost:9001/',
|
||||||
|
attachments: {
|
||||||
|
unix: './upload-file-test.txt',
|
||||||
|
windows: 'C:\\test\\upload-file-test.txt',
|
||||||
|
unixImg: './upload-image-test.png',
|
||||||
|
windowsImg: 'C:\\test\\upload-image-test.png'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mochaOpts: {
|
mochaOpts: {
|
||||||
|
@ -18,7 +24,8 @@ exports.config = {
|
||||||
compilers: 'js:babel/register'
|
compilers: 'js:babel/register'
|
||||||
},
|
},
|
||||||
// capabilities: {
|
// capabilities: {
|
||||||
// 'browserName': 'firefox'
|
// browserName: 'internet explorer',
|
||||||
|
// version: '11'
|
||||||
// },
|
// },
|
||||||
suites: {
|
suites: {
|
||||||
auth: "e2e/auth/*.e2e.js",
|
auth: "e2e/auth/*.e2e.js",
|
||||||
|
@ -37,6 +44,8 @@ exports.config = {
|
||||||
team: "e2e/full/team.e2e.js"
|
team: "e2e/full/team.e2e.js"
|
||||||
},
|
},
|
||||||
onPrepare: function() {
|
onPrepare: function() {
|
||||||
|
require('./e2e/capabilities.js');
|
||||||
|
|
||||||
browser.driver.manage().window().maximize();
|
browser.driver.manage().window().maximize();
|
||||||
|
|
||||||
browser.getCapabilities().then(function (cap) {
|
browser.getCapabilities().then(function (cap) {
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
////////////////////////////////////////////////
|
||||||
|
// Protractor Browser Capabilities Extensions //
|
||||||
|
////////////////////////////////////////////////
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = browser.getCapabilities().then(function(s) {
|
||||||
|
var browserName, browserVersion;
|
||||||
|
var shortName, shortVersion;
|
||||||
|
var ie, ff, ch, sa;
|
||||||
|
var platform;
|
||||||
|
platform = s.caps_.platform;
|
||||||
|
browserName = s.caps_.browserName;
|
||||||
|
browserVersion = s.caps_.version;
|
||||||
|
shortVersion = browserVersion.split('.')[0];
|
||||||
|
ie = /i.*explore/.test(browserName);
|
||||||
|
ff = /firefox/.test(browserName);
|
||||||
|
ch = /chrome/.test(browserName);
|
||||||
|
sa = /safari/.test(browserName);
|
||||||
|
|
||||||
|
if (ie) {
|
||||||
|
shortName = 'ie';
|
||||||
|
} else if (ff) {
|
||||||
|
shortName = 'ff';
|
||||||
|
} else if (ch) {
|
||||||
|
shortName = 'ch';
|
||||||
|
} else if (sa) {
|
||||||
|
shortName = 'sa';
|
||||||
|
} else {
|
||||||
|
throw new Exception('Unsupported browser: '+ browserName);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns one of these: ['ch', 'ff', 'sa', 'ie']
|
||||||
|
browser.getShortBrowserName = function() {
|
||||||
|
return shortName;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns one of these: ['ch33', 'ff27', 'sa7', 'ie11', 'ie10', 'ie9']
|
||||||
|
browser.getShortNameVersionAll = function() {
|
||||||
|
return shortName + shortVersion;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns one of these: ['ch', 'ff', 'sa', 'ie11', 'ie10', 'ie9']
|
||||||
|
browser.getShortNameVersion = function() {
|
||||||
|
if (ie) {
|
||||||
|
return shortName + shortVersion;
|
||||||
|
} else {
|
||||||
|
return shortName;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Return if current browser is IE, optionally specifying if it is a particular IE version
|
||||||
|
browser.isInternetExplorer = function(ver) {
|
||||||
|
if (ver == null) {
|
||||||
|
return ie;
|
||||||
|
} else {
|
||||||
|
return ie && ver.toString() === shortVersion;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Function alias
|
||||||
|
browser.isIE = browser.isInternetExplorer;
|
||||||
|
|
||||||
|
browser.isSafari = function() {
|
||||||
|
return sa;
|
||||||
|
};
|
||||||
|
|
||||||
|
browser.isFirefox = function() {
|
||||||
|
return ff;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Return if current browser is Chrome, optionally specifying if it is a particular Chrome version
|
||||||
|
browser.isChrome = function(ver) {
|
||||||
|
if (ver == null) {
|
||||||
|
return ch;
|
||||||
|
} else {
|
||||||
|
return ch && ver.toString() === shortVersion;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
browser.inWindows = function() {
|
||||||
|
return /^WIN|XP/.test(platform);
|
||||||
|
};
|
||||||
|
|
||||||
|
browser.inOSX = function() {
|
||||||
|
return /^MAC/.test(platform);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Save current webdriver session id for later use
|
||||||
|
browser.webdriverRemoteSessionId = s.caps_['webdriver.remote.sessionid'];
|
||||||
|
|
||||||
|
browser.inSauceLabs = function() {
|
||||||
|
return !!(browser.params.inSauceLabs);
|
||||||
|
};
|
||||||
|
|
||||||
|
browser.inBrowserStack = function() {
|
||||||
|
return !!(browser.params.inBrowserStack);
|
||||||
|
};
|
||||||
|
|
||||||
|
browser.inTheCloud = function() {
|
||||||
|
return !!(browser.params.inSauceLabs || browser.params.inBrowserStack);
|
||||||
|
};
|
||||||
|
});
|
|
@ -322,7 +322,7 @@ describe('backlog', function() {
|
||||||
expect(ussSprintCount).to.be.equal(initUssSprintCount + 1);
|
expect(ussSprintCount).to.be.equal(initUssSprintCount + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('select us with SHIFT', async function() {
|
utils.common.browserSkip('internet explorer', 'select us with SHIFT', async function() {
|
||||||
let dragableElements = backlogHelper.userStories();
|
let dragableElements = backlogHelper.userStories();
|
||||||
|
|
||||||
let firstInput = dragableElements.get(0).$('input[type="checkbox"]');
|
let firstInput = dragableElements.get(0).$('input[type="checkbox"]');
|
||||||
|
|
|
@ -48,8 +48,9 @@ describe('edit user profile', function() {
|
||||||
let imageContainer = $('.image-container');
|
let imageContainer = $('.image-container');
|
||||||
|
|
||||||
let htmlChanges = await utils.common.outerHtmlChanges(imageContainer);
|
let htmlChanges = await utils.common.outerHtmlChanges(imageContainer);
|
||||||
|
var fileToUpload = utils.common.uploadImagePath();
|
||||||
|
|
||||||
await utils.common.uploadFile(inputFile, './upload-image-test.png');
|
await utils.common.uploadFile(inputFile, fileToUpload);
|
||||||
|
|
||||||
await htmlChanges();
|
await htmlChanges();
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,7 @@ common.browserSkip = function(browserName, name, fn) {
|
||||||
if (browser.browserName !== browserName) {
|
if (browser.browserName !== browserName) {
|
||||||
return it.call(this, name, fn);
|
return it.call(this, name, fn);
|
||||||
} else {
|
} else {
|
||||||
// return it.skip.call(this, name, fn);
|
return it.skip.call(this, name, fn);
|
||||||
return it.call(this, name, fn);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -317,11 +316,9 @@ common.uploadFile = async function(inputFile, filePath) {
|
||||||
$(arguments[0]).removeClass('hidden');
|
$(arguments[0]).removeClass('hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
let absolutePath = path.resolve(process.cwd(), 'e2e', filePath);
|
|
||||||
|
|
||||||
await browser.executeScript(toggleInput, inputFile.getWebElement());
|
await browser.executeScript(toggleInput, inputFile.getWebElement());
|
||||||
|
|
||||||
await inputFile.sendKeys(absolutePath);
|
await inputFile.sendKeys(filePath);
|
||||||
await browser.executeScript(toggleInput, inputFile.getWebElement());
|
await browser.executeScript(toggleInput, inputFile.getWebElement());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -362,3 +359,19 @@ common.goToFirstTask = async function() {
|
||||||
|
|
||||||
await common.waitLoader();
|
await common.waitLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
common.uploadFilePath = function() {
|
||||||
|
if (browser.inWindows()) {
|
||||||
|
return browser.params.glob.attachments.windows;
|
||||||
|
} else {
|
||||||
|
return path.resolve(process.cwd(), 'e2e', browser.params.glob.attachments.unix);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
common.uploadImagePath = function() {
|
||||||
|
if (browser.inWindows()) {
|
||||||
|
return browser.params.glob.attachments.windowsImg;
|
||||||
|
} else {
|
||||||
|
return path.resolve(process.cwd(), 'e2e', browser.params.glob.attachments.unixImg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -141,9 +141,9 @@ helper.attachmentTesting = async function() {
|
||||||
|
|
||||||
// Uploading attachment
|
// Uploading attachment
|
||||||
let attachmentsLength = await attachmentHelper.countAttachments();
|
let attachmentsLength = await attachmentHelper.countAttachments();
|
||||||
var fileToUpload = './upload-file-test.txt',
|
var fileToUpload = commonUtil.uploadFilePath();
|
||||||
absolutePath = path.resolve(process.cwd(), 'e2e', fileToUpload);
|
|
||||||
await attachmentHelper.upload(absolutePath, 'This is the testing name ' + date);
|
await attachmentHelper.upload(fileToUpload, 'This is the testing name ' + date);
|
||||||
|
|
||||||
// Check set name
|
// Check set name
|
||||||
let name = await attachmentHelper.getLastAttachmentName();
|
let name = await attachmentHelper.getLastAttachmentName();
|
||||||
|
|
|
@ -8,7 +8,7 @@ var actions = {
|
||||||
|
|
||||||
let project = $$('div[tg-dropdown-project-list] li a').get(index);
|
let project = $$('div[tg-dropdown-project-list] li a').get(index);
|
||||||
|
|
||||||
common.link(project);
|
project.click();
|
||||||
|
|
||||||
common.waitLoader();
|
common.waitLoader();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue