Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0053412
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[POS2] POSminorhave not tried2023-09-07 12:022023-09-15 11:41
Reporterandre_montenegroView Statuspublic 
Assigned Toandre_montenegro 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0053412: Modify ProductButtonContentName data-testid to be unique

DescriptionAs some performance degradation has been observed in Cypress tests when adding a product to the ticket several times, by reviewing Cypress documentation I found out that one of the reasons could be that “cy.get()” receives more than 1 value, which is actually our case as all product buttons have the same data-testid value and the one is desired, is filtered by it’s content text.

After testing this change as a draft and by reverting some workarounds to some of this performance degradation failures, results are that job execution time does not improve, but degradation in tests is decreased as no test failed anymore.

It has been tested more than 15 times.
Steps To ReproduceReplace productT3 test (from product.spec.js) by this tests steps:
"
      cy.changeProductCategory(this.testData.productCategory2);
      cy.addProduct(this.testData.product4);
      cy.paginateProductVertical(1);
      cy.addProduct(this.testData.product5);
      cy.paginateProductVertical(0);
      cy.addProduct(this.testData.product6);
      cy.assertNumLines(3);
      cy.addProduct(this.testData.product4);
      cy.paginateProductVerticalArrows('Down');
      cy.addProduct(this.testData.product5);
      cy.paginateProductVerticalArrows('Up');
      cy.addProduct(this.testData.product6);
      cy.assertNumLines(3);
      cy.window().should(win => {
        expect(win.OB.App.State.getState().Ticket.lines[0].qty).to.equal(2);
        expect(win.OB.App.State.getState().Ticket.lines[1].qty).to.equal(2);
        expect(win.OB.App.State.getState().Ticket.lines[2].qty).to.equal(2);
      });
"
Which can easily reproduce this degradation in the performance and will fail when trying to add a product to the ticket.

Launch a try-pos2 execution with the mentioned change and observe the degradation in the video and the failure.
Proposed SolutionUse an unique data-testid for each product button (ProductButtonContentName.jsx):

For example: data-testid={`${testId}-${payload.identifier}`}
instead data-testid={`${testId}-identifier`}


This will also require to fix Jest and Cypress tests which can be affected by the change.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0154771)
hgbot (developer)
2023-09-13 10:47

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2084 [^]
(0154772)
hgbot (developer)
2023-09-13 11:03

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/248 [^]
(0154889)
hgbot (developer)
2023-09-15 11:37

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 7dbb99d3e7e0699326654b47e4964766c6e1fcee
Author: André Montenegro <andre.montenegro@openbravo.com>
Date: 14-09-2023 15:41:39
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/7dbb99d3e7e0699326654b47e4964766c6e1fcee [^]

Related to ISSUE-53412: created unique data-testid for each productButtonContentName

---
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductButtonContentName/ProductButtonContentName.jsx
---
(0154890)
hgbot (developer)
2023-09-15 11:37

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 03c3a9b20d57e53780c95b3f888360b00e14fddd
Author: André Montenegro <andre.montenegro@openbravo.com>
Date: 15-09-2023 11:02:42
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/03c3a9b20d57e53780c95b3f888360b00e14fddd [^]

Related to ISSUE-53412: cypress tests adapted to unique data-testid for product button

---
M web-jspack/org.openbravo.pos2/src-test/cypress/e2e/Features/initial.spec.js
M web-jspack/org.openbravo.pos2/src-test/cypress/e2e/Features/productSearch.spec.js
M web-jspack/org.openbravo.pos2/src-test/cypress/functions/logins.js
M web-jspack/org.openbravo.pos2/src-test/cypress/functions/schema.js
M web-jspack/org.openbravo.pos2/src-test/cypress/functions/ticket.js
---
(0154891)
hgbot (developer)
2023-09-15 11:37

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 0460708379530150c956c5dbfb1cf1c716a8c270
Author: André Montenegro <andre.montenegro@openbravo.com>
Date: 15-09-2023 11:03:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/0460708379530150c956c5dbfb1cf1c716a8c270 [^]

Related to ISSUE-53412: ProductButton & ProductContentName Jest tests fixed

---
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductButtonContent/__test__/ProductButtonContent.test.jsx
M web-jspack/org.openbravo.pos2/src/components/ProductButton/__test__/ProductButton.test.jsx
---
(0154892)
hgbot (developer)
2023-09-15 11:37

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 47514743a1fa1781713edf1a89d1e783b294e600
Author: André Montenegro <andre.montenegro@openbravo.com>
Date: 15-09-2023 11:03:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/47514743a1fa1781713edf1a89d1e783b294e600 [^]

Related to ISSUE-53412: productKeymap Jest test fixed

---
M web-jspack/org.openbravo.pos2/src/components/ProductKeymap/__mock__/ProductKeymap.mock1.json
M web-jspack/org.openbravo.pos2/src/components/ProductKeymap/__test__/ProductKeymap.test.jsx
---
(0154893)
hgbot (developer)
2023-09-15 11:37

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2084 [^]
(0154894)
hgbot (developer)
2023-09-15 11:39

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant [^]
Changeset: 8037f40bdfea75799e577e94c20e07a989d3fe1e
Author: André Montenegro <andre.montenegro@openbravo.com>
Date: 13-09-2023 10:54:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/commit/8037f40bdfea75799e577e94c20e07a989d3fe1e [^]

Related to ISSUE-53412: adapted test to new unique data-testid for each product

---
M web-jspack/org.openbravo.pos2.restaurant/src-test/cypress/e2e/Features/menus.spec.js
M web-jspack/org.openbravo.pos2.restaurant/src-test/cypress/functions/menu.js
---
(0154895)
hgbot (developer)
2023-09-15 11:39

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/248 [^]

- Issue History
Date Modified Username Field Change
2023-09-07 12:02 andre_montenegro New Issue
2023-09-07 12:02 andre_montenegro Assigned To => andre_montenegro
2023-09-07 12:02 andre_montenegro Triggers an Emergency Pack => No
2023-09-07 12:06 andre_montenegro Proposed Solution updated
2023-09-13 10:47 hgbot Note Added: 0154771
2023-09-13 11:03 hgbot Note Added: 0154772
2023-09-15 11:37 hgbot Note Added: 0154889
2023-09-15 11:37 hgbot Note Added: 0154890
2023-09-15 11:37 hgbot Note Added: 0154891
2023-09-15 11:37 hgbot Note Added: 0154892
2023-09-15 11:37 hgbot Note Added: 0154893
2023-09-15 11:39 hgbot Note Added: 0154894
2023-09-15 11:39 hgbot Note Added: 0154895
2023-09-15 11:41 andre_montenegro Status new => scheduled
2023-09-15 11:41 andre_montenegro Status scheduled => resolved
2023-09-15 11:41 andre_montenegro Resolution open => fixed
2023-09-15 11:41 andre_montenegro Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker