2021-03-27 01:38:13 +01:00
|
|
|
describe('Dashboard', () => {
|
2020-05-19 20:48:10 +02:00
|
|
|
beforeEach(() => {
|
2021-06-09 16:58:34 +02:00
|
|
|
cy.clickNavMenu('dashboards')
|
2020-09-18 15:26:12 +02:00
|
|
|
cy.location('pathname').should('include', '/dashboard')
|
2020-05-19 20:48:10 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Dashboards loaded', () => {
|
|
|
|
cy.get('h1').should('contain', 'Dashboards')
|
|
|
|
})
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2021-03-27 01:38:13 +01:00
|
|
|
it('Cannot see tags or description (non-FOSS feature)', () => {
|
|
|
|
cy.get('h1').should('contain', 'Dashboards')
|
|
|
|
cy.get('th.ant-table-cell').contains('Description').should('not.exist')
|
|
|
|
cy.get('th.ant-table-cell').contains('Tags').should('not.exist')
|
|
|
|
|
2021-06-29 22:20:02 +02:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('App Analytics').click()
|
2021-03-27 01:38:13 +01:00
|
|
|
cy.get('[data-attr=dashboard-item-0]').should('exist')
|
|
|
|
cy.get('.dashboard-description').should('not.exist')
|
|
|
|
cy.get('[data-attr=dashboard-tags]').should('not.exist')
|
|
|
|
})
|
|
|
|
|
2021-02-04 10:53:00 +01:00
|
|
|
it('Pinned dashboards on menu', () => {
|
2021-06-09 16:58:34 +02:00
|
|
|
cy.clickNavMenu('events') // to make sure the dashboards menu item is not the active one
|
2021-02-04 10:53:00 +01:00
|
|
|
cy.get('[data-attr=menu-item-dashboards]').trigger('mouseover') // hover over dashboards menu item
|
|
|
|
cy.get('.pinned-dashboards').should('be.visible')
|
|
|
|
cy.get('[data-attr=menu-item-dashboard-0]').should('be.visible')
|
|
|
|
})
|
|
|
|
|
2020-07-23 10:41:59 +02:00
|
|
|
it('Share dashboard', () => {
|
2021-06-29 22:20:02 +02:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('App Analytics').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0]').should('exist')
|
2020-07-23 10:41:59 +02:00
|
|
|
|
|
|
|
cy.get('[data-attr=dashboard-share-button]').click()
|
|
|
|
cy.get('[data-attr=share-dashboard-switch]').click()
|
|
|
|
cy.get('[data-attr=share-dashboard-link]')
|
|
|
|
.invoke('val')
|
|
|
|
.then((link) => {
|
2020-08-22 18:03:12 +02:00
|
|
|
cy.wait(200)
|
2020-07-23 10:41:59 +02:00
|
|
|
cy.visit(link)
|
2021-06-29 22:20:02 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-title]').should(
|
|
|
|
'contain',
|
|
|
|
'Installed App -> Rated App -> Rated App 5 Stars'
|
|
|
|
)
|
2020-07-23 10:41:59 +02:00
|
|
|
})
|
2020-05-22 18:34:48 +02:00
|
|
|
})
|
2020-07-10 19:21:30 +02:00
|
|
|
|
2020-10-28 12:41:24 +01:00
|
|
|
it('Create an empty dashboard', () => {
|
|
|
|
cy.get('[data-attr="new-dashboard"]').click()
|
2021-03-22 14:22:00 +01:00
|
|
|
cy.get('[data-attr=dashboard-name-input]').clear().type('New Dashboard')
|
2020-10-28 12:41:24 +01:00
|
|
|
cy.get('button').contains('Create').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
|
2021-03-22 14:22:00 +01:00
|
|
|
cy.contains('New Dashboard').should('exist')
|
|
|
|
cy.get('.empty-state').should('exist')
|
2020-10-28 12:41:24 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Create dashboard from a template', () => {
|
|
|
|
cy.get('[data-attr="new-dashboard"]').click()
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name-input]').clear().type('XDefault')
|
2020-10-28 12:41:24 +01:00
|
|
|
cy.get('[data-attr=copy-from-template]').click()
|
2020-10-28 15:13:07 +01:00
|
|
|
cy.get('[data-attr=dashboard-select-default-app]').click()
|
2020-10-28 12:41:24 +01:00
|
|
|
|
|
|
|
cy.get('button').contains('Create').click()
|
|
|
|
|
|
|
|
cy.contains('XDefault').should('exist')
|
|
|
|
cy.get('.dashboard-item').its('length').should('be.gte', 2)
|
2020-07-10 19:21:30 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Click on a dashboard item dropdown and view graph', () => {
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('Web Analytics').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown]').click()
|
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown-view]').click()
|
2020-07-29 17:51:49 +02:00
|
|
|
cy.location('pathname').should('include', '/insights')
|
2020-07-10 19:21:30 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Rename dashboard item', () => {
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('Web Analytics').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown]').click()
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-rename"]').click({ force: true })
|
|
|
|
|
|
|
|
cy.get('[data-attr=modal-prompt]').clear().type('Test Name')
|
|
|
|
cy.contains('OK').click()
|
|
|
|
cy.contains('Test Name').should('exist')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Color dashboard item', () => {
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('Web Analytics').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown]').click()
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-color"]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-color-1"]').click({ force: true })
|
|
|
|
cy.get('[data-attr="dashboard-item-0"]').should(
|
|
|
|
'have.css',
|
|
|
|
'background',
|
|
|
|
'rgb(38, 98, 166) none repeat scroll 0% 0% / auto padding-box border-box'
|
|
|
|
) //hard coded to the blue that's set
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Copy dashboard item', () => {
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('Web Analytics').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown]').click()
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-copy"]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-copy-0"]').click({ force: true })
|
|
|
|
cy.get('[data-attr=success-toast]').should('exist')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Duplicate dashboard item', () => {
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('Web Analytics').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown]').click()
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-duplicate"]').click({ force: true })
|
|
|
|
cy.get('[data-attr=success-toast]').should('exist')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Move dashboard item', () => {
|
2021-01-28 12:50:01 +01:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('Web Analytics').click()
|
2020-07-10 19:21:30 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0-dropdown]').click()
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-move"]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr="dashboard-item-0-dropdown-move-0"]').click({ force: true })
|
|
|
|
cy.get('[data-attr=success-toast]').should('exist')
|
|
|
|
})
|
2021-04-09 00:57:12 +02:00
|
|
|
|
|
|
|
it('Opens dashboard item in insights', () => {
|
2021-06-29 22:20:02 +02:00
|
|
|
cy.get('[data-attr=dashboard-name]').contains('App Analytics').click()
|
2021-04-09 00:57:12 +02:00
|
|
|
cy.get('[data-attr=dashboard-item-0] .dashboard-item-title a').click()
|
2021-05-10 20:11:35 +02:00
|
|
|
cy.location('pathname').should('include', '/insights')
|
2021-07-22 20:40:49 +02:00
|
|
|
cy.get('[data-attr=funnel-bar-graph]', { timeout: 30000 }).should('exist')
|
2021-04-09 00:57:12 +02:00
|
|
|
})
|
2020-05-19 20:48:10 +02:00
|
|
|
})
|