2020-05-22 18:34:48 +02:00
|
|
|
describe('Actions', () => {
|
|
|
|
beforeEach(() => {
|
2021-06-09 16:58:34 +02:00
|
|
|
cy.clickNavMenu('events')
|
2020-11-13 14:59:08 +01:00
|
|
|
cy.get('[data-attr=events-actions-tab]').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Create action', () => {
|
2021-07-20 14:11:57 +02:00
|
|
|
let name = Cypress._.random(0, 1e6)
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=create-action]').click()
|
2020-05-27 12:26:36 +02:00
|
|
|
cy.get('.ant-card-head-title').should('contain', 'event or pageview')
|
|
|
|
cy.get('[data-attr=new-action-pageview]').click()
|
2020-11-05 13:55:33 +01:00
|
|
|
cy.get('h1').should('contain', 'Creating action')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2021-07-20 14:11:57 +02:00
|
|
|
cy.get('[data-attr=edit-action-input]').type(name)
|
2020-11-05 13:55:33 +01:00
|
|
|
cy.get('.ant-radio-group > :nth-child(3)').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=edit-action-url-input]').type(Cypress.config().baseUrl)
|
2021-08-18 20:13:43 +02:00
|
|
|
cy.wait(300)
|
|
|
|
cy.focused().should('have.attr', 'data-attr', 'edit-action-url-input')
|
|
|
|
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=save-action-button]').click()
|
|
|
|
|
2020-05-27 12:26:36 +02:00
|
|
|
cy.contains('Action saved').should('exist')
|
2021-07-20 14:11:57 +02:00
|
|
|
|
|
|
|
// Test the action is immediately available
|
|
|
|
cy.clickNavMenu('insights')
|
|
|
|
|
|
|
|
cy.contains('Add graph series').click()
|
|
|
|
cy.get('[data-attr=trend-element-subject-1]').click()
|
2021-07-22 20:40:49 +02:00
|
|
|
cy.get('[data-attr=taxonomic-filter-searchfield]').type(name)
|
|
|
|
cy.get('[data-attr=taxonomic-tab-actions]').click()
|
|
|
|
cy.get('[data-attr=prop-filter-actions-0]').click()
|
2021-07-20 14:11:57 +02:00
|
|
|
cy.get('[data-attr=trend-element-subject-1] span').should('contain', name)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Click on an action', () => {
|
|
|
|
cy.get('[data-attr=actions-table]').should('exist')
|
|
|
|
cy.get('[data-attr=action-link-0]').click()
|
|
|
|
cy.get('h1').should('contain', 'Editing action')
|
2020-05-22 18:34:48 +02:00
|
|
|
})
|
|
|
|
})
|