#1055 e2e user configuration user company check

This commit is contained in:
Carlos Jimenez Ruiz 2019-01-28 13:42:11 +01:00
parent 01fd9fd5fe
commit cb8b33a476
1 changed files with 25 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('User config', () => {
fdescribe('User config', () => {
const nightmare = createNightmare();
describe('as salesPerson', () => {
@ -41,9 +41,32 @@ describe('User config', () => {
.waitForLogin('employee');
});
it('should open the user config form to check the settings', async() => {
let userLocalWarehouse = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
let userLocalBank = await nightmare
.getProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
let userLocalCompany = await nightmare
.getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
let userWarehouse = await nightmare
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
let userCompany = await nightmare
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
expect(userLocalWarehouse).toEqual('');
expect(userLocalBank).toEqual('');
expect(userLocalCompany).toEqual('');
expect(userWarehouse).toEqual('Warehouse Two');
expect(userCompany).toEqual('CCs');
});
it('should now edit the user config data', async() => {
let result = await nightmare
.waitToClick(selectors.globalItems.userMenuButton)
.autocompleteSearch(selectors.globalItems.userLocalWarehouse, 'Warehouse Four')
.autocompleteSearch(selectors.globalItems.userLocalBank, 'Pay on receipt')
.autocompleteSearch(selectors.globalItems.userLocalCompany, 'VNL')