2018-02-15 11:28:05 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../../helpers/nightmare';
|
2018-02-15 11:28:05 +00:00
|
|
|
|
2018-11-20 13:22:00 +00:00
|
|
|
describe('Item Create barcodes path', () => {
|
|
|
|
const nightmare = createNightmare();
|
2018-02-15 11:28:05 +00:00
|
|
|
|
2018-11-20 13:22:00 +00:00
|
|
|
beforeAll(() => {
|
|
|
|
nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('buyer', 'item')
|
2019-01-10 06:26:10 +00:00
|
|
|
.accessToSearchResult('Object1 Gem1 5')
|
2018-12-02 23:45:34 +00:00
|
|
|
.accessToSection('item.card.itemBarcode');
|
2018-11-20 13:22:00 +00:00
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should click create a new code and delete a former one`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton)
|
|
|
|
.waitToClick(selectors.itemBarcodes.addBarcodeButton)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.itemBarcodes.thirdCodeInput, '5')
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitToClick(selectors.itemBarcodes.submitBarcodesButton)
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitForLastSnackbar();
|
2018-02-19 10:55:45 +00:00
|
|
|
|
2018-11-20 13:22:00 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-23 14:33:25 +00:00
|
|
|
.waitToClick(selectors.itemBasicData.basicDataButton)
|
|
|
|
.waitToClick(selectors.itemBarcodes.barcodeButton)
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitForTextInInput(selectors.itemBarcodes.thirdCodeInput, '5')
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBarcodes.thirdCodeInput, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('5');
|
2018-02-20 14:22:24 +00:00
|
|
|
});
|
2018-02-15 11:28:05 +00:00
|
|
|
});
|