From e0bf355ed18a0614320c89622ea8d1421a919182 Mon Sep 17 00:00:00 2001 From: Cristina Stefan <50820854+cristinastefan90@users.noreply.github.com> Date: Thu, 25 Jul 2019 12:55:16 +0300 Subject: [PATCH] #210 fixed failing tests #210 Create material receipt with quality issue --- ...ate_material_receipt_with_quality_issue.js | 20 +++++++++++-------- ...purchase_order_complete_change_complete.js | 2 +- ...purchase_order_material_receipt_invoice.js | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cypress/integration/materialReceipt/create_material_receipt_with_quality_issue.js b/cypress/integration/materialReceipt/create_material_receipt_with_quality_issue.js index 7b960e961db..f8753453e86 100644 --- a/cypress/integration/materialReceipt/create_material_receipt_with_quality_issue.js +++ b/cypress/integration/materialReceipt/create_material_receipt_with_quality_issue.js @@ -41,15 +41,19 @@ describe('Create test: create material receipt with quality issue, https://githu applyFilters(); cy.waitUntilProcessIsFinished(); /**if found, deselect it */ - cy.get('tr > td:nth-of-type(7)').then(el => { - var element = el.find('.meta-icon-checkbox-1'); - if (element.length) { - cy.get(element).dblclick(); - cy.setCheckBoxValue('IsIssueWarehouse', false); - cy.waitUntilProcessIsFinished(); + cy.get('tr').then(el => { + if (el.length > 1) { + var element = el + .get(1) + .find('td:nth-of-type(7)') + .find('.meta-icon-checkbox-1'); + if (element.length) { + cy.get(element).dblclick(); + cy.setCheckBoxValue('IsIssueWarehouse', false); + cy.waitUntilProcessIsFinished(); + } } }); - cy.waitUntilProcessIsFinished(); /**create a new quality issue warehouse */ cy.visitWindow('139', 'NEW') .writeIntoStringField('Name', warehouseName) @@ -136,7 +140,7 @@ describe('Create test: create material receipt with quality issue, https://githu .should('have.value', '0.1') .clear() .type('10{enter}'); - cy.get('#lookup_M_Product_ID .input-dropdown').should('not.have.class', 'input-block'); + cy.waitUntilProcessIsFinished(); /**Complete purchase order */ cy.fixture('misc/misc_dictionary.json').then(miscDictionary => { cy.processDocument( diff --git a/cypress/integration/purchase/purchase_order_complete_change_complete.js b/cypress/integration/purchase/purchase_order_complete_change_complete.js index c0f165dce70..b8ea3c563fc 100644 --- a/cypress/integration/purchase/purchase_order_complete_change_complete.js +++ b/cypress/integration/purchase/purchase_order_complete_change_complete.js @@ -112,7 +112,7 @@ describe('Create Purchase order - material receipt - invoice', function() { .should('have.value', '0.1') .clear() .type('5{enter}'); - cy.get('#lookup_M_Product_ID .input-dropdown').should('not.have.class', 'input-block'); + cy.waitUntilProcessIsFinished(); /**Complete purchase order */ cy.fixture('misc/misc_dictionary.json').then(miscDictionary => { cy.processDocument( diff --git a/cypress/integration/purchase/purchase_order_material_receipt_invoice.js b/cypress/integration/purchase/purchase_order_material_receipt_invoice.js index 224c5960484..a32a16ced8e 100644 --- a/cypress/integration/purchase/purchase_order_material_receipt_invoice.js +++ b/cypress/integration/purchase/purchase_order_material_receipt_invoice.js @@ -123,7 +123,7 @@ describe('Create Purchase order - material receipt - invoice', function() { .should('have.value', '0.1') .clear() .type('1{enter}'); - cy.get('#lookup_M_Product_ID .input-dropdown').should('not.have.class', 'input-block'); + cy.waitUntilProcessIsFinished(); cy.get('.quick-input-container .form-group').should('exist'); cy.writeIntoLookupListField('M_Product_ID', productName2, productName2, false, false, null, true); @@ -141,7 +141,7 @@ describe('Create Purchase order - material receipt - invoice', function() { .should('have.value', '0.1') .clear() .type('1{enter}'); - cy.get('#lookup_M_Product_ID .input-dropdown').should('not.have.class', 'input-block'); + cy.waitUntilProcessIsFinished(); /**Complete purchase order */ cy.fixture('misc/misc_dictionary.json').then(miscDictionary => { cy.processDocument( @@ -192,8 +192,8 @@ describe('Create Purchase order - material receipt - invoice', function() { .click({ force: true }); cy.contains('Material Receipt (#').click(); /**Navigate back in the purchase order */ - cy.waitUntilProcessIsFinished(); cy.go('back'); + cy.waitUntilProcessIsFinished(); let grandTotal = null; cy.openAdvancedEdit() .get('.form-field-GrandTotal input')