diff --git a/cypress/e2e/feeder-custom-feed.cy.ts b/cypress/e2e/feeder-custom-feed.cy.ts new file mode 100644 index 0000000..0f81749 --- /dev/null +++ b/cypress/e2e/feeder-custom-feed.cy.ts @@ -0,0 +1,57 @@ +describe("Feeder Custom Feed", () => { + beforeEach(() => { + cy.login(Cypress.env("TEST_PRX_USER"), Cypress.env("TEST_PRX_PASS")); + Cypress.config({ baseUrl: `https://${Cypress.env("FEEDER_HOST")}` }); + }); + + it("creates a new custom feed", () => { + const now = new Date().toISOString(); + const canary = `Acceptance Test: ${now}`; + // const audioFile = "cypress/samples/two-tone.mp3"; + const imageFile = "cypress/samples/1400.jpg"; + + cy.visit("/podcasts"); + cy.contains("My Podcasts"); + + // create a new podcast + cy.get('a.btn-success[href="/podcasts/new"]').click(); + cy.contains("New Podcast"); + cy.get("#podcast_title").type(canary); + cy.get("#podcast_default_feed_attributes_itunes_category").select("Business", { force: true }); + cy.get("#podcast_default_feed_attributes_itunes_subcategory").select("Careers", { + force: true, + }); + cy.contains(".btn", "Create").click(); + cy.contains("Podcast created"); + + // go to feeds and add a new custom feed + cy.contains("a", "Feeds").click(); + cy.contains(".btn", "Add a Feed").click(); + cy.get("#feed_title").type(canary); + cy.get("#feed_slug").type("customslug"); + cy.contains(".btn", "Create").click(); + cy.contains("Feed created"); + + // update and make it a private feed + cy.get("#feed_private").click(); + cy.contains(".btn", "Add Token").click(); + cy.get("[id^=feed_feed_tokens]").first().type("newtoken"); + cy.contains(".btn", "Save").click(); + + // delete the custom feed + cy.contains(".btn", "Save").next(".dropdown-toggle").click(); + cy.contains(".dropdown-item", "Delete").click(); + cy.contains("Really Delete?"); + cy.contains(".btn", "Delete").click(); + cy.contains("Feed deleted"); + + // go back to podcast settings and delete + cy.contains("a", "Settings").click({ force: true }); + cy.get("#podcast_title"); + cy.contains(".btn", "Save").next(".dropdown-toggle").click(); + cy.contains(".dropdown-item", "Delete").click(); + cy.contains("Really Delete?"); + cy.contains(".btn", "Delete").click(); + cy.contains("Podcast deleted"); + }); +});