Skip to content

Leaderboards · E2E tests

0 modules · 0 exports · 1 repository · 1 e2e test · 1 route

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

Leaderboards

shows qualified players, teams and X Battle placements across the leaderboard views and the season boundary

Renders/leaderboards

Setup
Arrange
  1. Seed leaderboards
    await seedLeaderboards(factories);
LOLogged out
Leaderboards page
Act
  1. Open the leaderboards page
    await leaderboards.goto();
Assert
  1. no error page
    await expectNoErrorPage(page);
  2. top ten renders in the showcase format, the 11th entry as a normal row

    entry name “Jared” is visible
    await expect(
    	leaderboards.entryName(TOP_TEN_FIRST_PLACE_NAME),
    ).toBeVisible();
  3. entry name “Tail Ender 3” is visible
    await expect(leaderboards.entryName("Tail Ender 3")).toBeVisible();
  4. update info text is visible
    await expect(leaderboards.locators.updateInfoText).toBeVisible();
  5. N-ZAP has the highest rating of the pool but one match too few to qualify

    entry name “N-ZAP” is not visible
    await isNotVisible(leaderboards.entryName("N-ZAP"));
Act
  1. weapon category leaderboard only has the player with enough reported weapons

    Click filter chip “Shooters”
    await leaderboards.filterChip("Shooters").click();
Assert
  1. entry name “Sendou” is visible
    await expect(leaderboards.entryName("Sendou")).toBeVisible();
  2. entry name “Alpha Mate 1” is not visible
    await isNotVisible(leaderboards.entryName("Alpha Mate 1"));
Act
  1. Click tab “Teams”
    await leaderboards.tab("Teams").click();
Assert
  1. no error page
    await expectNoErrorPage(page);
  2. entry name “Alpha Mate 1” is visible
    await expect(leaderboards.entryName("Alpha Mate 1")).toBeVisible();
  3. entry name “Bravo Foe 4” is visible
    await expect(leaderboards.entryName("Bravo Foe 4")).toBeVisible();
Act
  1. Click filter chip “All rosters”
    await leaderboards.filterChip("All rosters").click();
Assert
  1. filter chip radio “All rosters” is checked
    await expect(leaderboards.filterChipRadio("All rosters")).toBeChecked();
  2. entry name “Alpha Mate 1” is visible
    await expect(leaderboards.entryName("Alpha Mate 1")).toBeVisible();
  3. entry name “Bravo Foe 4” is visible
    await expect(leaderboards.entryName("Bravo Foe 4")).toBeVisible();
Act
  1. Click tab “X Battle”
    await leaderboards.tab("X Battle").click();
Assert
  1. no error page
    await expectNoErrorPage(page);
  2. entry name “XP Zones Ace” is visible
    await expect(leaderboards.entryName("XP Zones Ace")).toBeVisible();
  3. entry name “XP Tower Ace” is visible
    await expect(leaderboards.entryName("XP Tower Ace")).toBeVisible();
Act
  1. Click filter chip “Tower Control”
    await leaderboards.filterChip("Tower Control").click();
Assert
  1. entry name “XP Zones Ace” is not visible
    await isNotVisible(leaderboards.entryName("XP Zones Ace"));
  2. entry name “XP Tower Ace” is visible
    await expect(leaderboards.entryName("XP Tower Ace")).toBeVisible();
Act
  1. Select XP weapon “Splattershot”
    await leaderboards.selectXPWeapon("Splattershot");
Assert
  1. entry name “XP Tower Ace” is not visible
    await isNotVisible(leaderboards.entryName("XP Tower Ace"));
  2. entry name “XP Zones Ace” is visible
    await expect(leaderboards.entryName("XP Zones Ace")).toBeVisible();
Act
  1. once the season ends the page defaults to the previous, empty season

    End season
    await endSeason(page);
  2. Open the leaderboards page
    await leaderboards.goto();
Assert
  1. no error page
    await expectNoErrorPage(page);
  2. no players text is visible
    await expect(leaderboards.locators.noPlayersText).toBeVisible();
Act
  1. the ended season stays browsable via the season select, now finalized

    Select season 1
    await leaderboards.selectSeason(CURRENT_SEASON);
Assert
  1. entry name “Jared” is visible
    await expect(
    	leaderboards.entryName(TOP_TEN_FIRST_PLACE_NAME),
    ).toBeVisible();
  2. entry name “Tail Ender 3” is visible
    await expect(leaderboards.entryName("Tail Ender 3")).toBeVisible();
Source
test("shows qualified players, teams and X Battle placements across the leaderboard views and the season boundary", async ({
	page,
	factories,
}) => {
	await seedLeaderboards(factories);

	const leaderboards = new LeaderboardsPage(page);
	await leaderboards.goto();
	await expectNoErrorPage(page);

	// top ten renders in the showcase format, the 11th entry as a normal row
	await expect(
		leaderboards.entryName(TOP_TEN_FIRST_PLACE_NAME),
	).toBeVisible();
	await expect(leaderboards.entryName("Tail Ender 3")).toBeVisible();
	await expect(leaderboards.locators.updateInfoText).toBeVisible();

	// N-ZAP has the highest rating of the pool but one match too few to qualify
	await isNotVisible(leaderboards.entryName("N-ZAP"));

	// weapon category leaderboard only has the player with enough reported weapons
	await leaderboards.filterChip("Shooters").click();
	await expect(leaderboards.entryName("Sendou")).toBeVisible();
	await isNotVisible(leaderboards.entryName("Alpha Mate 1"));

	await leaderboards.tab("Teams").click();
	await expectNoErrorPage(page);
	await expect(leaderboards.entryName("Alpha Mate 1")).toBeVisible();
	await expect(leaderboards.entryName("Bravo Foe 4")).toBeVisible();

	await leaderboards.filterChip("All rosters").click();
	await expect(leaderboards.filterChipRadio("All rosters")).toBeChecked();
	await expect(leaderboards.entryName("Alpha Mate 1")).toBeVisible();
	await expect(leaderboards.entryName("Bravo Foe 4")).toBeVisible();

	await leaderboards.tab("X Battle").click();
	await expectNoErrorPage(page);
	await expect(leaderboards.entryName("XP Zones Ace")).toBeVisible();
	await expect(leaderboards.entryName("XP Tower Ace")).toBeVisible();

	await leaderboards.filterChip("Tower Control").click();
	await isNotVisible(leaderboards.entryName("XP Zones Ace"));
	await expect(leaderboards.entryName("XP Tower Ace")).toBeVisible();

	await leaderboards.selectXPWeapon("Splattershot");
	await isNotVisible(leaderboards.entryName("XP Tower Ace"));
	await expect(leaderboards.entryName("XP Zones Ace")).toBeVisible();

	// once the season ends the page defaults to the previous, empty season
	await endSeason(page);
	await leaderboards.goto();
	await expectNoErrorPage(page);
	await expect(leaderboards.locators.noPlayersText).toBeVisible();

	// the ended season stays browsable via the season select, now finalized
	await leaderboards.selectSeason(CURRENT_SEASON);
	await expect(
		leaderboards.entryName(TOP_TEN_FIRST_PLACE_NAME),
	).toBeVisible();
	await expect(leaderboards.entryName("Tail Ender 3")).toBeVisible();
})