Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assets/template/fixtures/slide-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1279,15 +1279,15 @@ const slideFixtures = [
},
},
{
id: "rss-0",
id: "rss-0-no-feed-progress",
templateData: {
id: "01FQC300GGWCA7A8H0SXY6P9FG",
},
themeFile: null,
feed: {
configuration: {
numberOfEntries: 5,
entryDuration: 10,
entryDuration: 2,
showFeedProgress: false,
},
},
Expand Down Expand Up @@ -1342,15 +1342,15 @@ const slideFixtures = [
},
},
{
id: "rss-1",
id: "rss-1-with-progress",
templateData: {
id: "01FQC300GGWCA7A8H0SXY6P9FG",
},
themeFile: null,
feed: {
configuration: {
numberOfEntries: 5,
entryDuration: 10,
entryDuration: 2,
showFeedProgress: true,
},
},
Expand Down
87 changes: 80 additions & 7 deletions assets/tests/template/template-rss.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,86 @@
import { test, expect } from "@playwright/test";

test("RSS 0", async ({ page }) => {
await page.goto("/template/rss-0");
test.describe("rss-0-no-feed-progress: ui tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/template/rss-0-no-feed-progress");
});

// TODO
});
test("Should render the outer container with correct class and background image", async ({
page,
}) => {
const container = page.locator(".template-rss");
await expect(container).toBeVisible();
await expect(container).toHaveClass(/media-contain/);
await expect(container).toHaveCSS("background-image", /mountain1\.jpeg/);
});

test("Should not render progress", async ({ page }) => {
const progress = page.locator(".feed-info--progress-numbers");
await expect(progress).not.toBeVisible();
});

test("Should display the correct title in the feed-info section first entry", async ({
page,
}) => {
const feedTitle = page.locator(".feed-info--title");
await expect(feedTitle).toBeVisible();
await expect(feedTitle).toHaveText("Lorem Ipsum");
});

test("Should display the main heading inside content block first entry", async ({
page,
}) => {
const heading = page.locator(".title");
await expect(heading).toBeVisible();
await expect(heading).toHaveText("Lorem ipsum dolor sit amet.");
});

test("Should display the correct description paragraph text first entry", async ({
page,
}) => {
const description = page.locator(".description");
await expect(description).toBeVisible();
await expect(description).toHaveText(
"Aenean scelerisque ligula ante, sed tristique tellus blandit sit amet. Vestibulum sagittis lobortis purus quis tempor. Aliquam pretium vitae risus id condimentum.",
);
});
test("Should display the correct title in the feed-info section second entry", async ({
page,
}) => {
await page.waitForTimeout(2100);

test("RSS 1", async ({ page }) => {
await page.goto("/template/rss-1");
const feedTitle = page.locator(".feed-info--title");
await expect(feedTitle).toBeVisible();
await expect(feedTitle).toHaveText("Lorem Ipsum");
});

test("Should display the main heading inside content block second entry", async ({
page,
}) => {
await page.waitForTimeout(2100);

const heading = page.locator(".title");
await expect(heading).toBeVisible();
await expect(heading).toHaveText(
"Proin tempor lacinia velit, et gravida nunc faucibus eget.",
);
});

test("Should display the correct description paragraph text second entry", async ({
page,
}) => {
await page.waitForTimeout(2100);

const description = page.locator(".description");
await expect(description).toBeVisible();
await expect(description).toHaveText(
"Etiam lobortis diam purus, a condimentum nunc feugiat nec. Nunc porttitor tortor eget tortor fermentum, ac porttitor nulla imperdiet. Donec feugiat ipsum in purus congue semper. Cras ligula ipsum, porttitor eu neque at, interdum tincidunt tellus.",
);
});
});

// TODO
test("Should render progress", async ({ page }) => {
await page.goto("/template/rss-1-with-progress");
const progress = page.locator(".feed-info--progress-numbers");
await expect(progress).toBeVisible();
});
Loading