#1976 Implementar Puppeteer client module + core changes
gitea/salix/puppeteer There was a failure building this commit
Details
gitea/salix/puppeteer There was a failure building this commit
Details
This commit is contained in:
parent
cb2f94cdaf
commit
3bcaaddb14
|
@ -1,8 +1,6 @@
|
||||||
/* eslint no-invalid-this: "off" */
|
/* eslint no-invalid-this: "off" */
|
||||||
import {url as defaultURL} from './config';
|
import {url as defaultURL} from './config';
|
||||||
|
|
||||||
let currentUser;
|
|
||||||
|
|
||||||
let actions = {
|
let actions = {
|
||||||
clickIfExists: async function(selector) {
|
clickIfExists: async function(selector) {
|
||||||
let exists;
|
let exists;
|
||||||
|
@ -49,14 +47,6 @@ let actions = {
|
||||||
},
|
},
|
||||||
|
|
||||||
login: async function(userName) {
|
login: async function(userName) {
|
||||||
if (currentUser !== userName) {
|
|
||||||
let userPanelOpen = await this.evaluate(() => {
|
|
||||||
return document.querySelector('.user-popover');
|
|
||||||
});
|
|
||||||
if (!userPanelOpen)
|
|
||||||
await this.clickIfExists('#user');
|
|
||||||
await this.clickIfExists('#logout');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.waitForURL('#!/login');
|
await this.waitForURL('#!/login');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -68,15 +58,6 @@ let actions = {
|
||||||
return document.location.hash === '#!/';
|
return document.location.hash === '#!/';
|
||||||
}, {});
|
}, {});
|
||||||
await this.changeLanguageToEnglish();
|
await this.changeLanguageToEnglish();
|
||||||
|
|
||||||
currentUser = userName;
|
|
||||||
} else {
|
|
||||||
await this.wait(() => {
|
|
||||||
return document.location.hash === '#!/';
|
|
||||||
}, {});
|
|
||||||
await this.changeLanguageToEnglish();
|
|
||||||
await this.waitToClick('a[ui-sref=home]');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
selectModule: async function(moduleName) {
|
selectModule: async function(moduleName) {
|
||||||
|
@ -129,7 +110,7 @@ let actions = {
|
||||||
let field = await this.evaluate(selector => {
|
let field = await this.evaluate(selector => {
|
||||||
return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field;
|
return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field;
|
||||||
}, selector);
|
}, selector);
|
||||||
if (field && field.lenght) {
|
if ((field != null && field != '') || field == '0') {
|
||||||
let coords = await this.evaluate(selector => {
|
let coords = await this.evaluate(selector => {
|
||||||
let rect = document.querySelector(selector).getBoundingClientRect();
|
let rect = document.querySelector(selector).getBoundingClientRect();
|
||||||
return {x: rect.x + (rect.width / 2), y: rect.y + (rect.height / 2), width: rect.width};
|
return {x: rect.x + (rect.width / 2), y: rect.y + (rect.height / 2), width: rect.width};
|
||||||
|
@ -371,7 +352,7 @@ let actions = {
|
||||||
await this.write(`.vn-drop-down.shown`, searchValue);
|
await this.write(`.vn-drop-down.shown`, searchValue);
|
||||||
await this.waitFor(100); // ul to repaint
|
await this.waitFor(100); // ul to repaint
|
||||||
await this.waitToClick(`.vn-drop-down.shown li.active`);
|
await this.waitToClick(`.vn-drop-down.shown li.active`);
|
||||||
await this.waitFor(100); // input to asign value
|
await this.waitFor(200); // input to asign value
|
||||||
await this.wait((autocompleteSelector, searchValue) => {
|
await this.wait((autocompleteSelector, searchValue) => {
|
||||||
return document.querySelector(`${autocompleteSelector} input`).value
|
return document.querySelector(`${autocompleteSelector} input`).value
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
@ -454,6 +435,15 @@ let actions = {
|
||||||
transition.addEventListener('transitionend', onEnd);
|
transition.addEventListener('transitionend', onEnd);
|
||||||
});
|
});
|
||||||
}, selector);
|
}, selector);
|
||||||
|
},
|
||||||
|
|
||||||
|
waitForContentLoaded: async function() {
|
||||||
|
await this.evaluate(() => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
const $rootScope = angular.element(document.body).injector().get('$rootScope');
|
||||||
|
$rootScope.$on('$viewContentLoaded', resolve());
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,36 +3,24 @@ import Puppeteer from 'puppeteer';
|
||||||
import {extendPage} from './extensions';
|
import {extendPage} from './extensions';
|
||||||
import {url as defaultURL} from './config';
|
import {url as defaultURL} from './config';
|
||||||
|
|
||||||
let browser;
|
export async function getBrowser() {
|
||||||
|
const browser = await Puppeteer.launch({
|
||||||
export function getBrowser() {
|
|
||||||
return browser || {close: () => {}};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function openPage(url = defaultURL) {
|
|
||||||
if (!browser) {
|
|
||||||
browser = await Puppeteer.launch({
|
|
||||||
args: [
|
args: [
|
||||||
'--start-maximized'
|
// '--start-maximized'
|
||||||
// '--start-fullscreen'
|
// '--start-fullscreen'
|
||||||
|
// '--proxy-server="direct://"',
|
||||||
|
// '--proxy-bypass-list=*'
|
||||||
|
`--window-size=${ 1920 },${ 1080 }`,
|
||||||
],
|
],
|
||||||
defaultViewport: null,
|
defaultViewport: null,
|
||||||
headless: false,
|
headless: false,
|
||||||
slowMo: 0, // slow down by ms
|
slowMo: 0, // slow down by ms
|
||||||
});
|
});
|
||||||
}
|
let page = (await browser.pages())[0];
|
||||||
const page = await browser.newPage();
|
page = extendPage(page);
|
||||||
await page.setDefaultTimeout(5000);
|
await page.setDefaultTimeout(5000);
|
||||||
await page.goto(url, {waitUntil: 'networkidle0'});
|
await page.goto(defaultURL, {waitUntil: 'networkidle0'});
|
||||||
|
return {page, close: browser.close.bind(browser)};
|
||||||
page.on('console', msg => {
|
|
||||||
let type = msg.type();
|
|
||||||
if (type === 'error')
|
|
||||||
console[type](msg.text());
|
|
||||||
});
|
|
||||||
|
|
||||||
const extendedPage = extendPage(page);
|
|
||||||
return extendedPage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default openPage;
|
export default getBrowser;
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Login path', async() => {
|
describe('Login path', async() => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should receive an error when the username is incorrect', async() => {
|
it('should receive an error when the username is incorrect', async() => {
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
import selectors from '../../helpers/selectors';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client create path', async() => {
|
describe('Client create path', async() => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
|
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
|
||||||
|
@ -55,6 +57,7 @@ describe('Client create path', async() => {
|
||||||
await page.autocompleteSearch(selectors.createClientView.province, 'Province one');
|
await page.autocompleteSearch(selectors.createClientView.province, 'Province one');
|
||||||
await page.write(selectors.createClientView.city, 'Valencia');
|
await page.write(selectors.createClientView.city, 'Valencia');
|
||||||
await page.write(selectors.createClientView.postcode, '46000');
|
await page.write(selectors.createClientView.postcode, '46000');
|
||||||
|
|
||||||
await page.clearInput(selectors.createClientView.email);
|
await page.clearInput(selectors.createClientView.email);
|
||||||
await page.write(selectors.createClientView.email, 'incorrect email format');
|
await page.write(selectors.createClientView.email, 'incorrect email format');
|
||||||
await page.waitToClick(selectors.createClientView.createButton);
|
await page.waitToClick(selectors.createClientView.createButton);
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Edit basicData path', () => {
|
describe('Client Edit basicData path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Bruce Wayne');
|
await page.accessToSearchResult('Bruce Wayne');
|
||||||
await page.accessToSection('client.card.basicData');
|
await page.accessToSection('client.card.basicData');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as employee', () => {
|
describe('as employee', () => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Edit fiscalData path', () => {
|
describe('Client Edit fiscalData path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Bruce Banner');
|
await page.accessToSearchResult('Bruce Banner');
|
||||||
await page.accessToSection('client.card.address.index');
|
await page.accessToSection('client.card.address.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as employee', () => {
|
describe('as employee', () => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Edit billing data path', () => {
|
describe('Client Edit billing data path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('administrative', 'client');
|
await page.loginAndModule('administrative', 'client');
|
||||||
await page.accessToSearchResult('Bruce Banner');
|
await page.accessToSearchResult('Bruce Banner');
|
||||||
await page.accessToSection('client.card.billingData');
|
await page.accessToSection('client.card.billingData');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
|
it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Add address path', () => {
|
describe('Client Add address path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Bruce Banner');
|
await page.accessToSearchResult('Bruce Banner');
|
||||||
await page.accessToSection('client.card.address.index');
|
await page.accessToSection('client.card.address.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the add new address button to access to the new address form`, async() => {
|
it(`should click on the add new address button to access to the new address form`, async() => {
|
||||||
|
@ -24,11 +26,8 @@ describe('Client Add address path', () => {
|
||||||
|
|
||||||
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
|
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.defaultCheckboxInput);
|
await page.waitToClick(selectors.clientAddresses.defaultCheckboxInput);
|
||||||
await page.clearInput(selectors.clientAddresses.streetAddressInput);
|
|
||||||
await page.autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province one');
|
await page.autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province one');
|
||||||
await page.clearInput(selectors.clientAddresses.cityInput);
|
|
||||||
await page.write(selectors.clientAddresses.cityInput, 'Valencia');
|
await page.write(selectors.clientAddresses.cityInput, 'Valencia');
|
||||||
await page.clearInput(selectors.clientAddresses.postcodeInput);
|
|
||||||
await page.write(selectors.clientAddresses.postcodeInput, '46000');
|
await page.write(selectors.clientAddresses.postcodeInput, '46000');
|
||||||
await page.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement');
|
await page.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement');
|
||||||
await page.write(selectors.clientAddresses.phoneInput, '999887744');
|
await page.write(selectors.clientAddresses.phoneInput, '999887744');
|
||||||
|
@ -39,25 +38,6 @@ describe('Client Add address path', () => {
|
||||||
expect(result).toEqual('Some fields are invalid');
|
expect(result).toEqual('Some fields are invalid');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the postcode have been edited', async() => {
|
|
||||||
const result = await page.waitToGetProperty(`${selectors.clientAddresses.postcodeInput} input`, 'value');
|
|
||||||
|
|
||||||
expect(result).toContain('46000');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should confirm the city have been autocompleted', async() => {
|
|
||||||
const result = await page.waitToGetProperty(`${selectors.clientAddresses.cityInput} input`, 'value');
|
|
||||||
|
|
||||||
expect(result).toEqual('Valencia');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
it(`should confirm the province have been autocompleted`, async() => {
|
|
||||||
const result = await page.waitToGetProperty(`${selectors.clientAddresses.provinceAutocomplete} input`, 'value');
|
|
||||||
|
|
||||||
expect(result).toEqual('Province one');
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should create a new address with all it's data`, async() => {
|
it(`should create a new address with all it's data`, async() => {
|
||||||
await page.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner');
|
await page.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner');
|
||||||
await page.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York');
|
await page.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York');
|
||||||
|
@ -67,14 +47,20 @@ describe('Client Add address path', () => {
|
||||||
expect(result).toEqual('Data saved!');
|
expect(result).toEqual('Data saved!');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the addresses button confirm the new address exists and it's the default one`, async() => {
|
it(`should click on the first address button to confirm the new address exists and it's the default one`, async() => {
|
||||||
const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
|
const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
|
||||||
|
|
||||||
expect(result).toContain('320 Park Avenue New York');
|
expect(result).toContain('320 Park Avenue New York');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the make default icon of the second address then confirm it is the default one now`, async() => {
|
it(`should click on the make default icon of the second address`, async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.secondMakeDefaultStar);
|
await page.waitToClick(selectors.clientAddresses.secondMakeDefaultStar);
|
||||||
|
const result = await page.waitForLastSnackbar();
|
||||||
|
|
||||||
|
expect(result).toEqual('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should confirm the default address is the expected one`, async() => {
|
||||||
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
|
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
|
||||||
const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
|
const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
|
||||||
|
|
||||||
|
@ -100,9 +86,11 @@ describe('Client Add address path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should go back to the addreses section by clicking the cancel button`, async() => {
|
it(`should go back to the addreses section by clicking the cancel button`, async() => {
|
||||||
await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
|
page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
|
||||||
await page.waitToClick('.vn-confirm.shown button[response="accept"]');
|
await Promise.all([
|
||||||
await page.waitForURL('address/index');
|
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
|
||||||
|
page.waitToClick('.vn-confirm.shown button[response="accept"]')
|
||||||
|
]);
|
||||||
const url = await page.parsedUrl();
|
const url = await page.parsedUrl();
|
||||||
|
|
||||||
expect(url.hash).toContain('address/index');
|
expect(url.hash).toContain('address/index');
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client add address notes path', () => {
|
describe('Client add address notes path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Petter Parker');
|
await page.accessToSearchResult('Petter Parker');
|
||||||
await page.accessToSection('client.card.address.index');
|
await page.accessToSection('client.card.address.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the edit icon of the default address`, async() => {
|
it(`should click on the edit icon of the default address`, async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Edit web access path', () => {
|
describe('Client Edit web access path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Bruce Banner');
|
await page.accessToSearchResult('Bruce Banner');
|
||||||
await page.accessToSection('client.card.webAccess');
|
await page.accessToSection('client.card.webAccess');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should uncheck the Enable web access checkbox and update the name`, async() => {
|
it(`should uncheck the Enable web access checkbox and update the name`, async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Add notes path', () => {
|
describe('Client Add notes path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Bruce Banner');
|
await page.accessToSearchResult('Bruce Banner');
|
||||||
await page.accessToSection('client.card.note.index');
|
await page.accessToSection('client.card.note.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the add note button`, async() => {
|
it(`should click on the add note button`, async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Add credit path', () => {
|
describe('Client Add credit path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('salesAssistant', 'client');
|
await page.loginAndModule('salesAssistant', 'client');
|
||||||
await page.accessToSearchResult('Hank Pym');
|
await page.accessToSearchResult('Hank Pym');
|
||||||
await page.accessToSection('client.card.credit.index');
|
await page.accessToSection('client.card.credit.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the add credit button`, async() => {
|
it(`should click on the add credit button`, async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client Add greuge path', () => {
|
describe('Client Add greuge path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('salesAssistant', 'client');
|
await page.loginAndModule('salesAssistant', 'client');
|
||||||
await page.accessToSearchResult('Petter Parker');
|
await page.accessToSearchResult('Petter Parker');
|
||||||
await page.accessToSection('client.card.greuge.index');
|
await page.accessToSection('client.card.greuge.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the add greuge button`, async() => {
|
it(`should click on the add greuge button`, async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client mandate path', () => {
|
describe('Client mandate path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('salesPerson', 'client');
|
await page.loginAndModule('salesPerson', 'client');
|
||||||
await page.accessToSearchResult('Petter Parker');
|
await page.accessToSearchResult('Petter Parker');
|
||||||
await page.accessToSection('client.card.mandate');
|
await page.accessToSection('client.card.mandate');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the client has a mandate of the CORE type', async() => {
|
it('should confirm the client has a mandate of the CORE type', async() => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client lock verified data path', () => {
|
describe('Client lock verified data path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('salesPerson', 'client');
|
await page.loginAndModule('salesPerson', 'client');
|
||||||
await page.accessToSearchResult('Hank Pym');
|
await page.accessToSearchResult('Hank Pym');
|
||||||
await page.accessToSection('client.card.fiscalData');
|
await page.accessToSection('client.card.fiscalData');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as salesPerson', () => {
|
describe('as salesPerson', () => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client log path', () => {
|
describe('Client log path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('DavidCharlesHaller');
|
await page.accessToSearchResult('DavidCharlesHaller');
|
||||||
await page.accessToSection('client.card.basicData');
|
await page.accessToSection('client.card.basicData');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update the clients name', async() => {
|
it('should update the clients name', async() => {
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client balance path', () => {
|
describe('Client balance path', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('administrative', 'client');
|
await page.loginAndModule('administrative', 'client');
|
||||||
await page.accessToSearchResult('Petter Parker');
|
await page.accessToSearchResult('Petter Parker');
|
||||||
}, 30000);
|
}, 30000);
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should now edit the local user config data', async() => {
|
it('should now edit the local user config data', async() => {
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('User config', () => {
|
describe('User config', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as salesPerson', () => {
|
describe('as salesPerson', () => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client web Payment', () => {
|
describe('Client web Payment', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('employee', 'client');
|
await page.loginAndModule('employee', 'client');
|
||||||
await page.accessToSearchResult('Tony Stark');
|
await page.accessToSearchResult('Tony Stark');
|
||||||
await page.accessToSection('client.card.webPayment');
|
await page.accessToSection('client.card.webPayment');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as employee', () => {
|
describe('as employee', () => {
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
import selectors from '../../helpers/selectors.js';
|
import selectors from '../../helpers/selectors';
|
||||||
import openPage from '../../helpers/puppeteer';
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
describe('Client DMS', () => {
|
describe('Client DMS', () => {
|
||||||
|
let browser;
|
||||||
let page;
|
let page;
|
||||||
beforeAll(async() => {
|
beforeAll(async() => {
|
||||||
page = await openPage();
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
await page.loginAndModule('salesPerson', 'client');
|
await page.loginAndModule('salesPerson', 'client');
|
||||||
await page.accessToSearchResult('Tony Stark');
|
await page.accessToSearchResult('Tony Stark');
|
||||||
await page.accessToSection('client.card.dms.index');
|
await page.accessToSection('client.card.dms.index');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
page.close();
|
browser.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('as salesPerson', () => {
|
describe('as salesPerson', () => {
|
||||||
|
|
Loading…
Reference in New Issue