-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(featurelist): WIP cypress tests.
- Loading branch information
Showing
3 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/// <reference types="Cypress" /> | ||
var os = require('../../support/selectors.js'); | ||
|
||
describe('Feature grid', function() { | ||
before('Login', function() { | ||
cy.login(); | ||
}); | ||
|
||
it('Shows data', function() { | ||
// Upload a file | ||
cy.get(os.Toolbar.addData.OPEN_FILE_BUTTON).click(); | ||
cy.get(os.importDataDialog.DIALOG).should('be.visible'); | ||
cy.upload('smoke-tests/load-data-file-kml/test-features.kmz'); | ||
cy.get(os.importDataDialog.NEXT_BUTTON).click(); | ||
cy.get(os.importKMLDialog.DIALOG).should('be.visible'); | ||
cy.get(os.importKMLDialog.LAYER_TITLE_INPUT).should('be.visible'); | ||
cy.get(os.importKMLDialog.OK_BUTTON).click(); | ||
|
||
// Load a layer | ||
cy.get(os.layersDialog.Tabs.Layers.Tree.LAYER_4) | ||
.should('contain', 'smoke-tests/load-data-file-kml/test-features.kmz Features (291)'); | ||
|
||
cy.get(os.layersDialog.Tabs.Layers.Tree.LAYER_4).rightClick(); | ||
cy.get(os.layersDialog.Tabs.Layers.Tree.Type.featureLayer.Local.contextMenu.menuOptions.SHOW_FEATURES).click(); | ||
cy.get('[title=\'smoke-tests/load-data-file-kml/test-features.kmz\']').should('be.visible'); | ||
|
||
// Check status bar | ||
cy.get('[data-testid=\'featurelist\']').within(function() { | ||
cy.get('[ng-if=\'ctrl.status\']').should('be.visible'); | ||
cy.get('[ng-if=\'ctrl.status\']').should('contain', '291 records'); | ||
}); | ||
|
||
cy.get('[data-testid=\'featurelist\']').within(function() { | ||
cy.get('.js-source-grid').should('be.visible'); | ||
cy.get('.js-source-grid').within(function() { | ||
cy.get('.slick-header').should('be.visible'); | ||
// Check columns | ||
cy.get('.slick-header').within(function() { | ||
cy.get('.slick-column-name').should('have.length', 14); | ||
cy.get('.slick-column-name:empty').should('exist'); | ||
cy.get('.slick-column-name').contains('TIME'); | ||
cy.get('.slick-column-name').contains('MGRS'); | ||
cy.get('.slick-column-name').contains('LAT_DMS'); | ||
cy.get('.slick-column-name').contains('LON_DMS'); | ||
cy.get('.slick-column-name').contains('LAT'); | ||
cy.get('.slick-column-name').contains('LON'); | ||
cy.get('.slick-column-name').contains('LAT_DDM'); | ||
cy.get('.slick-column-name').contains('LON_DDM'); | ||
cy.get('.slick-column-name').contains('visibility'); | ||
cy.get('.slick-column-name').contains('scan_start'); | ||
cy.get('.slick-column-name').contains('frp_mw'); | ||
cy.get('.slick-column-name').contains('confidence'); | ||
cy.get('.slick-column-name').contains('ID'); | ||
}); | ||
}); | ||
|
||
// Check data | ||
cy.get('.slick-viewport').should('be.visible'); | ||
cy.get('.slick-viewport').within(function() { | ||
cy.get('.slick-cell').contains('2018-12-18 17:08:37Z'); | ||
}); | ||
}); | ||
|
||
// Check selection | ||
cy.get('[data-testid=\'featurelist\'] .slick-row').first().click(); | ||
cy.get('[data-testid=\'featurelist\'] [ng-if=\'ctrl.status\']').should('contain', '291 records (1 selected)'); | ||
|
||
// Check context menu works. | ||
cy.get('[data-testid=\'featurelist\'] .slick-row').first().rightClick(); | ||
cy.get('[title=\'Deselects all items\']').click(); | ||
cy.get('[data-testid=\'featurelist\'] [ng-if=\'ctrl.status\']').should('contain', '291 records'); | ||
cy.get('[data-testid=\'featurelist\'] .slick-row').first().click(); | ||
cy.get('[data-testid=\'featurelist\'] [ng-if=\'ctrl.status\']').should('contain', '291 records (1 selected)'); | ||
cy.get('[data-testid=\'featurelist\'] .slick-row').first().rightClick(); | ||
cy.get('[title=\'Inverts the selection\']').click(); | ||
cy.get('[data-testid=\'featurelist\'] [ng-if=\'ctrl.status\']').should('contain', '291 records (290 selected)'); | ||
// TODO: remaining menu items | ||
|
||
// Check Close button works | ||
cy.get('[data-testid=\'featurelist\']').within(function() { | ||
cy.get('[ng-click=\'ctrl.close()\']').should('be.visible'); | ||
cy.get('[ng-click=\'ctrl.close()\']').click(); | ||
}); | ||
cy.get('[title=\'smoke-tests/load-data-file-kml/test-features.kmz\']').should('not.exist'); | ||
|
||
// Clean up | ||
cy.get(os.layersDialog.Tabs.Layers.Tree.LAYER_4) | ||
.should('contain', 'smoke-tests/load-data-file-kml/test-features.kmz Features (291)'); | ||
cy.get(os.layersDialog.Tabs.Layers.Tree.LAYER_4).click(); | ||
cy.get(os.layersDialog.Tabs.Layers.Tree.Type.featureLayer.REMOVE_LAYER_BUTTON_WILDCARD).click(); | ||
cy.get(os.layersDialog.DIALOG).should('not.contain', 'smoke-tests/load-data-file-kml/test-features.kmz Features'); | ||
cy.get(os.Application.PAGE).type('v'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters