2020-10-28 11:29:50 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
2020-11-02 12:23:03 +00:00
|
|
|
describe('Supplier summary & descriptor path', () => {
|
2020-10-28 11:29:50 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('administrative', 'supplier');
|
|
|
|
await page.accessToSearchResult('1');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
// summary
|
|
|
|
it('should reach the second entry summary section', async() => {
|
|
|
|
await page.waitForState('supplier.card.summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm there's data on the summary header`, async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.supplierSummary.header, 'innerText');
|
|
|
|
|
2024-01-31 16:01:47 +00:00
|
|
|
expect(result).toContain('PLANTS SL - 1');
|
2020-10-28 11:29:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm there's data on the summary basic data`, async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.supplierSummary.basicDataId, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Id 1');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm there's data on the summary fiscal address`, async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.supplierSummary.fiscalAddressTaxNumber, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Tax number 06089160W');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm there's data on the summary fiscal pay method`, async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.supplierSummary.billingDataPayMethod, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Pay method PayMethod one');
|
|
|
|
});
|
|
|
|
|
|
|
|
// descriptor
|
|
|
|
it(`should confirm there's data on the descriptor`, async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.supplierDescriptor.alias, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toContain('Plants nick');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should navigate to the supplier's client summary using the icon client button`, async() => {
|
|
|
|
await page.waitToClick(selectors.supplierDescriptor.clientButton);
|
|
|
|
await page.waitForState('client.card.summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should navigate back to the supplier`, async() => {
|
|
|
|
await page.waitToClick(selectors.globalItems.homeButton);
|
|
|
|
await page.waitForState('home');
|
|
|
|
await page.selectModule('supplier');
|
|
|
|
await page.accessToSearchResult('1');
|
|
|
|
await page.waitForState('supplier.card.summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should navigate to the supplier's entries`, async() => {
|
|
|
|
await page.waitToClick(selectors.supplierDescriptor.entriesButton);
|
|
|
|
await page.waitForState('entry.index');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should navigate back to suppliers but a different one this time`, async() => {
|
|
|
|
await page.waitToClick(selectors.globalItems.homeButton);
|
|
|
|
await page.waitForState('home');
|
|
|
|
await page.selectModule('supplier');
|
|
|
|
await page.accessToSearchResult('2');
|
|
|
|
await page.waitForState('supplier.card.summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should check the client button isn't present since this supplier should not be a client`, async() => {
|
2020-11-04 17:14:08 +00:00
|
|
|
await page.waitForSelector(selectors.supplierDescriptor.clientButton, {visible: false});
|
2020-10-28 11:29:50 +00:00
|
|
|
});
|
|
|
|
});
|