Stone, Avi (as206k) | 9b2ceb3 | 2018-04-12 16:36:39 +0300 | [diff] [blame] | 1 | describe('General Page - E2E test flow with mock', () => { |
| 2 | describe('Create new MC', () => { |
| 3 | beforeEach(() => { |
| 4 | cy.httpGetDDLData(); |
| 5 | cy.getMCListEmpty(); |
| 6 | cy.homePage(); |
| 7 | cy.get('button[data-tests-id="btn-create-mc"]').click(); |
| 8 | }); |
| 9 | |
| 10 | it('Create button need to be disabled', () => { |
| 11 | cy |
| 12 | .get('button[data-tests-id="createMonitoring"]') |
| 13 | .should('be.visible') |
| 14 | .and('be.disabled'); |
| 15 | }); |
| 16 | |
| 17 | it('Fill form then click to submit verify setting button and constrain ddl', () => { |
| 18 | cy.fillNewMcForm(); |
| 19 | cy |
| 20 | .get('button[data-tests-id="createMonitoring"]') |
| 21 | .as('createButton') |
| 22 | .not('[disabled]') |
| 23 | .should('not.contain', 'Disabled'); |
| 24 | |
| 25 | cy.httpCreateNewMc(); |
| 26 | cy.emptyRuleEngine('Type1'); |
| 27 | |
| 28 | cy.get('@createButton').click(); |
| 29 | cy |
| 30 | .get('#ui-tabpanel-1-label') |
| 31 | .should('contain', 'map') |
| 32 | .click(); |
| 33 | cy |
| 34 | .get('button[data-tests-id="setting-gear"]') |
| 35 | .should('be.visible') |
| 36 | .first() |
| 37 | .click({ multiple: true }); |
| 38 | |
| 39 | cy |
| 40 | .get('.map-setting-list #mappingType > .field-text') |
| 41 | .should('have.value', 'multiple'); |
| 42 | }); |
| 43 | }); |
| 44 | |
| 45 | describe('Tabs after MC created', () => { |
| 46 | beforeEach(() => { |
| 47 | cy.httpGetDDLData(); |
| 48 | cy.getMCListEmpty(); |
| 49 | cy.homePage(); |
| 50 | cy.get('button[data-tests-id="btn-create-mc"]').click(); |
| 51 | cy.fillNewMcForm(); |
| 52 | cy.httpCreateNewMc(); |
| 53 | cy.emptyRuleEngine('Type1'); |
| 54 | cy.get('button[data-tests-id="createMonitoring"]').click(); |
| 55 | }); |
| 56 | |
| 57 | it('should have 4 icon buttons in map tab', () => { |
| 58 | cy |
| 59 | .get('#ui-tabpanel-1-label') |
| 60 | .should('contain', 'map') |
| 61 | .click(); |
| 62 | cy |
| 63 | .get('.map-bar-icon-container>button') |
| 64 | .should('have.length', 2) |
| 65 | .get('.map-bar-icon-container>div>button') |
| 66 | .should('have.length', 2) |
| 67 | .and('be.visible'); |
| 68 | }); |
| 69 | |
| 70 | it('should have 2 icon buttons in supplement tab', () => { |
| 71 | cy |
| 72 | .get('#ui-tabpanel-2-label') |
| 73 | .should('contain', 'supplement') |
| 74 | .click(); |
| 75 | cy |
| 76 | .get('.supplement-bar-icon-container>button') |
| 77 | .should('have.length', 2) |
| 78 | .and('be.visible') |
| 79 | .get('.supplement-bar-icon-container') |
| 80 | .children() |
| 81 | .should('have.length', 3); |
| 82 | }); |
| 83 | }); |
| 84 | }); |