user profile e2e tests
parent
9ad0caa247
commit
93ee6636d3
|
@ -0,0 +1,54 @@
|
||||||
|
var utils = require('../../utils');
|
||||||
|
|
||||||
|
var chai = require('chai');
|
||||||
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
|
||||||
|
chai.use(chaiAsPromised);
|
||||||
|
var expect = chai.expect;
|
||||||
|
|
||||||
|
describe('change password', function() {
|
||||||
|
before(async function(){
|
||||||
|
browser.get('http://localhost:9001/user-settings/user-change-password');
|
||||||
|
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('edit-user-profile', 'change-password');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('retype different', async function() {
|
||||||
|
await $('#current-password').sendKeys('123123');
|
||||||
|
await $('#new-password').sendKeys('123456');
|
||||||
|
await $('#retype-password').sendKeys('000');
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
expect(utils.notifications.error.open()).to.be.eventually.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('incorrect current password', async function() {
|
||||||
|
await $('#current-password').sendKeys('aaaa');
|
||||||
|
await $('#new-password').sendKeys('123456');
|
||||||
|
await $('#retype-password').sendKeys('123456');
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
expect(utils.notifications.error.open()).to.be.eventually.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('change password', async function() {
|
||||||
|
await $('#current-password').sendKeys('123123');
|
||||||
|
await $('#new-password').sendKeys('aaabbb');
|
||||||
|
await $('#retype-password').sendKeys('aaabbb');
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.equal(true);
|
||||||
|
|
||||||
|
//restore
|
||||||
|
await $('#current-password').sendKeys('aaabbb');
|
||||||
|
await $('#new-password').sendKeys('123123');
|
||||||
|
await $('#retype-password').sendKeys('123123');
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,93 @@
|
||||||
|
var utils = require('../../utils');
|
||||||
|
|
||||||
|
var chai = require('chai');
|
||||||
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
|
||||||
|
chai.use(chaiAsPromised);
|
||||||
|
var expect = chai.expect;
|
||||||
|
|
||||||
|
describe('edit user profile', function() {
|
||||||
|
before(async function(){
|
||||||
|
browser.get('http://localhost:9001/user-settings/user-profile');
|
||||||
|
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('edit-user-profile', 'edit-user-profile');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('edit fullname', async function() {
|
||||||
|
$('#full-name').clear().sendKeys('admin-' + Date.now());
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.equal(true);
|
||||||
|
|
||||||
|
// debounce :(
|
||||||
|
await browser.sleep(2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('update email', async function() {
|
||||||
|
let email = $('#email');
|
||||||
|
|
||||||
|
await email.clear().sendKeys('admin+1@admin.com');
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
let lb = $('.lightbox-generic-success');
|
||||||
|
|
||||||
|
await utils.lightbox.open(lb);
|
||||||
|
|
||||||
|
lb.$('.button-green').click();
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
await utils.common.uploadFile(inputFile, './upload-image-test.png');
|
||||||
|
|
||||||
|
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() {
|
||||||
|
// english
|
||||||
|
$('#lang option:nth-child(4)').click();
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
|
||||||
|
//debounce
|
||||||
|
browser.sleep(2000);
|
||||||
|
|
||||||
|
let pageTitle = await $('h1 span').getText();
|
||||||
|
let lang = $('#lang option:nth-child(2)').click();
|
||||||
|
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
|
||||||
|
let newPageTitle = await $('h1 span').getText();
|
||||||
|
|
||||||
|
expect(newPageTitle).to.be.not.equal(pageTitle);
|
||||||
|
|
||||||
|
//debounce
|
||||||
|
browser.sleep(2000);
|
||||||
|
|
||||||
|
// revert english
|
||||||
|
$('#lang option:nth-child(4)').click();
|
||||||
|
$('button[type="submit"]').click();
|
||||||
|
|
||||||
|
await utils.notifications.success.open();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,41 @@
|
||||||
|
var utils = require('../../utils');
|
||||||
|
|
||||||
|
var chai = require('chai');
|
||||||
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
|
||||||
|
chai.use(chaiAsPromised);
|
||||||
|
var expect = chai.expect;
|
||||||
|
|
||||||
|
describe.only('email notification', function() {
|
||||||
|
before(async function(){
|
||||||
|
browser.get('http://localhost:9001/user-settings/mail-notifications');
|
||||||
|
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('edit-user-profile', 'mail-notifications');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('change project notification to all', async function() {
|
||||||
|
let row = $$('.policy-table-row').get(1);
|
||||||
|
|
||||||
|
row.$$('label').get(0).click();
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('change project notification to no', async function() {
|
||||||
|
let row = $$('.policy-table-row').get(1);
|
||||||
|
|
||||||
|
row.$$('label').get(2).click();
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('change project notification to only', async function() {
|
||||||
|
let row = $$('.policy-table-row').get(1);
|
||||||
|
|
||||||
|
row.$$('label').get(1).click();
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.equal(true);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,31 @@
|
||||||
|
var utils = require('../../utils');
|
||||||
|
|
||||||
|
var chai = require('chai');
|
||||||
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
|
||||||
|
chai.use(chaiAsPromised);
|
||||||
|
var expect = chai.expect;
|
||||||
|
|
||||||
|
describe('feedback', function() {
|
||||||
|
before(async function(){
|
||||||
|
browser.get('http://localhost:9001/user-settings/mail-notifications');
|
||||||
|
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('edit-user-profile', 'mail-notifications');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('change project notification to all', async function() {
|
||||||
|
await utils.common.topMenuOption(4);
|
||||||
|
|
||||||
|
let feedbackLightbox = $('div[tg-lb-feedback]');
|
||||||
|
|
||||||
|
await utils.lightbox.open(feedbackLightbox);
|
||||||
|
|
||||||
|
await feedbackLightbox.$('textarea').sendKeys('test test test');
|
||||||
|
|
||||||
|
feedbackLightbox.$('button[type=submit]').click();
|
||||||
|
|
||||||
|
expect(utils.notifications.success.open()).to.be.eventually.equal(true);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,105 @@
|
||||||
|
var utils = require('../../utils');
|
||||||
|
|
||||||
|
var chai = require('chai');
|
||||||
|
var chaiAsPromised = require('chai-as-promised');
|
||||||
|
|
||||||
|
chai.use(chaiAsPromised);
|
||||||
|
var expect = chai.expect;
|
||||||
|
|
||||||
|
describe('user profile', function() {
|
||||||
|
describe('current user', function() {
|
||||||
|
before(async function(){
|
||||||
|
browser.get('http://localhost:9001/profile');
|
||||||
|
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('user-profile', 'current-user-activity');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('activity tab pagination', async function() {
|
||||||
|
let startTotal = await $$('div[tg-user-timeline-item]').count();
|
||||||
|
|
||||||
|
await browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let endTotal = await $$('div[tg-user-timeline-item]').count();
|
||||||
|
|
||||||
|
let hasMoreItems = startTotal < endTotal;
|
||||||
|
|
||||||
|
expect(hasMoreItems).to.be.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('conctacts tab', async function() {
|
||||||
|
$$('.tab').get(1).click();
|
||||||
|
|
||||||
|
browser.waitForAngular();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('user-profile', 'current-user-contacts');
|
||||||
|
|
||||||
|
let contactsCount = await $$('.profile-contact-single').count();
|
||||||
|
|
||||||
|
expect(contactsCount).to.be.above(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('edit profile hover', async function() {
|
||||||
|
let userImage = $('.profile-image-wrapper');
|
||||||
|
|
||||||
|
await browser.actions().mouseMove(userImage).perform();
|
||||||
|
|
||||||
|
let profileEdition = userImage.$('.profile-edition');
|
||||||
|
|
||||||
|
await utils.common.waitTransitionTime(profileEdition);
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('user-profile', 'image-hover');
|
||||||
|
|
||||||
|
expect(profileEdition.isDisplayed()).to.be.eventually.true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('other user', function() {
|
||||||
|
before(async function(){
|
||||||
|
browser.get('http://localhost:9001/profile/user7');
|
||||||
|
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('user-profile', 'other-user-activity');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('activity tab pagination', async function() {
|
||||||
|
let startTotal = await $$('div[tg-user-timeline-item]').count();
|
||||||
|
|
||||||
|
await browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');
|
||||||
|
await browser.waitForAngular();
|
||||||
|
|
||||||
|
let endTotal = await $$('div[tg-user-timeline-item]').count();
|
||||||
|
|
||||||
|
let hasMoreItems = startTotal < endTotal;
|
||||||
|
|
||||||
|
expect(hasMoreItems).to.be.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('projects tab', async function() {
|
||||||
|
$$('.tab').get(1).click();
|
||||||
|
|
||||||
|
browser.waitForAngular();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('user-profile', 'other-user-projects');
|
||||||
|
|
||||||
|
let projectsCount = await $$('.project-list-single').count();
|
||||||
|
|
||||||
|
expect(projectsCount).to.be.above(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('conctacts tab', async function() {
|
||||||
|
$$('.tab').get(2).click();
|
||||||
|
|
||||||
|
browser.waitForAngular();
|
||||||
|
|
||||||
|
utils.common.takeScreenshot('user-profile', 'other-user-contacts');
|
||||||
|
|
||||||
|
let contactsCount = await $$('.profile-contact-single').count();
|
||||||
|
|
||||||
|
expect(contactsCount).to.be.above(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -2,6 +2,7 @@ var common = module.exports;
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var uuid = require('node-uuid');
|
var uuid = require('node-uuid');
|
||||||
|
var path = require('path');
|
||||||
|
|
||||||
common.hasClass = async function (element, cls) {
|
common.hasClass = async function (element, cls) {
|
||||||
let classes = await element.getAttribute('class');
|
let classes = await element.getAttribute('class');
|
||||||
|
@ -158,10 +159,12 @@ common.waitTransitionTime = async function(el) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let transition = await el.getCssValue('transition-duration');
|
let transition = await el.getCssValue('transition-duration');
|
||||||
|
let transitionDelay = await el.getCssValue('transition-delay');
|
||||||
|
|
||||||
let time = parseFloat(transition.replace('s', '')) * 1000;
|
let time = parseFloat(transition.replace('s', '')) * 1000;
|
||||||
|
let timeDelay = parseFloat(transitionDelay.replace('s', '')) * 1000;
|
||||||
|
|
||||||
return browser.sleep(time);
|
return browser.sleep(time + timeDelay);
|
||||||
};
|
};
|
||||||
|
|
||||||
common.waitRequestAnimationFrame = function() {
|
common.waitRequestAnimationFrame = function() {
|
||||||
|
@ -254,6 +257,26 @@ common.goToFirstIssue = async function() {
|
||||||
await common.waitLoader();
|
await common.waitLoader();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
common.uploadFile = async function(inputFile, filePath) {
|
||||||
|
let toggleInput = function() {
|
||||||
|
$(arguments[0]).toggle();
|
||||||
|
};
|
||||||
|
|
||||||
|
let absolutePath = path.resolve(process.cwd(), 'e2e', filePath);
|
||||||
|
|
||||||
|
await browser.executeScript(toggleInput, inputFile.getWebElement());
|
||||||
|
await inputFile.sendKeys(absolutePath);
|
||||||
|
await browser.executeScript(toggleInput, inputFile.getWebElement());
|
||||||
|
};
|
||||||
|
|
||||||
|
common.topMenuOption = async function(option) {
|
||||||
|
let menu = $('div[tg-dropdown-user]');
|
||||||
|
|
||||||
|
await browser.actions().mouseMove(menu).perform();
|
||||||
|
|
||||||
|
return menu.$$('li').get(option).click();
|
||||||
|
};
|
||||||
|
|
||||||
common.goToBacklog = async function() {
|
common.goToBacklog = async function() {
|
||||||
await common.link($('#nav-backlog a'));
|
await common.link($('#nav-backlog a'));
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var common = require('./common')
|
var common = require('./common');
|
||||||
|
|
||||||
var notifications = module.exports;
|
var notifications = module.exports;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue