Merge branch '2002-e2e-client-summary' of verdnatura/salix into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-02-13 10:00:17 +00:00 committed by Gitea
commit fe91ca080e
2 changed files with 91 additions and 0 deletions

View File

@ -27,6 +27,17 @@ export default {
createClientButton: `vn-float-button`, createClientButton: `vn-float-button`,
othersButton: 'vn-left-menu li[name="Others"] > a' othersButton: 'vn-left-menu li[name="Others"] > a'
}, },
clientSummary: {
header: 'vn-client-summary > vn-card > h5',
email: 'vn-client-summary vn-label-value[label="Email"]',
street: 'vn-client-summary vn-label-value[label="Street"]',
verifiedData: 'vn-client-summary > vn-card > vn-horizontal vn-check[ng-model="$ctrl.summary.isTaxDataChecked"]',
payMethod: 'vn-client-summary vn-label-value[label="Pay method"]',
defaultAdressName: 'vn-client-summary vn-label-value[label="Name"]',
userName: 'vn-client-summary vn-label-value[label="User"]',
rate: 'vn-client-summary vn-label-value[label="Rate"]',
credit: 'vn-client-summary vn-label-value[label="Credit"]',
},
createClientView: { createClientView: {
name: 'vn-client-create vn-textfield[ng-model="$ctrl.client.name"]', name: 'vn-client-create vn-textfield[ng-model="$ctrl.client.name"]',
taxNumber: 'vn-client-create vn-textfield[ng-model="$ctrl.client.fi"]', taxNumber: 'vn-client-create vn-textfield[ng-model="$ctrl.client.fi"]',

View File

@ -0,0 +1,80 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Client summary path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('Petter Parker');
});
afterAll(async() => {
await browser.close();
});
it('should reach the first route summary section', async() => {
let url = await page.expectURL('#!/client/102/summary');
expect(url).toBe(true);
});
it('should display details from the client on the header', async() => {
await page.waitForTextInElement(selectors.clientSummary.header, 'Petter Parker');
const result = await page.waitToGetProperty(selectors.clientSummary.header, 'innerText');
expect(result).toContain('Petter Parker');
});
it('should display some basic data', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.email, 'innerText');
expect(result).toContain('PetterParker@mydomain.com');
});
it('should display fiscal address details', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.street, 'innerText');
expect(result).toContain('20 Ingram Street');
});
it('should display some fiscal data', async() => {
await page.waitForClassPresent(selectors.clientSummary.verifiedData, 'checked');
const result = await page.waitToGetProperty(selectors.clientSummary.verifiedData, 'innerText');
expect(result).toContain('Verified data');
});
it('should display pay method details', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.payMethod, 'innerText');
expect(result).toContain('PayMethod five');
});
it('should display default address details', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.defaultAdressName, 'innerText');
expect(result).toContain('Petter Parker');
});
it('should display web access details', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.userName, 'innerText');
expect(result).toContain('PetterParker');
});
it('should display business data', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.rate, 'innerText');
expect(result).toContain('%');
});
it('should display financial information', async() => {
const result = await page.waitToGetProperty(selectors.clientSummary.credit, 'innerText');
expect(result).toContain('€300.00');
});
});