Commit 03400366 authored by Nikhil Doifode's avatar Nikhil Doifode
Browse files

Fixed PR# 122 bug of cypress tests

Changes:
- Changed 'OPERATOR GENERIC' to 'OPERATOR' and 'POA GENERIC' to 'POA' in cypress-exec-spec test
- Changed for loop from 'Array of Objects' to 'Object Array' of Element Types
- Changes for MEEP_BTN_CANCEL and MEEP_BTN_APPLY in data-cy for having only one in DOM

Tests:
- All UT's and Cypress passed
- Checked manual deployment of sandbox and scenario
parent 4474beb5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ const CancelApplyPair = props => {
            outlined
            style={buttonStyles}
            onClick={props.onCancel}
            data-cy={MEEP_BTN_CANCEL}
            data-cy={props.removeCyCancel ? '' : MEEP_BTN_CANCEL}
          >
            {props.cancelText ? props.cancelText : 'Cancel'}
          </Button>
@@ -41,7 +41,7 @@ const CancelApplyPair = props => {
            style={buttonStyles}
            onClick={props.onApply}
            disabled={props.saveDisabled}
            data-cy={MEEP_BTN_APPLY}
            data-cy={props.removeCyApply ? '' : MEEP_BTN_APPLY}
          >
            {props.applyText ? props.applyText : 'Apply'}
          </Button>
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ class EventCreationPane extends Component {
            applyText="Submit"
            onCancel={e => this.onEventPaneClose(e)}
            saveDisabled={true}
            removeCyApply={true}
          />
        </div>
      </div>
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ class MobilityEventPane extends Component {
            applyText="Submit"
            onCancel={e => this.onMobilityPaneClose(e)}
            onApply={e => this.triggerEvent(e)}
            removeCyCancel={true}
          />
        </>
      </div>
+3 −2
Original line number Diff line number Diff line
@@ -146,8 +146,8 @@ class NetworkCharacteristicsEventPane extends Component {

  componentDidMount() {
    let ncTypes = ncApplicableTypes.filter(e => {
      for (let item = 0; item < this.props.networkElements.length; item++) {
        if (e === getElemFieldVal(this.props.networkElements[item], FIELD_TYPE)) {
      for (const key in this.props.networkElements) {
        if (e === getElemFieldVal(this.props.networkElements[key], FIELD_TYPE)) {
          return true;
        }
      }
@@ -463,6 +463,7 @@ class NetworkCharacteristicsEventPane extends Component {
          saveDisabled={
            !elements.length || !element.elementType || !this.props.element.name || nbErrors
          }
          removeCyCancel={true}
        />
      </div>
    );
+6 −6
Original line number Diff line number Diff line
@@ -225,12 +225,12 @@ describe('Scenario Execution', function () {
  function testNetCharEvent(scenario) {
    cy.log('Create & Validate Network Characteristic event');
    createNetCharEvent('SCENARIO', scenario, 60, 5, 1, 200000, 'Pareto');
    createNetCharEvent('OPERATOR GENERIC', 'operator1', 10, 3, 2, 90000, '');
    createNetCharEvent('OPERATOR', 'operator1', 10, 3, 2, 90000, '');
    createNetCharEvent('ZONE', 'zone1', 6, 2, 1, 70000, '');
    createNetCharEvent('ZONE', 'zone2', 6, 2, 1, 70000, '');
    createNetCharEvent('POA GENERIC', 'zone1-poa1', 2, 3, 4, 10000, '');
    createNetCharEvent('POA GENERIC', 'zone1-poa2', 40, 5, 2, 20000, '');
    createNetCharEvent('POA GENERIC', 'zone2-poa1', 0, 0, 1, 15000, '');
    createNetCharEvent('POA', 'zone1-poa1', 2, 3, 4, 10000, '');
    createNetCharEvent('POA', 'zone1-poa2', 40, 5, 2, 20000, '');
    createNetCharEvent('POA', 'zone2-poa1', 0, 0, 1, 15000, '');
  }

  // Create a Mobility event
@@ -306,7 +306,7 @@ describe('Scenario Execution', function () {
          assert.equal(getElemFieldVal(entry, FIELD_INT_DOM_THROUGHPUT_UL), tpUl);

          break;
        case 'OPERATOR GENERIC':
        case 'OPERATOR':
          assert.equal(getElemFieldVal(entry, FIELD_INT_ZONE_LATENCY), l);
          assert.equal(getElemFieldVal(entry, FIELD_INT_ZONE_LATENCY_VAR), lv);
          assert.equal(getElemFieldVal(entry, FIELD_INT_ZONE_PKT_LOSS), pl);
@@ -320,7 +320,7 @@ describe('Scenario Execution', function () {
          assert.equal(getElemFieldVal(entry, FIELD_INTRA_ZONE_THROUGHPUT_DL), tpDl);
          assert.equal(getElemFieldVal(entry, FIELD_INTRA_ZONE_THROUGHPUT_UL), tpUl);
          break;
        case 'POA GENERIC':
        case 'POA':
          assert.equal(getElemFieldVal(entry, FIELD_TERM_LINK_LATENCY), l);
          assert.equal(getElemFieldVal(entry, FIELD_TERM_LINK_LATENCY_VAR), lv);
          assert.equal(getElemFieldVal(entry, FIELD_TERM_LINK_PKT_LOSS), pl);