Skip to content

Broadcast · E2E tests

7 modules · 55 exports · 1 repository · 9 e2e tests · 1 route

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

Broadcast

casts a match, takes scenes, edits the queue and holds next

Setup
Arrange
  1. Create broadcasting author N-ZAP is match cast false → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    	isMatchCast: false,
    });
NN-ZAP
Broadcast dashboard page
Act
  1. Open the broadcast dashboard page
    await dashboard.goto();
Assert
  1. no featured match is visible
    await expect(dashboard.locators.noFeaturedMatch).toBeVisible();
Tournament match page
Act
  1. Open the tournament match page tournament id tournament.id match id tournament.matchId
    await match.goto({
    	tournamentId: tournament.id,
    	matchId: tournament.matchId,
    });
  2. Open tab “admin”
    await match.openTab("admin");
  3. Set casted by “broadcast_cast”
    await match.setCastedBy(CAST_ACCOUNT);
Broadcast dashboard page
Act
  1. Open the broadcast dashboard page
    await dashboard.goto();
Assert
  1. featured match contains “Team 1”
    await expect(dashboard.locators.featuredMatch).toContainText("Team 1");
  2. featured match contains “Team 2”
    await expect(dashboard.locators.featuredMatch).toContainText("Team 2");
  3. view heading “live”, “rosters” is visible
    await expect(dashboard.viewHeading("live", "rosters")).toBeVisible();
  4. view heading “next”, “game” is visible
    await expect(dashboard.viewHeading("next", "game")).toBeVisible();
  5. on game start is visible
    await expect(dashboard.locators.onGameStart).toBeVisible();
Act
  1. Hold
    await dashboard.hold();
Assert
  1. on game start is hidden
    await expect(dashboard.locators.onGameStart).toBeHidden();
  2. hold button is hidden
    await expect(dashboard.locators.holdButton).toBeHidden();
Act
  1. Take
    await dashboard.take();
Assert
  1. view heading “live”, “game” is visible
    await expect(dashboard.viewHeading("live", "game")).toBeVisible();
  2. view heading “next”, “results” is visible
    await expect(dashboard.viewHeading("next", "results")).toBeVisible();
Act
  1. Queue scene
    await dashboard.queueScene();
Assert
  1. queue item 1 is visible
    await expect(dashboard.queueItem(1)).toBeVisible();
Act
  1. Pick scene “bracket”
    await dashboard.pickScene("bracket");
Assert
  1. queue item 1 contains “Bracket”
    await expect(dashboard.queueItem(1)).toContainText("Bracket");
Act
  1. Select queue item 0
    await dashboard.selectQueueItem(0);
  2. Remove queue item 0
    await dashboard.removeQueueItem(0);
Assert
  1. queue item 1 is hidden
    await expect(dashboard.queueItem(1)).toBeHidden();
  2. view heading “next”, “bracket” is visible
    await expect(dashboard.viewHeading("next", "bracket")).toBeVisible();
Act
  1. Take
    await dashboard.take();
Assert
  1. view heading “live”, “bracket” is visible
    await expect(dashboard.viewHeading("live", "bracket")).toBeVisible();
Source
test("casts a match, takes scenes, edits the queue and holds next", async ({
	page,
	factories,
}) => {
	const tournament = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
		isMatchCast: false,
	});

	await impersonate(page, NZAP_TEST_ID);
	const dashboard = new BroadcastDashboardPage(page, pageArgs(tournament.id));
	await dashboard.goto();
	await expect(dashboard.locators.noFeaturedMatch).toBeVisible();

	const match = new TournamentMatchPage(page);
	await match.goto({
		tournamentId: tournament.id,
		matchId: tournament.matchId,
	});
	await match.openTab("admin");
	await match.setCastedBy(CAST_ACCOUNT);

	await dashboard.goto();
	await expect(dashboard.locators.featuredMatch).toContainText("Team 1");
	await expect(dashboard.locators.featuredMatch).toContainText("Team 2");
	await expect(dashboard.viewHeading("live", "rosters")).toBeVisible();
	await expect(dashboard.viewHeading("next", "game")).toBeVisible();

	await expect(dashboard.locators.onGameStart).toBeVisible();
	await dashboard.hold();
	await expect(dashboard.locators.onGameStart).toBeHidden();
	await expect(dashboard.locators.holdButton).toBeHidden();

	await dashboard.take();
	await expect(dashboard.viewHeading("live", "game")).toBeVisible();
	await expect(dashboard.viewHeading("next", "results")).toBeVisible();

	await dashboard.queueScene();
	await expect(dashboard.queueItem(1)).toBeVisible();
	await dashboard.pickScene("bracket");
	await expect(dashboard.queueItem(1)).toContainText("Bracket");

	await dashboard.selectQueueItem(0);
	await dashboard.removeQueueItem(0);
	await expect(dashboard.queueItem(1)).toBeHidden();
	await expect(dashboard.viewHeading("next", "bracket")).toBeVisible();

	await dashboard.take();
	await expect(dashboard.viewHeading("live", "bracket")).toBeVisible();
})

cuts to the game on the program when the scanner sees it start

Setup
Arrange
  1. Create broadcasting author N-ZAP → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    });
NN-ZAP
Broadcast dashboard page
Act
  1. Open the broadcast dashboard page
    await dashboard.goto();
  2. Open obs source browser base URL baseURL! tournament id tournament.id program key tournament.programKey → obs
    const obs = await openObsSource({
    	browser,
    	baseURL: baseURL!,
    	tournamentId: tournament.id,
    	programKey: tournament.programKey,
    });
Assert
  1. obs.program.scene("rosters") is visible
    await expect(obs.program.scene("rosters")).toBeVisible();
  2. post game signal type “start” inks null is 200
    expect(await dashboard.postGameSignal({ type: "start", inks: null })).toBe(
    	200,
    );
  3. view heading “live”, “game” is visible
    await expect(dashboard.viewHeading("live", "game")).toBeVisible();
  4. obs.program.scene("game") is visible
    await expect(obs.program.scene("game")).toBeVisible();
Act
  1. Close
    await obs.close();
Source
test("cuts to the game on the program when the scanner sees it start", async ({
	page,
	browser,
	baseURL,
	factories,
}) => {
	const tournament = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
	});

	await impersonate(page, NZAP_TEST_ID);
	const dashboard = new BroadcastDashboardPage(page, pageArgs(tournament.id));
	await dashboard.goto();
	const obs = await openObsSource({
		browser,
		baseURL: baseURL!,
		tournamentId: tournament.id,
		programKey: tournament.programKey,
	});
	await expect(obs.program.scene("rosters")).toBeVisible();

	expect(await dashboard.postGameSignal({ type: "start", inks: null })).toBe(
		200,
	);

	await expect(dashboard.viewHeading("live", "game")).toBeVisible();
	await expect(obs.program.scene("game")).toBeVisible();

	await obs.close();
})

shows a saved theme on the program

Setup
Arrange
  1. Create broadcasting author N-ZAP → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    });
NN-ZAP
Broadcast dashboard page
Act
  1. Open the broadcast dashboard page
    await dashboard.goto();
  2. Open obs source browser base URL baseURL! tournament id tournament.id program key tournament.programKey → obs
    const obs = await openObsSource({
    	browser,
    	baseURL: baseURL!,
    	tournamentId: tournament.id,
    	programKey: tournament.programKey,
    });
Assert
  1. obs.program.locators.canvas not have CSS “outline-width”, “7px”
    await expect(obs.program.locators.canvas).not.toHaveCSS(
    	"outline-width",
    	"7px",
    );
Act
  1. Save theme “[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }”
    await dashboard.saveTheme(
    	"[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }",
    );
Assert
  1. obs.program.locators.canvas have CSS “outline-width”, “7px”
    await expect(obs.program.locators.canvas).toHaveCSS("outline-width", "7px");
Act
  1. Close
    await obs.close();
Source
test("shows a saved theme on the program", async ({
	page,
	browser,
	baseURL,
	factories,
}) => {
	const tournament = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
	});

	await impersonate(page, NZAP_TEST_ID);
	const dashboard = new BroadcastDashboardPage(page, pageArgs(tournament.id));
	await dashboard.goto();
	const obs = await openObsSource({
		browser,
		baseURL: baseURL!,
		tournamentId: tournament.id,
		programKey: tournament.programKey,
	});
	await expect(obs.program.locators.canvas).not.toHaveCSS(
		"outline-width",
		"7px",
	);

	await dashboard.saveTheme(
		"[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }",
	);

	await expect(obs.program.locators.canvas).toHaveCSS("outline-width", "7px");

	await obs.close();
})

loads a preset in the designer to edit and shows it on the program

Setup
Arrange
  1. Create broadcasting author N-ZAP → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    });
NN-ZAP
Broadcast design page
Act
  1. Open the broadcast design page
    await design.goto();
Assert
  1. preset select contains “Default”
    await expect(design.locators.presetSelect).toContainText("Default");
Act
  1. Pick preset “Zine”
    await design.pickPreset("Zine");
Assert
  1. preset select contains “Zine”
    await expect(design.locators.presetSelect).toContainText("Zine");
  2. editor has value /ZINE/
    await expect(design.locators.editor).toHaveValue(/ZINE/);
Act
  1. Input value → presetCss
    const presetCss = await design.locators.editor.inputValue();
  2. Fill editor with `${presetCss}\n[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }`
    await design.locators.editor.fill(
    	`${presetCss}\n[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }`,
    );
Assert
  1. preset select contains “Your own”
    await expect(design.locators.presetSelect).toContainText("Your own");
Act
  1. Save
    await design.save();
  2. Open obs source browser base URL baseURL! tournament id tournament.id program key tournament.programKey → obs
    const obs = await openObsSource({
    	browser,
    	baseURL: baseURL!,
    	tournamentId: tournament.id,
    	programKey: tournament.programKey,
    });
Assert
  1. obs.program.locators.canvas have CSS “outline-width”, “7px”
    await expect(obs.program.locators.canvas).toHaveCSS("outline-width", "7px");
  2. obs.program.locators.canvas have CSS “color”, “rgb(20, 20, 20)”
    await expect(obs.program.locators.canvas).toHaveCSS(
    	"color",
    	"rgb(20, 20, 20)",
    );
Act
  1. Pick preset “Teletext”
    await design.pickPreset("Teletext");
  2. Click confirm preset button
    await design.locators.confirmPresetButton.click();
Assert
  1. preset select contains “Teletext”
    await expect(design.locators.presetSelect).toContainText("Teletext");
  2. editor has value /TELETEXT/
    await expect(design.locators.editor).toHaveValue(/TELETEXT/);
Act
  1. Close
    await obs.close();
Source
test("loads a preset in the designer to edit and shows it on the program", async ({
	page,
	browser,
	baseURL,
	factories,
}) => {
	const tournament = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
	});

	await impersonate(page, NZAP_TEST_ID);
	const design = new BroadcastDesignPage(page, pageArgs(tournament.id));
	await design.goto();
	await expect(design.locators.presetSelect).toContainText("Default");

	await design.pickPreset("Zine");
	await expect(design.locators.presetSelect).toContainText("Zine");
	await expect(design.locators.editor).toHaveValue(/ZINE/);

	const presetCss = await design.locators.editor.inputValue();
	await design.locators.editor.fill(
		`${presetCss}\n[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }`,
	);
	await expect(design.locators.presetSelect).toContainText("Your own");
	await design.save();

	const obs = await openObsSource({
		browser,
		baseURL: baseURL!,
		tournamentId: tournament.id,
		programKey: tournament.programKey,
	});
	await expect(obs.program.locators.canvas).toHaveCSS("outline-width", "7px");
	await expect(obs.program.locators.canvas).toHaveCSS(
		"color",
		"rgb(20, 20, 20)",
	);

	await design.pickPreset("Teletext");
	await design.locators.confirmPresetButton.click();
	await expect(design.locators.presetSelect).toContainText("Teletext");
	await expect(design.locators.editor).toHaveValue(/TELETEXT/);

	await obs.close();
})

opens the channel the OBS URL shows and switches between channels

Setup
Arrange
  1. Create 1 × user → [streamer]
    const [streamer] = await factories.UserFactory.createMany(1);
  2. Create broadcasting author N-ZAP program user id streamer.id → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    	programUserId: streamer.id,
    });
  3. Add cast account tournament tournament id tournament.id twitch account “broadcast_other”
    await factories.TournamentFactory.addCastAccount({
    	tournamentId: tournament.id,
    	twitchAccount: OTHER_CAST_ACCOUNT,
    });
  4. Point program tournament broadcast user N-ZAP tournament id tournament.id channel platform “TWITCH” account “broadcast_other”
    await factories.TournamentBroadcastFactory.pointProgram({
    	userId: NZAP_TEST_ID,
    	tournamentId: tournament.id,
    	channel: { platform: "TWITCH", account: OTHER_CAST_ACCOUNT },
    });
NN-ZAP
Broadcast page
Act
  1. Open the broadcast page
    await new BroadcastPage(page, tournament.id).goto();
Assert
  1. the page URL is broadcastDashboardPage({ tournamentId: tournament.id, slug: OTHER_CAST_ACCOUN…
    await expect(page).toHaveURL(
    	broadcastDashboardPage({
    		tournamentId: tournament.id,
    		slug: OTHER_CAST_ACCOUNT,
    	}),
    );
Broadcast dashboard page
Act
  1. Click channel chip “broadcast_cast”
    await dashboard.channelChip(CAST_ACCOUNT).click();
Assert
  1. the page URL is broadcastDashboardPage(pageArgs(tournament.id))
    await expect(page).toHaveURL(
    	broadcastDashboardPage(pageArgs(tournament.id)),
    );
  2. featured match contains “Team 1”
    await expect(dashboard.locators.featuredMatch).toContainText("Team 1");
Source
test("opens the channel the OBS URL shows and switches between channels", async ({
	page,
	factories,
}) => {
	const [streamer] = await factories.UserFactory.createMany(1);
	const tournament = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
		programUserId: streamer.id,
	});
	await factories.TournamentFactory.addCastAccount({
		tournamentId: tournament.id,
		twitchAccount: OTHER_CAST_ACCOUNT,
	});
	await factories.TournamentBroadcastFactory.pointProgram({
		userId: NZAP_TEST_ID,
		tournamentId: tournament.id,
		channel: { platform: "TWITCH", account: OTHER_CAST_ACCOUNT },
	});

	await impersonate(page, NZAP_TEST_ID);
	await new BroadcastPage(page, tournament.id).goto();
	await expect(page).toHaveURL(
		broadcastDashboardPage({
			tournamentId: tournament.id,
			slug: OTHER_CAST_ACCOUNT,
		}),
	);

	const dashboard = new BroadcastDashboardPage(page, pageArgs(tournament.id));
	await dashboard.channelChip(CAST_ACCOUNT).click();
	await expect(page).toHaveURL(
		broadcastDashboardPage(pageArgs(tournament.id)),
	);
	await expect(dashboard.locators.featuredMatch).toContainText("Team 1");
})

adds the first cast channel from the broadcast page

Setup
Arrange
  1. Create tournament author N-ZAP start times startedTournamentTimes() → tournament
    const tournament = await factories.TournamentFactory.create({
    	authorId: NZAP_TEST_ID,
    	startTimes: startedTournamentTimes(),
    });
NN-ZAP
Broadcast page
Act
  1. Open the broadcast page
    await broadcast.goto();
  2. Add channel “broadcast_cast”
    await broadcast.addChannel(CAST_ACCOUNT);
Assert
  1. the page URL is broadcastDashboardPage(pageArgs(tournament.id))
    await expect(page).toHaveURL(
    	broadcastDashboardPage(pageArgs(tournament.id)),
    );
  2. heading `Broadcast · ${CAST_ACCOUNT}` is visible
    await expect(
    	page.getByRole("heading", { name: `Broadcast · ${CAST_ACCOUNT}` }),
    ).toBeVisible();
Source
test("adds the first cast channel from the broadcast page", async ({
	page,
	factories,
}) => {
	const tournament = await factories.TournamentFactory.create({
		authorId: NZAP_TEST_ID,
		startTimes: startedTournamentTimes(),
	});

	await impersonate(page, NZAP_TEST_ID);
	const broadcast = new BroadcastPage(page, tournament.id);
	await broadcast.goto();
	await broadcast.addChannel(CAST_ACCOUNT);

	await expect(page).toHaveURL(
		broadcastDashboardPage(pageArgs(tournament.id)),
	);
	await expect(
		page.getByRole("heading", { name: `Broadcast · ${CAST_ACCOUNT}` }),
	).toBeVisible();
})

keeps everyone but producers out of producing

Setup
Arrange
  1. Create 1 × user → [organizer]
    const [organizer] = await factories.UserFactory.createMany(1);
  2. Create broadcasting author id organizer.id → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: organizer.id,
    });
NN-ZAP
Broadcast dashboard page
Assert
  1. response status is 404
    expect(await dashboard.responseStatus()).toBe(404);
  2. post game signal type “start” inks null is 404
    expect(await dashboard.postGameSignal({ type: "start", inks: null })).toBe(
    	404,
    );
Broadcast program page
Assert
  1. response status null is 404
    expect(await program.responseStatus(null)).toBe(404);
  2. response status tournament.programKey is 200
    expect(await program.responseStatus(tournament.programKey)).toBe(200);
  3. refused stream status “scanner” is 404
    expect(await program.refusedStreamStatus("scanner")).toBe(404);
  4. refused stream status “source” is 404
    expect(await program.refusedStreamStatus("source")).toBe(404);
Source
test("keeps everyone but producers out of producing", async ({
	page,
	factories,
}) => {
	const [organizer] = await factories.UserFactory.createMany(1);
	const tournament = await createBroadcasting(factories, {
		authorId: organizer.id,
	});

	await impersonate(page, NZAP_TEST_ID);
	const dashboard = new BroadcastDashboardPage(page, pageArgs(tournament.id));
	const program = new BroadcastProgramPage(page, pageArgs(tournament.id));

	expect(await dashboard.responseStatus()).toBe(404);
	expect(await dashboard.postGameSignal({ type: "start", inks: null })).toBe(
		404,
	);
	expect(await program.responseStatus(null)).toBe(404);
	expect(await program.responseStatus(tournament.programKey)).toBe(200);
	expect(await program.refusedStreamStatus("scanner")).toBe(404);
	expect(await program.refusedStreamStatus("source")).toBe(404);
})

keeps one OBS URL across tournaments, showing the broadcast it was pointed at

Setup
Arrange
  1. Create broadcasting author N-ZAP → lastWeek
    const lastWeek = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    });
  2. Create broadcasting author N-ZAP → thisWeek
    const thisWeek = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    });
LOLogged out
Assert
  1. thisWeek.programKey is lastWeek.programKey
    expect(thisWeek.programKey).toBe(lastWeek.programKey);
NN-ZAP
Broadcast dashboard page
Act
  1. Open the broadcast dashboard page
    await dashboard.goto();
  2. Save theme “[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }”
    await dashboard.saveTheme(
    	"[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }",
    );
  3. Open obs source browser base URL baseURL! tournament id thisWeek.id program key thisWeek.programKey → obs
    const obs = await openObsSource({
    	browser,
    	baseURL: baseURL!,
    	tournamentId: thisWeek.id,
    	programKey: thisWeek.programKey,
    });
Assert
  1. obs.program.scene("rosters") is visible
    await expect(obs.program.scene("rosters")).toBeVisible();
  2. obs.program.locators.canvas not have CSS “outline-width”, “7px”
    await expect(obs.program.locators.canvas).not.toHaveCSS(
    	"outline-width",
    	"7px",
    );
Act
  1. Point program
    await dashboard.pointProgram();
Assert
  1. program shows this is visible
    await expect(dashboard.locators.programShowsThis).toBeVisible();
  2. obs.program.locators.canvas have CSS “outline-width”, “7px”
    await expect(obs.program.locators.canvas).toHaveCSS("outline-width", "7px");
Act
  1. Close
    await obs.close();
Source
test("keeps one OBS URL across tournaments, showing the broadcast it was pointed at", async ({
	page,
	browser,
	baseURL,
	factories,
}) => {
	const lastWeek = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
	});
	const thisWeek = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
	});
	expect(thisWeek.programKey).toBe(lastWeek.programKey);

	await impersonate(page, NZAP_TEST_ID);
	const dashboard = new BroadcastDashboardPage(page, pageArgs(lastWeek.id));
	await dashboard.goto();
	await dashboard.saveTheme(
		"[data-broadcast] { outline: 7px solid rgb(1, 2, 3); }",
	);
	const obs = await openObsSource({
		browser,
		baseURL: baseURL!,
		tournamentId: thisWeek.id,
		programKey: thisWeek.programKey,
	});
	await expect(obs.program.scene("rosters")).toBeVisible();
	await expect(obs.program.locators.canvas).not.toHaveCSS(
		"outline-width",
		"7px",
	);

	await dashboard.pointProgram();

	await expect(dashboard.locators.programShowsThis).toBeVisible();
	await expect(obs.program.locators.canvas).toHaveCSS("outline-width", "7px");

	await obs.close();
})

runs the broadcast from a Stream Deck

Setup
Arrange
  1. Create broadcasting author N-ZAP → tournament
    const tournament = await createBroadcasting(factories, {
    	authorId: NZAP_TEST_ID,
    });
NN-ZAP
Act
  1. Add init script installFakeStreamDeck
    await page.addInitScript(installFakeStreamDeck);
Broadcast dashboard page
Act
  1. Open the broadcast dashboard page
    await dashboard.goto();
Assert
  1. view heading “next”, “game” is visible
    await expect(dashboard.viewHeading("next", "game")).toBeVisible();
  2. () => page.evaluate(() => window.fakeStreamDeck.drawnKeyCount()) is 15
    await expect
    	.poll(() => page.evaluate(() => window.fakeStreamDeck.drawnKeyCount()))
    	.toBe(STREAM_DECK_KEY_COUNT);
Act
  1. Evaluate (key) => window.fakeStreamDeck.press(key), STREAM_DECK_KEYS.casters
    await page.evaluate(
    	(key) => window.fakeStreamDeck.press(key),
    	STREAM_DECK_KEYS.casters,
    );
Assert
  1. view heading “next”, “casters” is visible
    await expect(dashboard.viewHeading("next", "casters")).toBeVisible();
Act
  1. Evaluate (key) => window.fakeStreamDeck.press(key), STREAM_DECK_KEYS.take
    await page.evaluate(
    	(key) => window.fakeStreamDeck.press(key),
    	STREAM_DECK_KEYS.take,
    );
Assert
  1. view heading “live”, “casters” is visible
    await expect(dashboard.viewHeading("live", "casters")).toBeVisible();
Act
  1. Evaluate (key) => window.fakeStreamDeck.press(key), STREAM_DECK_KEYS.queueItem
    await page.evaluate(
    	(key) => window.fakeStreamDeck.press(key),
    	STREAM_DECK_KEYS.queueItem,
    );
Assert
  1. queue item 1 is visible
    await expect(dashboard.queueItem(1)).toBeVisible();
Act
  1. Evaluate (key) => window.fakeStreamDeck.press(key), STREAM_DECK_KEYS.bracket
    await page.evaluate(
    	(key) => window.fakeStreamDeck.press(key),
    	STREAM_DECK_KEYS.bracket,
    );
Assert
  1. queue item 1 contains “Bracket”
    await expect(dashboard.queueItem(1)).toContainText("Bracket");
Source
test("runs the broadcast from a Stream Deck", async ({ page, factories }) => {
	const tournament = await createBroadcasting(factories, {
		authorId: NZAP_TEST_ID,
	});

	await impersonate(page, NZAP_TEST_ID);
	await page.addInitScript(installFakeStreamDeck);
	const dashboard = new BroadcastDashboardPage(page, pageArgs(tournament.id));
	await dashboard.goto();
	await expect(dashboard.viewHeading("next", "game")).toBeVisible();
	await expect
		.poll(() => page.evaluate(() => window.fakeStreamDeck.drawnKeyCount()))
		.toBe(STREAM_DECK_KEY_COUNT);

	await page.evaluate(
		(key) => window.fakeStreamDeck.press(key),
		STREAM_DECK_KEYS.casters,
	);
	await expect(dashboard.viewHeading("next", "casters")).toBeVisible();

	await page.evaluate(
		(key) => window.fakeStreamDeck.press(key),
		STREAM_DECK_KEYS.take,
	);
	await expect(dashboard.viewHeading("live", "casters")).toBeVisible();

	await page.evaluate(
		(key) => window.fakeStreamDeck.press(key),
		STREAM_DECK_KEYS.queueItem,
	);
	await expect(dashboard.queueItem(1)).toBeVisible();
	await page.evaluate(
		(key) => window.fakeStreamDeck.press(key),
		STREAM_DECK_KEYS.bracket,
	);
	await expect(dashboard.queueItem(1)).toContainText("Bracket");
})