2023-10-12 16:43:06 +02:00
|
|
|
describe('Early Access Management', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.visit('/early_access_features')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Early access feature new and list', () => {
|
|
|
|
// load an empty early access feature page
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.get('h1').should('contain', 'Early access features')
|
2023-11-20 12:53:12 +01:00
|
|
|
cy.title().should('equal', 'Early access features • PostHog')
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.contains('Create your first feature').should('exist')
|
2023-12-07 17:56:39 +01:00
|
|
|
cy.get('[data-attr="product-introduction-docs-link"]').should('contain', 'Learn more')
|
2023-10-12 16:43:06 +02:00
|
|
|
|
|
|
|
// go to create a new feature
|
|
|
|
cy.get('[data-attr="create-feature"]').click()
|
|
|
|
|
|
|
|
// cancel new feature
|
|
|
|
cy.get('[data-attr="cancel-feature"]').click()
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.get('h1').should('contain', 'Early access features')
|
2023-10-12 16:43:06 +02:00
|
|
|
|
|
|
|
// set feature name & description
|
|
|
|
cy.get('[data-attr="create-feature"]').click()
|
|
|
|
cy.get('[data-attr="feature-name"]').type('Test Feature')
|
|
|
|
cy.get('[data-attr="save-feature').should('contain.text', 'Save as draft')
|
|
|
|
|
|
|
|
// save
|
|
|
|
cy.get('[data-attr="save-feature"]').click()
|
|
|
|
cy.get('[data-attr=success-toast]').contains('Early Access Feature saved').should('exist')
|
|
|
|
|
|
|
|
// back to features
|
|
|
|
cy.visit('/early_access_features')
|
|
|
|
cy.get('tbody').contains('Test Feature')
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.contains('Create your first feature').should('not.exist')
|
2023-10-12 16:43:06 +02:00
|
|
|
|
|
|
|
// edit feature
|
|
|
|
cy.get('a.Link').contains('.row-name', 'Test Feature').click()
|
|
|
|
cy.get('[data-attr="edit-feature"]').click()
|
|
|
|
cy.get('h1').should('contain', 'Test Feature')
|
|
|
|
cy.get('[data-attr="save-feature"]').should('contain.text', 'Save')
|
|
|
|
|
|
|
|
// delete feature
|
|
|
|
cy.get('[data-attr="save-feature"]').click()
|
|
|
|
cy.get('[data-attr="delete-feature"]').click()
|
|
|
|
cy.get('h3').should('contain', 'Permanently delete feature?')
|
|
|
|
cy.get('[data-attr="confirm-delete-feature"]').click()
|
|
|
|
cy.get('[data-attr=info-toast]')
|
|
|
|
.contains('Early access feature deleted. Remember to delete corresponding feature flag if necessary')
|
|
|
|
.should('exist')
|
|
|
|
})
|
|
|
|
})
|