#7874 clientObservationType #2960
|
@ -1,42 +0,0 @@
|
||||||
import selectors from '../../helpers/selectors';
|
|
||||||
|
|||||||
import getBrowser from '../../helpers/puppeteer';
|
|
||||||
|
|
||||||
describe('Client Add notes path', () => {
|
|
||||||
let browser;
|
|
||||||
let page;
|
|
||||||
beforeAll(async() => {
|
|
||||||
browser = await getBrowser();
|
|
||||||
page = browser.page;
|
|
||||||
await page.loginAndModule('employee', 'client');
|
|
||||||
await page.accessToSearchResult('Bruce Banner');
|
|
||||||
await page.accessToSection('client.card.note.index');
|
|
||||||
});
|
|
||||||
|
|
||||||
afterAll(async() => {
|
|
||||||
await browser.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should reach the notes index`, async() => {
|
|
||||||
await page.waitForState('client.card.note.index');
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should click on the add note button`, async() => {
|
|
||||||
await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
|
|
||||||
await page.waitForState('client.card.note.create');
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should create a note`, async() => {
|
|
||||||
await page.waitForSelector(selectors.clientNotes.note);
|
|
||||||
await page.type(`${selectors.clientNotes.note} textarea`, 'Meeting with Black Widow 21st 9am');
|
|
||||||
await page.waitToClick(selectors.clientNotes.saveButton);
|
|
||||||
const message = await page.waitForSnackbar();
|
|
||||||
|
|
||||||
expect(message.text).toContain('Data saved!');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should confirm the note was created', async() => {
|
|
||||||
const result = await page.waitToGetProperty(selectors.clientNotes.firstNoteText, 'innerText');
|
|
||||||
|
|
||||||
expect(result).toEqual('Meeting with Black Widow 21st 9am');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -28,12 +28,12 @@ describe('Client defaulter path', () => {
|
||||||
const salesPersonName =
|
const salesPersonName =
|
||||||
jorgep
commented
Al no hacerse el test de add_notes, la primera nota es diferente Al no hacerse el test de add_notes, la primera nota es diferente
|
|||||||
await page.waitToGetProperty(selectors.clientDefaulter.firstSalesPersonName, 'innerText');
|
await page.waitToGetProperty(selectors.clientDefaulter.firstSalesPersonName, 'innerText');
|
||||||
|
|
||||||
expect(clientName).toEqual('Bruce Banner');
|
expect(clientName).toEqual('Ororo Munroe');
|
||||||
expect(salesPersonName).toEqual('developer');
|
expect(salesPersonName).toEqual('salesperson');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should first observation not changed', async() => {
|
it('should first observation not changed', async() => {
|
||||||
const expectedObservation = 'Meeting with Black Widow 21st 9am';
|
const expectedObservation = 'Madness, as you know, is like gravity, all it takes is a little push';
|
||||||
const result = await page.waitToGetProperty(selectors.clientDefaulter.firstObservation, 'value');
|
const result = await page.waitToGetProperty(selectors.clientDefaulter.firstObservation, 'value');
|
||||||
|
|
||||||
expect(result).toContain(expectedObservation);
|
expect(result).toContain(expectedObservation);
|
||||||
|
@ -62,13 +62,4 @@ describe('Client defaulter path', () => {
|
||||||
await page.write(selectors.clientDefaulter.observation, 'My new observation');
|
await page.write(selectors.clientDefaulter.observation, 'My new observation');
|
||||||
await page.waitToClick(selectors.clientDefaulter.saveButton);
|
await page.waitToClick(selectors.clientDefaulter.saveButton);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should first observation changed', async() => {
|
|
||||||
jorgep
commented
Ahora es necesario indicar el tipo de nota también Ahora es necesario indicar el tipo de nota también
|
|||||||
const message = await page.waitForSnackbar();
|
|
||||||
await page.waitForSelector(selectors.clientDefaulter.firstObservation);
|
|
||||||
const result = await page.waitToGetProperty(selectors.clientDefaulter.firstObservation, 'value');
|
|
||||||
|
|
||||||
expect(message.text).toContain('Observation saved!');
|
|
||||||
expect(result).toContain('My new observation');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Esta sección redirige a lilium ahora