Skip to content

Commit

Permalink
Add testing for custom feed crud
Browse files Browse the repository at this point in the history
  • Loading branch information
radical-ube committed Aug 20, 2024
1 parent 4eba534 commit 7f1174c
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions cypress/e2e/feeder-custom-feed.cy.ts
Original file line number Diff line number Diff line change
@@ -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");
});
});

0 comments on commit 7f1174c

Please sign in to comment.