Skip to content

Articles · E2E tests

2 modules · 7 exports · 0 repositories · 9 e2e tests · 2 routes

  • Arrange data setup
  • Act what the user does
  • Assert what is expected

Articles

Listing

/a lists the 100 newest articles, the newest first, each with who wrote it and when.

lists the newest articles first

LOLogged out
Articles page
Act
  1. Open the articles page
    await articles.goto();
Assert
  1. article link “20XX Series 6 Recap” is visible
    await expect(
    	articles.articleLink(NEWER_THAN_RIPTIDE_TITLE),
    ).toBeVisible();
Act
  1. List position “20XX Series 6 Recap” → newerPosition
    const newerPosition = await articles.listPosition(
    	NEWER_THAN_RIPTIDE_TITLE,
    );
  2. List position “Results from Riptide 2025” → riptidePosition
    const riptidePosition = await articles.listPosition(RIPTIDE_TITLE);
Assert
  1. newerPosition is less than riptidePosition
    expect(newerPosition).toBeLessThan(riptidePosition);
Source
test("lists the newest articles first", async ({ page }) => {
	const articles = new ArticlesPage(page);
	await articles.goto();

	await expect(
		articles.articleLink(NEWER_THAN_RIPTIDE_TITLE),
	).toBeVisible();
	const newerPosition = await articles.listPosition(
		NEWER_THAN_RIPTIDE_TITLE,
	);
	const riptidePosition = await articles.listPosition(RIPTIDE_TITLE);

	expect(newerPosition).toBeLessThan(riptidePosition);
})

shows each article's authors and date

LOLogged out
Articles page
Act
  1. Open the articles page
    await articles.goto();
Assert
  1. article “SendouQ Season 8 Finale Recap” contains “by Ckk, Fern, & Samino”
    await expect(articles.article(SEASON_8_RECAP_TITLE)).toContainText(
    	"by Ckk, Fern, & Samino",
    );
  2. article “SendouQ Season 8 Finale Recap” contains “9/4/2025”
    await expect(articles.article(SEASON_8_RECAP_TITLE)).toContainText(
    	"9/4/2025",
    );
Source
test("shows each article's authors and date", async ({ page }) => {
	const articles = new ArticlesPage(page);
	await articles.goto();

	await expect(articles.article(SEASON_8_RECAP_TITLE)).toContainText(
		"by Ckk, Fern, & Samino",
	);
	await expect(articles.article(SEASON_8_RECAP_TITLE)).toContainText(
		"9/4/2025",
	);
})

opening an article leads to its page

LOLogged out
Articles page
Act
  1. Open the articles page
    await articles.goto();
  2. Open article “Results from Riptide 2025” → article
    const article = await articles.openArticle(RIPTIDE_TITLE);
Assert
  1. the page URL is `/a/${RIPTIDE_SLUG}`
    await expect(page).toHaveURL(`/a/${RIPTIDE_SLUG}`);
Article page
Assert
  1. heading “Results from Riptide 2025” is visible
    await expect(article.heading(RIPTIDE_TITLE)).toBeVisible();
Source
test("opening an article leads to its page", async ({ page }) => {
	const articles = new ArticlesPage(page);
	await articles.goto();

	const article = await articles.openArticle(RIPTIDE_TITLE);

	await expect(page).toHaveURL(`/a/${RIPTIDE_SLUG}`);
	await expect(article.heading(RIPTIDE_TITLE)).toBeVisible();
})

Reading

An article's page shows its title, authors and date above the markdown text. Authors with a sendou.ink link lead to their user page.

shows the title, authors and date above the text

LOLogged out
Article page
Act
  1. Open the article page “results-from-riptide-2025”
    await article.goto(RIPTIDE_SLUG);
Assert
  1. heading “Results from Riptide 2025” is visible
    await expect(article.heading(RIPTIDE_TITLE)).toBeVisible();
  2. byline reads `by YELLOW • ${RIPTIDE_DATE}`
    await expect(article.locators.byline).toHaveText(
    	`by YELLOW • ${RIPTIDE_DATE}`,
    );
  3. text “largest North American Splatoon LAN in history” is visible
    await expect(
    	article.text("largest North American Splatoon LAN in history"),
    ).toBeVisible();
Source
test("shows the title, authors and date above the text", async ({
	page,
}) => {
	const article = new ArticlePage(page);
	await article.goto(RIPTIDE_SLUG);

	await expect(article.heading(RIPTIDE_TITLE)).toBeVisible();
	await expect(article.locators.byline).toHaveText(
		`by YELLOW • ${RIPTIDE_DATE}`,
	);
	await expect(
		article.text("largest North American Splatoon LAN in history"),
	).toBeVisible();
})
LOLogged out
Article page
Act
  1. Open the article page “competitive-guidebook-part-1”
    await article.goto(GUIDEBOOK_SLUG);
Assert
  1. byline contains “by Samino & Radha”
    await expect(article.locators.byline).toContainText("by Samino & Radha");
  2. author link “Samino” has “href” = “/u/samino”
    await expect(article.authorLink("Samino")).toHaveAttribute(
    	"href",
    	"/u/samino",
    );
  3. author link “Radha” has “href” = “/u/wiper”
    await expect(article.authorLink("Radha")).toHaveAttribute(
    	"href",
    	"/u/wiper",
    );
Source
test("links authors to their sendou.ink user page", async ({ page }) => {
	const article = new ArticlePage(page);
	await article.goto(GUIDEBOOK_SLUG);

	await expect(article.locators.byline).toContainText("by Samino & Radha");
	await expect(article.authorLink("Samino")).toHaveAttribute(
		"href",
		"/u/samino",
	);
	await expect(article.authorLink("Radha")).toHaveAttribute(
		"href",
		"/u/wiper",
	);
})
LOLogged out
Article page
Act
  1. Open the article page “belgian-championship-2023”
    await article.goto(BELGIAN_CHAMPIONSHIP_SLUG);
Assert
  1. byline contains “by 공주 Alice & Chilliboi”
    await expect(article.locators.byline).toContainText(
    	"by 공주 Alice & Chilliboi",
    );
  2. byline › link count is 0
    await expect(article.locators.byline.getByRole("link")).toHaveCount(0);
Source
test("shows an author without a link as plain text", async ({ page }) => {
	const article = new ArticlePage(page);
	await article.goto(BELGIAN_CHAMPIONSHIP_SLUG);

	await expect(article.locators.byline).toContainText(
		"by 공주 Alice & Chilliboi",
	);
	await expect(article.locators.byline.getByRole("link")).toHaveCount(0);
})

doesn't repeat the title the text starts with

The title isn't shown twice when the text starts with it as a heading.

LOLogged out
Article page
Act
  1. Open the article page “waving-goodbye-the-start-of-splatoons-great-retirement”
    await article.goto(WAVING_GOODBYE_SLUG);
Assert
  1. headings “Waving Goodbye: The Start of Splatoon's "Great Retirement"” count is 1
    await expect(article.headings(WAVING_GOODBYE_TITLE)).toHaveCount(1);
Source
test("doesn't repeat the title the text starts with", async ({ page }) => {
	const article = new ArticlePage(page);
	await article.goto(WAVING_GOODBYE_SLUG);

	await expect(article.headings(WAVING_GOODBYE_TITLE)).toHaveCount(1);
})

an unknown slug is not found

LOLogged out
Error page
Act
  1. Open the error page “/a/no-such-article”
    await errorPage.goto("/a/no-such-article");
Assert
  1. not found heading is visible
    await expect(errorPage.locators.notFoundHeading).toBeVisible();
Source
test("an unknown slug is not found", async ({ page }) => {
	const errorPage = new ErrorPage(page);
	await errorPage.goto("/a/no-such-article");

	await expect(errorPage.locators.notFoundHeading).toBeVisible();
})

Dates

An article's date is a calendar day, shown as the same day in every time zone.

Runs with { timezoneId: WEST_OF_UTC_TIMEZONE }

shows the article's day west of UTC too

LOLogged out
Articles page
Act
  1. Open the articles page
    await articles.goto();
Assert
  1. article “Results from Riptide 2025” contains “9/13/2025”
    await expect(articles.article(RIPTIDE_TITLE)).toContainText(RIPTIDE_DATE);
Act
  1. Open article “Results from Riptide 2025” → article
    const article = await articles.openArticle(RIPTIDE_TITLE);
Article page
Assert
  1. byline contains “9/13/2025”
    await expect(article.locators.byline).toContainText(RIPTIDE_DATE);
Source
test("shows the article's day west of UTC too", async ({ page }) => {
	await setTimezoneCookie(page, WEST_OF_UTC_TIMEZONE);

	const articles = new ArticlesPage(page);
	await articles.goto();
	await expect(articles.article(RIPTIDE_TITLE)).toContainText(RIPTIDE_DATE);

	const article = await articles.openArticle(RIPTIDE_TITLE);
	await expect(article.locators.byline).toContainText(RIPTIDE_DATE);
})