2020-09-11 14:36:56 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Entry basic data path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('buyer', 'entry');
|
|
|
|
await page.accessToSearchResult('2');
|
|
|
|
await page.accessToSection('entry.card.basicData');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should edit the basic data', async() => {
|
|
|
|
await page.write(selectors.entryBasicData.reference, 'new movement 8');
|
2022-10-26 10:48:48 +00:00
|
|
|
await page.write(selectors.entryBasicData.invoiceNumber, 'new movement 8');
|
2020-09-11 14:36:56 +00:00
|
|
|
await page.write(selectors.entryBasicData.notes, 'new notes');
|
|
|
|
await page.write(selectors.entryBasicData.observations, ' edited');
|
|
|
|
await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick');
|
|
|
|
await page.autocompleteSearch(selectors.entryBasicData.currency, 'eur');
|
|
|
|
await page.clearInput(selectors.entryBasicData.commission);
|
|
|
|
await page.write(selectors.entryBasicData.commission, '100');
|
|
|
|
await page.autocompleteSearch(selectors.entryBasicData.company, 'CCs');
|
|
|
|
await page.waitToClick(selectors.entryBasicData.ordered);
|
|
|
|
await page.waitToClick(selectors.entryBasicData.confirmed);
|
|
|
|
await page.waitToClick(selectors.entryBasicData.inventory);
|
|
|
|
await page.waitToClick(selectors.entryBasicData.raid);
|
|
|
|
await page.waitToClick(selectors.entryBasicData.booked);
|
|
|
|
await page.waitToClick(selectors.entryBasicData.save);
|
|
|
|
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
2020-11-10 11:06:21 +00:00
|
|
|
expect(message.text).toContain('Data saved!');
|
2020-09-11 14:36:56 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the reference was edited', async() => {
|
|
|
|
await page.reloadSection('entry.card.basicData');
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.reference, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('new movement 8');
|
|
|
|
});
|
|
|
|
|
2022-10-26 10:48:48 +00:00
|
|
|
it('should confirm the invoiceNumber was edited', async() => {
|
|
|
|
await page.reloadSection('entry.card.basicData');
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.invoiceNumber, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('new movement 8');
|
|
|
|
});
|
|
|
|
|
2020-09-11 14:36:56 +00:00
|
|
|
it('should confirm the note was edited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('new notes');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the observation was edited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.observations, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('observation two edited');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the supplier was edited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.supplier, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('1 - Plants nick');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the currency was edited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.currency, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('EUR');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the commission was edited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.commission, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('100');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the company was edited', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.entryBasicData.company, 'value');
|
|
|
|
|
|
|
|
expect(result).toEqual('CCs');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm ordered was edited', async() => {
|
|
|
|
const result = await page.checkboxState(selectors.entryBasicData.ordered);
|
|
|
|
|
|
|
|
expect(result).toBe('checked');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm confirmed was edited', async() => {
|
|
|
|
const result = await page.checkboxState(selectors.entryBasicData.confirmed);
|
|
|
|
|
|
|
|
expect(result).toBe('checked');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm inventory was edited', async() => {
|
|
|
|
const result = await page.checkboxState(selectors.entryBasicData.inventory);
|
|
|
|
|
|
|
|
expect(result).toBe('checked');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm raid was edited', async() => {
|
|
|
|
const result = await page.checkboxState(selectors.entryBasicData.raid);
|
|
|
|
|
|
|
|
expect(result).toBe('checked');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm booked was edited', async() => {
|
|
|
|
const result = await page.checkboxState(selectors.entryBasicData.booked);
|
|
|
|
|
|
|
|
expect(result).toBe('checked');
|
|
|
|
});
|
|
|
|
});
|