diff --git a/cypress/e2e/widgets/ansible-automation.cy.ts b/cypress/e2e/widgets/ansible-automation.cy.ts new file mode 100644 index 00000000..e28883c2 --- /dev/null +++ b/cypress/e2e/widgets/ansible-automation.cy.ts @@ -0,0 +1,26 @@ +describe('Ansible Automation Platform Widget', () => { + const widgetID = 'landing-ansible-widget'; + const widgetLoc = `data-ouia-component-id="${widgetID}"`; + + beforeEach(() => { + cy.loadLandingPage(); + }); + + it('appears in the default layout', () => { + // scroll into view for if the widget is lower on the page + cy.get(`[${widgetLoc}]`).scrollIntoView().should('be.visible'); + }); + + it('has the correct link', () => { + cy.get(`[${widgetLoc}] a`) + .should('have.attr', 'href') + .and('include', '/ansible/ansible-dashboard'); + }); + + it('is removed if the remove button is clicked', () => { + cy.get(`[${widgetLoc}]`).scrollIntoView().should('be.visible'); + cy.removeWidget(widgetID); + // cleanup + cy.resetToDefaultLayout(); + }); +});