Live Price Grid
- 1 Precondition
- 1.1 How to open LPG
- 1.1.1 From LPG main page
- 1.1.2 Open LPG via URL
- 1.2 Test cases
- 1.1 How to open LPG
Precondition
You need to have login and correct struncture of the .spec.js file in your test (API or FE) - see this page: Login
How to open LPG
Â
From LPG main page
write “cypress“ into label
find data-row-key and on this row find label “cypress“
click on label “cypress“
  it('LPG', () => {
    cy.visit('/#/pb/lpgs');
    cy.url().should('contain', '/#/pb/lpgs'); //assert
    cy.waitForSpinner();
    //Open LPG with label "cypress"
    const LPGlabel = 'cypress';
    cy.contains('.ucTableHeaderColumnContextMenu', 'Label')
      .find('[data-test="quickFilter-input"]')//click on the quick filter
      .type(LPGlabel + '{enter}', { force: true }); //variable
      cy.waitForSpinner();
      cy.get('[data-row-key="16.PG"]')//find row key for our LPG
      .contains(LPGlabel)//find string on this row key
      .click({ force: true });//click
  cy.waitForSpinner();
cy.contains('[data-test=ucBreadcrumbs]', LPGlabel);//assert for breadcrumbs
});
Â
Open LPG via URL
put URL of the LPG
Check that URL is successfully loaded and breadcrumbs contains name of the LPG
  it('LPG', () => {
const LPGlabel = 'cypress';
    cy.visit('/#/pb/lpgs/16/detail');
    cy.url().should('contain', '/#/pb/lpgs/16/detail'); //assert
    cy.waitForSpinner();
cy.contains('[data-test=ucBreadcrumbs]', LPGlabel);//assert for breadcrumbs
});
Â
Test cases
Test case
  //Products
  //1) Find LPG id 16, Lable = cypress
  //2) open LPG and check strategy for product MB-0028 (data-row-key = 272.PGI) and check, that strategy is Aggressive
  //3) Go to PP table, open OnlineStrategy table and change strategy on row "Beef" from "aggressive" to "moderate"
  //4) Go back to LPG and recalculate our "cypress" LPG
  //5) Open LPG and check, that strategy has been changed to "moderate"
  //6) Go back to PP table OnlineStrategy and change again row "Beef" to previous state (from "moderate" to "aggressive")
  //7) Go back to LPG and recalculate our "cypress" LPG
Â
Code
variables are using in the test.
Needs to be changed only on one place
Download test LoginAPi-LPG dynamic here.
Â