Signing up Only a supporter can make a lobby, others sign up for it. Signing up reserves a spot, check-in opening once 8 have signed up and the start is at most 10 minutes away, with a notification to the signed up and the check-in button appearing on an open page as it does. A lobby made to start now opens check-in as the 8th signs up, who is checked in right away like everyone signing up after them. Checking in shows the room's pool and pass. Past the room size sign-ups go to the waitlist, the first on it taking a spot someone frees and being notified of it. When the lobby starts the waitlisted stay on the waitlist, unless someone with a spot didn't check in: then a waitlisted player checking in plays in their place.
a lobby made to start now waits for 8 sign-ups before check-in New lobby page Lobby page Lobby page Arrange
Create user → visitor
const visitor = await factories.UserFactory .create ();Set friend code user Sendou
await factories.UserFactory .setFriendCode (ADMIN_ID );New lobby page Act
Open the new lobby page
await newLobby.goto ();Fill name with “Test 8s”
await newLobby.form.fill ("name" , LOBBY_NAME );Fill description with “Bring your main, no Tacticooler”
await newLobby.form.fill ("description" , LOBBY_DESCRIPTION );Save
await newLobby.save ();Lobby page Assert
heading “Test 8s” is visible
await expect (lobby.heading (LOBBY_NAME )).toBeVisible ();description reads “Bring your main, no Tacticooler”
await expect (lobby.locators.description).toHaveText (LOBBY_DESCRIPTION );participants count is 1
await expect (lobby.locators.participants).toHaveCount (1 );Act
lobbyId = Number (page.url ().split ("/" ).at (-1 ))
const lobbyId = Number (page.url ().split ("/" ).at (-1 ));Lobby page Act
Open the lobby page lobbyId
await lobby.goto (lobbyId);Sign up
await lobby.signUp ();Assert
participants count is 2
await expect (lobby.locators.participants).toHaveCount (2 );viewer status contains “notified when check-in opens”
await expect (lobby.locators.viewerStatus).toContainText (
"notified when check-in opens" ,
);start banner contains “2/8 signed up”
await expect (lobby.locators.startBanner).toContainText ("2/8 signed up" );check in button is not visible
await isNotVisible (lobby.locators.checkInButton);Source test ("a lobby made to start now waits for 8 sign-ups before check-in" , async ({
page,
factories,
}) => {
const visitor = await factories.UserFactory .create ();
await factories.UserFactory .setFriendCode (ADMIN_ID );
await impersonate (page, ADMIN_ID );
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await newLobby.form.fill ("name" , LOBBY_NAME );
await newLobby.form.fill ("description" , LOBBY_DESCRIPTION );
await newLobby.save ();
const lobby = new LobbyPage (page);
await expect (lobby.heading (LOBBY_NAME )).toBeVisible ();
await expect (lobby.locators.description).toHaveText (LOBBY_DESCRIPTION );
await expect (lobby.locators.participants).toHaveCount (1 );
const lobbyId = Number (page.url ().split ("/" ).at (-1 ));
await impersonate (page, visitor.id);
await lobby.goto (lobbyId);
await lobby.signUp ();
await expect (lobby.locators.participants).toHaveCount (2 );
await expect (lobby.locators.viewerStatus).toContainText (
"notified when check-in opens" ,
);
await expect (lobby.locators.startBanner).toContainText ("2/8 signed up" );
await isNotVisible (lobby.locators.checkInButton);
})the 8th to sign up to a started lobby opens check-in for everyone The 8th signing up is checked in right away The others are notified and can check in Arrange
Create ROOM_SIZE - 1 × user → [host, ...others]
const [host, ...others] = await factories.UserFactory .createMany (
ROOM_SIZE - 1 ,
);Create user → eighth
const eighth = await factories.UserFactory .create ();Create lobby host user id host.id name “Test 8s” room size 8 starts at dateToDatabaseTimestamp (subMinutes (new Date (), 1 )) signed up user ids idsOf (others) → lobby
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
name: LOBBY_NAME ,
roomSize: ROOM_SIZE ,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{ signedUpUserIds: idsOf (others) },
);1 The 8th signing up is checked in right away
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Sign up
await lobbyPage.signUp ();Assert
viewer status contains “checked in”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"checked in" ,
);start banner contains “1/8 checked in”
await expect (lobbyPage.locators.startBanner).toContainText (
"1/8 checked in" ,
);2 The others are notified and can check in
Act
Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification (`Check in to ${LOBBY_NAME}` ) is visible
await expect (
notifications.notification (`Check in to ${LOBBY_NAME}` ),
).toBeVisible ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
check in button is visible
await expect (lobbyPage.locators.checkInButton).toBeVisible ();Source test ("the 8th to sign up to a started lobby opens check-in for everyone" , async ({
page,
factories,
}) => {
const [host, ...others] = await factories.UserFactory .createMany (
ROOM_SIZE - 1 ,
);
const eighth = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
name: LOBBY_NAME ,
roomSize: ROOM_SIZE ,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{ signedUpUserIds: idsOf (others) },
);
const lobbyPage = new LobbyPage (page);
await test.step ("The 8th signing up is checked in right away" , async () => {
await impersonate (page, eighth.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
await expect (lobbyPage.locators.viewerStatus).toContainText (
"checked in" ,
);
await expect (lobbyPage.locators.startBanner).toContainText (
"1/8 checked in" ,
);
});
await test.step ("The others are notified and can check in" , async () => {
await impersonate (page, host.id);
const notifications = await openNotifications (page);
await expect (
notifications.notification (`Check in to ${LOBBY_NAME}` ),
).toBeVisible ();
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.checkInButton).toBeVisible ();
});
})signing up for a later lobby reserves a spot without check-in yet Lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → visitor
const visitor = await factories.UserFactory .create ();Create lobby host user id host.id → lobby
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Sign up
await lobbyPage.signUp ();Assert
viewer status contains “notified when check-in opens”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"notified when check-in opens" ,
);start banner contains “2/8 signed up”
await expect (lobbyPage.locators.startBanner).toContainText (
"2/8 signed up" ,
);check in button is not visible
await isNotVisible (lobbyPage.locators.checkInButton);Source test ("signing up for a later lobby reserves a spot without check-in yet" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const visitor = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});
await impersonate (page, visitor.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
await expect (lobbyPage.locators.viewerStatus).toContainText (
"notified when check-in opens" ,
);
await expect (lobbyPage.locators.startBanner).toContainText (
"2/8 signed up" ,
);
await isNotVisible (lobbyPage.locators.checkInButton);
})the signed up are notified when check-in opens Arrange
Full lobby starts at dateToDatabaseTimestamp (addMinutes (new Date (), 5 )) → { signedUp }
const { signedUp } = await fullLobby (factories, {
startsAt: dateToDatabaseTimestamp (addMinutes (new Date (), 5 )),
});Act
Run routine “Lobbies”
await runRoutine (page, "Lobbies" );Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification (`Check in to ${LOBBY_NAME}` ) is visible
await expect (
notifications.notification (`Check in to ${LOBBY_NAME}` ),
).toBeVisible ();Source test ("the signed up are notified when check-in opens" , async ({
page,
factories,
}) => {
const { signedUp } = await fullLobby (factories, {
startsAt: dateToDatabaseTimestamp (addMinutes (new Date (), 5 )),
});
await impersonate (page, signedUp.id);
await runRoutine (page, "Lobbies" );
const notifications = await openNotifications (page);
await expect (
notifications.notification (`Check in to ${LOBBY_NAME}` ),
).toBeVisible ();
})a signed-up player checks in once check-in opens Lobby page Arrange
Full lobby starts at dateToDatabaseTimestamp (addMinutes (new Date (), 5 )) → { lobby, signedUp }
const { lobby, signedUp } = await fullLobby (factories, {
startsAt: dateToDatabaseTimestamp (addMinutes (new Date (), 5 )),
});Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Check in
await lobbyPage.checkIn ();Assert
viewer status contains “You're checked in, the lobby starts soon”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're checked in, the lobby starts soon" ,
);start banner contains “1/8 checked in”
await expect (lobbyPage.locators.startBanner).toContainText (
"1/8 checked in" ,
);Source test ("a signed-up player checks in once check-in opens" , async ({
page,
factories,
}) => {
const { lobby, signedUp } = await fullLobby (factories, {
startsAt: dateToDatabaseTimestamp (addMinutes (new Date (), 5 )),
});
await impersonate (page, signedUp.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.checkIn ();
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're checked in, the lobby starts soon" ,
);
await expect (lobbyPage.locators.startBanner).toContainText (
"1/8 checked in" ,
);
})check-in opening shows the check-in button on an open page, checking in the room's pool and pass Before check-in opens there is no check-in button The check-in button appears as check-in opens Checking in shows the room's pool and pass Arrange
Full lobby starts at dateToDatabaseTimestamp ( addSeconds (addMinutes (new Date (), CHECK_IN_LEAD_MINU … → { lobby, signedUp }
const { lobby, signedUp } = await fullLobby (factories, {
startsAt: dateToDatabaseTimestamp (
addSeconds (addMinutes (new Date (), CHECK_IN_LEAD_MINUTES ), 10 ),
),
});1 Before check-in opens there is no check-in button
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “notified when check-in opens”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"notified when check-in opens" ,
);start banner contains “Check-in opens at”
await expect (lobbyPage.locators.startBanner).toContainText (
"Check-in opens at" ,
);check in button is not visible
await isNotVisible (lobbyPage.locators.checkInButton);2 The check-in button appears as check-in opens
Lobby page Assert
check in button is visible
await expect (lobbyPage.locators.checkInButton).toBeVisible ({
timeout: 20_000 ,
});3 Checking in shows the room's pool and pass
Lobby page Act
Check in
await lobbyPage.checkIn ();Assert
room pool is visible
await expect (lobbyPage.locators.roomPool).toBeVisible ();room pass is visible
await expect (lobbyPage.locators.roomPass).toBeVisible ();Source test ("check-in opening shows the check-in button on an open page, checking in the room's pool and pass" , async ({
page,
factories,
}) => {
const { lobby, signedUp } = await fullLobby (factories, {
startsAt: dateToDatabaseTimestamp (
addSeconds (addMinutes (new Date (), CHECK_IN_LEAD_MINUTES ), 10 ),
),
});
const lobbyPage = new LobbyPage (page);
await test.step ("Before check-in opens there is no check-in button" , async () => {
await impersonate (page, signedUp.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"notified when check-in opens" ,
);
await expect (lobbyPage.locators.startBanner).toContainText (
"Check-in opens at" ,
);
await isNotVisible (lobbyPage.locators.checkInButton);
});
await test.step ("The check-in button appears as check-in opens" , async () => {
await expect (lobbyPage.locators.checkInButton).toBeVisible ({
timeout: 20_000 ,
});
});
await test.step ("Checking in shows the room's pool and pass" , async () => {
await lobbyPage.checkIn ();
await expect (lobbyPage.locators.roomPool).toBeVisible ();
await expect (lobbyPage.locators.roomPass).toBeVisible ();
});
})past the room size sign-ups go to the waitlist Lobby page Arrange
Full lobby → { lobby }
const { lobby } = await fullLobby (factories);Create user → visitor
const visitor = await factories.UserFactory .create ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Sign up
await lobbyPage.signUp ();Assert
viewer status contains “You're #1 on the waitlist”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #1 on the waitlist" ,
);Source test ("past the room size sign-ups go to the waitlist" , async ({
page,
factories,
}) => {
const { lobby } = await fullLobby (factories);
const visitor = await factories.UserFactory .create ();
await impersonate (page, visitor.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #1 on the waitlist" ,
);
})a spot freed before the start goes to the first on the waitlist A signed-up player leaves The waitlisted player is notified and has their spot Arrange
Create user → waitlisted
const waitlisted = await factories.UserFactory .create ();Full lobby waitlisted user ids waitlisted.id → { lobby, signedUp }
const { lobby, signedUp } = await fullLobby (factories, {
waitlistedUserIds: [waitlisted.id],
});1 A signed-up player leaves
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Leave
await lobbyPage.leave ();Assert
sign up button is visible
await expect (lobbyPage.locators.signUpButton).toBeVisible ();2 The waitlisted player is notified and has their spot
Act
Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification (`You got a spot in ${LOBBY_NAME}` ) is visible
await expect (
notifications.notification (`You got a spot in ${LOBBY_NAME}` ),
).toBeVisible ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “You're signed up”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're signed up" ,
);Source test ("a spot freed before the start goes to the first on the waitlist" , async ({
page,
factories,
}) => {
const waitlisted = await factories.UserFactory .create ();
const { lobby, signedUp } = await fullLobby (factories, {
waitlistedUserIds: [waitlisted.id],
});
const lobbyPage = new LobbyPage (page);
await test.step ("A signed-up player leaves" , async () => {
await impersonate (page, signedUp.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.leave ();
await expect (lobbyPage.locators.signUpButton).toBeVisible ();
});
await test.step ("The waitlisted player is notified and has their spot" , async () => {
await impersonate (page, waitlisted.id);
const notifications = await openNotifications (page);
await expect (
notifications.notification (`You got a spot in ${LOBBY_NAME}` ),
).toBeVisible ();
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're signed up" ,
);
});
})the waitlisted stay on the waitlist when everyone with a spot checks in The last player with a spot checks in, starting the lobby The waitlisted player is first on the waitlist Arrange
Starting lobby → { lobby, lastToCheckIn, waitlisted }
const { lobby, lastToCheckIn, waitlisted } =
await startingLobby (factories);1 The last player with a spot checks in, starting the lobby
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Check in
await lobbyPage.checkIn ();Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();2 The waitlisted player is first on the waitlist
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “You're #1 on the waitlist”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #1 on the waitlist" ,
);Source test ("the waitlisted stay on the waitlist when everyone with a spot checks in" , async ({
page,
factories,
}) => {
const { lobby, lastToCheckIn, waitlisted } =
await startingLobby (factories);
const lobbyPage = new LobbyPage (page);
await test.step ("The last player with a spot checks in, starting the lobby" , async () => {
await impersonate (page, lastToCheckIn.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.checkIn ();
await expect (lobbyPage.tab ("action" )).toBeVisible ();
});
await test.step ("The waitlisted player is first on the waitlist" , async () => {
await impersonate (page, waitlisted.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #1 on the waitlist" ,
);
});
})a waitlisted player plays in place of one who didn't check in The waitlisted player checks in after the start The one who didn't check in is no longer in the lobby Arrange
Starting lobby → {
lobby,
lastToCheckIn: didNotCheckIn,
waitlisted,
}
const {
lobby,
lastToCheckIn: didNotCheckIn,
waitlisted,
} = await startingLobby (factories);1 The waitlisted player checks in after the start
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Check in
await lobbyPage.checkIn ();Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();2 The one who didn't check in is no longer in the lobby
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
sign up button is visible
await expect (lobbyPage.locators.signUpButton).toBeVisible ();Source test ("a waitlisted player plays in place of one who didn't check in" , async ({
page,
factories,
}) => {
const {
lobby,
lastToCheckIn: didNotCheckIn,
waitlisted,
} = await startingLobby (factories);
const lobbyPage = new LobbyPage (page);
await test.step ("The waitlisted player checks in after the start" , async () => {
await impersonate (page, waitlisted.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.checkIn ();
await expect (lobbyPage.tab ("action" )).toBeVisible ();
});
await test.step ("The one who didn't check in is no longer in the lobby" , async () => {
await impersonate (page, didNotCheckIn.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.signUpButton).toBeVisible ();
});
})Who can join Signing up and making a lobby take a friend code, making one is for now only for an admin, and a user in SendouQ or present in another lobby can't check in to a lobby until they leave it.
without a friend code a user can't sign up or make a lobby Lobby page New lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user friend code null → withoutFriendCode
const withoutFriendCode = await factories.UserFactory .create ({
friendCode: null ,
});Create lobby host user id host.id → lobby
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
friend code needed text is visible
await expect (lobbyPage.locators.friendCodeNeededText).toBeVisible ();sign up button is not visible
await isNotVisible (lobbyPage.locators.signUpButton);New lobby page Act
Open the new lobby page
await newLobby.goto ();Assert
friend code needed text is visible
await expect (newLobby.locators.friendCodeNeededText).toBeVisible ();Source test ("without a friend code a user can't sign up or make a lobby" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const withoutFriendCode = await factories.UserFactory .create ({
friendCode: null ,
});
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});
await impersonate (page, withoutFriendCode.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.friendCodeNeededText).toBeVisible ();
await isNotVisible (lobbyPage.locators.signUpButton);
await impersonate (page, ADMIN_ID );
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await expect (newLobby.locators.friendCodeNeededText).toBeVisible ();
})only a supporter can make a lobby New lobby page Arrange
Create user → user
const user = await factories.UserFactory .create ();New lobby page Act
Open the new lobby page
await newLobby.goto ();Assert
no permissions text is visible
await expect (newLobby.locators.noPermissionsText).toBeVisible ();Source test ("only a supporter can make a lobby" , async ({ page, factories }) => {
const user = await factories.UserFactory .create ();
await impersonate (page, user.id);
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await expect (newLobby.locators.noPermissionsText).toBeVisible ();
})a user in SendouQ can't check in Lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → inSendouQ
const inSendouQ = await factories.UserFactory .create ();Create SQ group member user ids inSendouQ.id
await factories.SQGroupFactory .create ({ memberUserIds: [inSendouQ.id] });Create lobby host user id host.id starts at dateToDatabaseTimestamp (addMinutes (new Date (), 5 )) check in opened at dateToDatabaseTimestamp (new Date ()) signed up user ids inSendouQ.id → lobby
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
startsAt: dateToDatabaseTimestamp (addMinutes (new Date (), 5 )),
checkInOpenedAt: dateToDatabaseTimestamp (new Date ()),
},
{ signedUpUserIds: [inSendouQ.id] },
);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Check in
await lobbyPage.checkIn ();Assert
toasts render hidden in e2e runs
text “Leave SendouQ before checking in to a lobby” is in the page
await expect (
page.getByText ("Leave SendouQ before checking in to a lobby" ),
).toBeAttached ();check in button is visible
await expect (lobbyPage.locators.checkInButton).toBeVisible ();Source test ("a user in SendouQ can't check in" , async ({ page, factories }) => {
const host = await factories.UserFactory .create ();
const inSendouQ = await factories.UserFactory .create ();
await factories.SQGroupFactory .create ({ memberUserIds: [inSendouQ.id] });
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
startsAt: dateToDatabaseTimestamp (addMinutes (new Date (), 5 )),
checkInOpenedAt: dateToDatabaseTimestamp (new Date ()),
},
{ signedUpUserIds: [inSendouQ.id] },
);
await impersonate (page, inSendouQ.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.checkIn ();
// toasts render hidden in e2e runs
await expect (
page.getByText ("Leave SendouQ before checking in to a lobby" ),
).toBeAttached ();
await expect (lobbyPage.locators.checkInButton).toBeVisible ();
})a player checked in to another lobby can't check in Lobby page Arrange
Create 3 × user → [host, otherHost, player]
const [host, otherHost, player] =
await factories.UserFactory .createMany (3 );startsSoon = dateToDatabaseTimestamp (addMinutes (new Date (), 5 ))
const startsSoon = dateToDatabaseTimestamp (addMinutes (new Date (), 5 ));Create lobby host user id otherHost.id starts at startsSoon signed up user ids player.id checked in user ids player.id
await factories.LobbyFactory .create (
{ hostUserId: otherHost.id, startsAt: startsSoon },
{ signedUpUserIds: [player.id], checkedInUserIds: [player.id] },
);Create lobby host user id host.id starts at startsSoon check in opened at dateToDatabaseTimestamp (new Date ()) signed up user ids player.id → lobby
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
startsAt: startsSoon,
checkInOpenedAt: dateToDatabaseTimestamp (new Date ()),
},
{ signedUpUserIds: [player.id] },
);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Check in
await lobbyPage.checkIn ();Assert
toasts render hidden in e2e runs
text “Leave the other lobby before checking in to this one” is in the page
await expect (
page.getByText ("Leave the other lobby before checking in to this one" ),
).toBeAttached ();check in button is visible
await expect (lobbyPage.locators.checkInButton).toBeVisible ();Source test ("a player checked in to another lobby can't check in" , async ({
page,
factories,
}) => {
const [host, otherHost, player] =
await factories.UserFactory .createMany (3 );
const startsSoon = dateToDatabaseTimestamp (addMinutes (new Date (), 5 ));
await factories.LobbyFactory .create (
{ hostUserId: otherHost.id, startsAt: startsSoon },
{ signedUpUserIds: [player.id], checkedInUserIds: [player.id] },
);
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
startsAt: startsSoon,
checkInOpenedAt: dateToDatabaseTimestamp (new Date ()),
},
{ signedUpUserIds: [player.id] },
);
await impersonate (page, player.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.checkIn ();
// toasts render hidden in e2e runs
await expect (
page.getByText ("Leave the other lobby before checking in to this one" ),
).toBeAttached ();
await expect (lobbyPage.locators.checkInButton).toBeVisible ();
})a player in another lobby's room can't join a started lobby Lobby page Arrange
Started lobby → { alphaPlayer }
const { alphaPlayer } = await startedLobby (page, factories);Create user → otherHost
const otherHost = await factories.UserFactory .create ();Create lobby host user id otherHost.id starts at dateToDatabaseTimestamp (subMinutes (new Date (), 1 )) checked in user ids otherHost.id → otherLobby
const otherLobby = await factories.LobbyFactory .create (
{
hostUserId: otherHost.id,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{ checkedInUserIds: [otherHost.id] },
);Lobby page Act
Open the lobby page otherLobby.id
await lobbyPage.goto (otherLobby.id);Sign up
await lobbyPage.signUp ();Assert
text “Leave the other lobby before checking in to this one” is in the page
await expect (
page.getByText ("Leave the other lobby before checking in to this one" ),
).toBeAttached ();participants count is 1
await expect (lobbyPage.locators.participants).toHaveCount (1 );Source test ("a player in another lobby's room can't join a started lobby" , async ({
page,
factories,
}) => {
const { alphaPlayer } = await startedLobby (page, factories);
const otherHost = await factories.UserFactory .create ();
const otherLobby = await factories.LobbyFactory .create (
{
hostUserId: otherHost.id,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{ checkedInUserIds: [otherHost.id] },
);
await impersonate (page, alphaPlayer.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (otherLobby.id);
await lobbyPage.signUp ();
await expect (
page.getByText ("Leave the other lobby before checking in to this one" ),
).toBeAttached ();
await expect (lobbyPage.locators.participants).toHaveCount (1 );
})Visibility A lobby limited to an association is listed only to its members, its card marked as such, and its page is not found for others. Its host can still invite anyone with the lobby's invite link, which only they get, and change who sees it later on. A link-only lobby is listed to no one but its participants: others find it only through the link its host shares, and once signed up they find it without the link too. Everyone who can open it gets the link to share, and their address bar always shows it. Without the link others are told the lobby is invite only.
a lobby limited to an association is hidden from outsiders A member of the association sees it marked as limited An outsider neither sees it listed nor finds its page Arrange
Create 3 × user → [host, member, outsider]
const [host, member, outsider] =
await factories.UserFactory .createMany (3 );Create association user id host.id name “Inkling Alliance” member user ids member.id → association
const association = await factories.AssociationFactory .create (
{ userId: host.id, name: ASSOCIATION_NAME },
{ memberUserIds: [member.id] },
);Create lobby host user id host.id name “Test 8s” visibility for association association.id → lobby
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
name: LOBBY_NAME ,
visibility: { forAssociation: association.id },
});1 A member of the association sees it marked as limited
Lobbies page Act
Open the lobbies page
await lobbies.goto ();Open tab “upcoming”
await lobbies.openTab ("upcoming" );Assert
limited visibility icon “Test 8s” is visible
await expect (lobbies.limitedVisibilityIcon (LOBBY_NAME )).toBeVisible ();2 An outsider neither sees it listed nor finds its page
Lobbies page Act
Open the lobbies page
await lobbies.goto ();Open tab “upcoming”
await lobbies.openTab ("upcoming" );Assert
card “Test 8s” count is 0
await expect (lobbies.card (LOBBY_NAME )).toHaveCount (0 );Lobby page Act
Open the lobby page lobby.id
await new LobbyPage (page).goto (lobby.id);Error page Assert
not found heading is visible
await expect (errorPage.locators.notFoundHeading).toBeVisible ();Source test ("a lobby limited to an association is hidden from outsiders" , async ({
page,
factories,
}) => {
const [host, member, outsider] =
await factories.UserFactory .createMany (3 );
const association = await factories.AssociationFactory .create (
{ userId: host.id, name: ASSOCIATION_NAME },
{ memberUserIds: [member.id] },
);
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
name: LOBBY_NAME ,
visibility: { forAssociation: association.id },
});
const lobbies = new LobbiesPage (page);
await test.step ("A member of the association sees it marked as limited" , async () => {
await impersonate (page, member.id);
await lobbies.goto ();
await lobbies.openTab ("upcoming" );
await expect (lobbies.limitedVisibilityIcon (LOBBY_NAME )).toBeVisible ();
});
await test.step ("An outsider neither sees it listed nor finds its page" , async () => {
await impersonate (page, outsider.id);
await lobbies.goto ();
await lobbies.openTab ("upcoming" );
await expect (lobbies.card (LOBBY_NAME )).toHaveCount (0 );
const errorPage = new ErrorPage (page);
await new LobbyPage (page).goto (lobby.id);
await expect (errorPage.locators.notFoundHeading).toBeVisible ();
});
})the host invites an outsider to a lobby limited to an association and opens it to everyone A member sees the lobby but gets no link to share Through the link an outsider opens it, the reset one doesn't work Opened to everyone, an outsider sees it listed Arrange
Create 4 × user → [host, member, invitee, outsider]
const [host, member, invitee, outsider] =
await factories.UserFactory .createMany (4 );Create association user id host.id name “Inkling Alliance” member user ids member.id → association
const association = await factories.AssociationFactory .create (
{ userId: host.id, name: ASSOCIATION_NAME },
{ memberUserIds: [member.id] },
);Create lobby host user id host.id name “Test 8s” visibility for association association.id → lobby
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
name: LOBBY_NAME ,
visibility: { forAssociation: association.id },
});Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Copy share link as host → oldShareLink
const oldShareLink = await lobbyPage.copyShareLinkAsHost ();Reset share link
await lobbyPage.resetShareLink ();Assert
toasts render hidden in e2e runs
share link reset toast is in the page
await expect (lobbyPage.locators.shareLinkResetToast).toBeAttached ();Act
Copy share link as host → shareLink
const shareLink = await lobbyPage.copyShareLinkAsHost ();Assert
shareLink is not oldShareLink
expect (shareLink).not.toBe (oldShareLink);1 A member sees the lobby but gets no link to share
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
heading “Test 8s” is visible
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();copy share link button is not visible
await isNotVisible (lobbyPage.locators.copyShareLinkButton);2 Through the link an outsider opens it, the reset one doesn't work
Lobby page Act
Go to via share link shareLink
await lobbyPage.gotoViaShareLink (shareLink);Assert
heading “Test 8s” is visible
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();Act
Go to via share link oldShareLink
await lobbyPage.gotoViaShareLink (oldShareLink);Error page Assert
not found heading is visible
await expect (errorPage.locators.notFoundHeading).toBeVisible ();3 Opened to everyone, an outsider sees it listed
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Change visibility “Public”
await lobbyPage.changeVisibility ("Public" );Lobbies page Act
Open the lobbies page
await lobbies.goto ();Open tab “upcoming”
await lobbies.openTab ("upcoming" );Assert
card “Test 8s” is visible
await expect (lobbies.card (LOBBY_NAME )).toBeVisible ();limited visibility icon “Test 8s” is not visible
await isNotVisible (lobbies.limitedVisibilityIcon (LOBBY_NAME ));Source test ("the host invites an outsider to a lobby limited to an association and opens it to everyone" , async ({
page,
factories,
}) => {
const [host, member, invitee, outsider] =
await factories.UserFactory .createMany (4 );
const association = await factories.AssociationFactory .create (
{ userId: host.id, name: ASSOCIATION_NAME },
{ memberUserIds: [member.id] },
);
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
name: LOBBY_NAME ,
visibility: { forAssociation: association.id },
});
const lobbyPage = new LobbyPage (page);
const lobbies = new LobbiesPage (page);
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
const oldShareLink = await lobbyPage.copyShareLinkAsHost ();
await lobbyPage.resetShareLink ();
// toasts render hidden in e2e runs
await expect (lobbyPage.locators.shareLinkResetToast).toBeAttached ();
const shareLink = await lobbyPage.copyShareLinkAsHost ();
expect (shareLink).not.toBe (oldShareLink);
await test.step ("A member sees the lobby but gets no link to share" , async () => {
await impersonate (page, member.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();
await isNotVisible (lobbyPage.locators.copyShareLinkButton);
});
await test.step ("Through the link an outsider opens it, the reset one doesn't work" , async () => {
await impersonate (page, invitee.id);
await lobbyPage.gotoViaShareLink (shareLink);
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();
const errorPage = new ErrorPage (page);
await lobbyPage.gotoViaShareLink (oldShareLink);
await expect (errorPage.locators.notFoundHeading).toBeVisible ();
});
await test.step ("Opened to everyone, an outsider sees it listed" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.changeVisibility ("Public" );
await impersonate (page, outsider.id);
await lobbies.goto ();
await lobbies.openTab ("upcoming" );
await expect (lobbies.card (LOBBY_NAME )).toBeVisible ();
await isNotVisible (lobbies.limitedVisibilityIcon (LOBBY_NAME ));
});
})a link-only lobby is found only through its shared link The host's address bar shows the link Without the link an outsider neither sees it listed nor its page Through the link a visitor opens it and signs up Signed up, the visitor finds it without the link Not being the host, the visitor can share the link too Arrange
Create 2 × user → [visitor, outsider]
const [visitor, outsider] = await factories.UserFactory .createMany (2 );Set friend code user Sendou
await factories.UserFactory .setFriendCode (ADMIN_ID );New lobby page Act
Open the new lobby page
await newLobby.goto ();Fill name with “Test 8s”
await newLobby.form.fill ("name" , LOBBY_NAME );Select visibility “Only with the link”
await newLobby.selectVisibility ("Only with the link" );Save
await newLobby.save ();Lobby page Assert
heading “Test 8s” is visible
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();Act
lobbyId = Number (new URL (page.url ()).pathname.split ("/" ).at (-1 ))
const lobbyId = Number (new URL (page.url ()).pathname.split ("/" ).at (-1 ));Copy share link as host → shareLink
const shareLink = await lobbyPage.copyShareLinkAsHost ();1 The host's address bar shows the link
Assert
new URL (page.url ()).search is new URL (shareLink).search
expect (new URL (page.url ()).search).toBe (new URL (shareLink).search);Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);Assert
heading “Test 8s” is visible
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();new URL (page.url ()).search is new URL (shareLink).search
expect (new URL (page.url ()).search).toBe (new URL (shareLink).search);2 Without the link an outsider neither sees it listed nor its page
Lobbies page Act
Open the lobbies page
await lobbies.goto ();Open tab “running”
await lobbies.openTab ("running" );Assert
card “Test 8s” count is 0
await expect (lobbies.card (LOBBY_NAME )).toHaveCount (0 );Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);Assert
invite only heading is visible
await expect (lobbyPage.locators.inviteOnlyHeading).toBeVisible ();heading “Test 8s” is not visible
await isNotVisible (lobbyPage.heading (LOBBY_NAME ));3 Through the link a visitor opens it and signs up
Lobby page Act
Go to via share link shareLink
await lobbyPage.gotoViaShareLink (shareLink);Sign up
await lobbyPage.signUp ();Assert
participants count is 2
await expect (lobbyPage.locators.participants).toHaveCount (2 );4 Signed up, the visitor finds it without the link
Lobbies page Act
Open the lobbies page
await lobbies.goto ();Open tab “running”
await lobbies.openTab ("running" );Assert
card “Test 8s” is visible
await expect (lobbies.card (LOBBY_NAME )).toBeVisible ();Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);Assert
heading “Test 8s” is visible
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();new URL (page.url ()).search is new URL (shareLink).search
expect (new URL (page.url ()).search).toBe (new URL (shareLink).search);5 Not being the host, the visitor can share the link too
Lobby page Assert
copy share link is shareLink
expect (await lobbyPage.copyShareLink ()).toBe (shareLink);Source test ("a link-only lobby is found only through its shared link" , async ({
page,
factories,
}) => {
const [visitor, outsider] = await factories.UserFactory .createMany (2 );
await factories.UserFactory .setFriendCode (ADMIN_ID );
const lobbyPage = new LobbyPage (page);
const lobbies = new LobbiesPage (page);
await impersonate (page, ADMIN_ID );
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await newLobby.form.fill ("name" , LOBBY_NAME );
await newLobby.selectVisibility ("Only with the link" );
await newLobby.save ();
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();
const lobbyId = Number (new URL (page.url ()).pathname.split ("/" ).at (-1 ));
const shareLink = await lobbyPage.copyShareLinkAsHost ();
await test.step ("The host's address bar shows the link" , async () => {
expect (new URL (page.url ()).search).toBe (new URL (shareLink).search);
await lobbyPage.goto (lobbyId);
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();
expect (new URL (page.url ()).search).toBe (new URL (shareLink).search);
});
await test.step ("Without the link an outsider neither sees it listed nor its page" , async () => {
await impersonate (page, outsider.id);
await lobbies.goto ();
await lobbies.openTab ("running" );
await expect (lobbies.card (LOBBY_NAME )).toHaveCount (0 );
await lobbyPage.goto (lobbyId);
await expect (lobbyPage.locators.inviteOnlyHeading).toBeVisible ();
await isNotVisible (lobbyPage.heading (LOBBY_NAME ));
});
await test.step ("Through the link a visitor opens it and signs up" , async () => {
await impersonate (page, visitor.id);
await lobbyPage.gotoViaShareLink (shareLink);
await lobbyPage.signUp ();
await expect (lobbyPage.locators.participants).toHaveCount (2 );
});
await test.step ("Signed up, the visitor finds it without the link" , async () => {
await lobbies.goto ();
await lobbies.openTab ("running" );
await expect (lobbies.card (LOBBY_NAME )).toBeVisible ();
await lobbyPage.goto (lobbyId);
await expect (lobbyPage.heading (LOBBY_NAME )).toBeVisible ();
expect (new URL (page.url ()).search).toBe (new URL (shareLink).search);
});
await test.step ("Not being the host, the visitor can share the link too" , async () => {
expect (await lobbyPage.copyShareLink ()).toBe (shareLink);
});
})Lobby list The lobby list splits lobbies into running and upcoming ones, opening on the tab of a lobby the viewer is in. A lobby can be joined and, before the viewer is in its room, left from its card.
running and upcoming lobbies are on their own tabs, opening on the viewer's Lobbies page Arrange
Create 3 × user → [runningHost, upcomingHost, viewer]
const [runningHost, upcomingHost, viewer] =
await factories.UserFactory .createMany (3 );Create lobby host user id runningHost.id name “Running 8s” starts at dateToDatabaseTimestamp (subMinutes (new Date (), 30 ))
await factories.LobbyFactory .create ({
hostUserId: runningHost.id,
name: "Running 8s" ,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 30 )),
});Create lobby host user id upcomingHost.id name “Upcoming 8s” signed up user ids viewer.id
await factories.LobbyFactory .create (
{ hostUserId: upcomingHost.id, name: "Upcoming 8s" },
{ signedUpUserIds: [viewer.id] },
);Lobbies page Act
Open the lobbies page
await lobbies.goto ();Assert
selected tab contains “Upcoming”
await expect (lobbies.locators.selectedTab).toContainText ("Upcoming" );card “Upcoming 8s” is visible
await expect (lobbies.card ("Upcoming 8s" )).toBeVisible ();card “Running 8s” count is 0
await expect (lobbies.card ("Running 8s" )).toHaveCount (0 );Act
Open tab “running”
await lobbies.openTab ("running" );Assert
card “Running 8s” is visible
await expect (lobbies.card ("Running 8s" )).toBeVisible ();Source test ("running and upcoming lobbies are on their own tabs, opening on the viewer's" , async ({
page,
factories,
}) => {
const [runningHost, upcomingHost, viewer] =
await factories.UserFactory .createMany (3 );
await factories.LobbyFactory .create ({
hostUserId: runningHost.id,
name: "Running 8s" ,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 30 )),
});
await factories.LobbyFactory .create (
{ hostUserId: upcomingHost.id, name: "Upcoming 8s" },
{ signedUpUserIds: [viewer.id] },
);
await impersonate (page, viewer.id);
const lobbies = new LobbiesPage (page);
await lobbies.goto ();
await expect (lobbies.locators.selectedTab).toContainText ("Upcoming" );
await expect (lobbies.card ("Upcoming 8s" )).toBeVisible ();
await expect (lobbies.card ("Running 8s" )).toHaveCount (0 );
await lobbies.openTab ("running" );
await expect (lobbies.card ("Running 8s" )).toBeVisible ();
})joins a lobby from its card Lobbies page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → visitor
const visitor = await factories.UserFactory .create ();Create lobby host user id host.id name “Test 8s”
await factories.LobbyFactory .create ({
hostUserId: host.id,
name: LOBBY_NAME ,
});Lobbies page Act
Open the lobbies page
await lobbies.goto ();Join “Test 8s”
await lobbies.join (LOBBY_NAME );Assert
card “Test 8s” contains “Signed up”
await expect (lobbies.card (LOBBY_NAME )).toContainText ("Signed up" );Source test ("joins a lobby from its card" , async ({ page, factories }) => {
const host = await factories.UserFactory .create ();
const visitor = await factories.UserFactory .create ();
await factories.LobbyFactory .create ({
hostUserId: host.id,
name: LOBBY_NAME ,
});
await impersonate (page, visitor.id);
const lobbies = new LobbiesPage (page);
await lobbies.goto ();
await lobbies.join (LOBBY_NAME );
await expect (lobbies.card (LOBBY_NAME )).toContainText ("Signed up" );
})leaves a lobby from its card Lobbies page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → signedUp
const signedUp = await factories.UserFactory .create ();Create lobby host user id host.id name “Test 8s” signed up user ids signedUp.id
await factories.LobbyFactory .create (
{ hostUserId: host.id, name: LOBBY_NAME },
{ signedUpUserIds: [signedUp.id] },
);Lobbies page Act
Open the lobbies page
await lobbies.goto ();Leave “Test 8s”
await lobbies.leave (LOBBY_NAME );Assert
card “Test 8s” does not contain “Signed up”
await expect (lobbies.card (LOBBY_NAME )).not.toContainText ("Signed up" );card “Test 8s” › element “lobby-join-button” is visible
await expect (
lobbies.card (LOBBY_NAME ).getByTestId ("lobby-join-button" ),
).toBeVisible ();Source test ("leaves a lobby from its card" , async ({ page, factories }) => {
const host = await factories.UserFactory .create ();
const signedUp = await factories.UserFactory .create ();
await factories.LobbyFactory .create (
{ hostUserId: host.id, name: LOBBY_NAME },
{ signedUpUserIds: [signedUp.id] },
);
await impersonate (page, signedUp.id);
const lobbies = new LobbiesPage (page);
await lobbies.goto ();
await lobbies.leave (LOBBY_NAME );
await expect (lobbies.card (LOBBY_NAME )).not.toContainText ("Signed up" );
await expect (
lobbies.card (LOBBY_NAME ).getByTestId ("lobby-join-button" ),
).toBeVisible ();
})Playing sets The lobby starts once 8 have checked in after its start time, splitting the room into two teams for a set and notifying its players. The banner shows who voted for the map being played with their match profile map pool. One side reports the maps, can undo a report while the set is being played, and the other confirms the result, after which the set shows on the Result tab and counts on the Rankings tab together with the weapons reported, the Rankings then also offering a head-to-head view of the players who have played. The confirming side can instead dispute the result, the reporting side then undoing their report or the host settling it by confirming the result or undoing the report, whichever side they're on.
starting the lobby notifies its players Arrange
Started lobby → { host }
const { host } = await startedLobby (page, factories);Act
Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification ( `${LOBBY_NAME} started and you're in a room` , ) is visible
await expect (
notifications.notification (
`${LOBBY_NAME} started and you're in a room` ,
),
).toBeVisible ();Source test ("starting the lobby notifies its players" , async ({
page,
factories,
}) => {
const { host } = await startedLobby (page, factories);
await impersonate (page, host.id);
const notifications = await openNotifications (page);
await expect (
notifications.notification (
`${LOBBY_NAME} started and you're in a room` ,
),
).toBeVisible ();
})the banner shows who voted for the map being played Lobby page Arrange
Started lobby is pooling every map true
await startedLobby (page, factories, { isPoolingEveryMap: true });Lobby page Assert
map voters badge reads String (ROOM_SIZE )
await expect (lobbyPage.locators.mapVotersBadge).toHaveText (
String (ROOM_SIZE ),
);Act
Click map voters badge
await lobbyPage.locators.mapVotersBadge.click ();Assert
map voters header is visible
await expect (lobbyPage.locators.mapVotersHeader).toBeVisible ();Source test ("the banner shows who voted for the map being played" , async ({
page,
factories,
}) => {
await startedLobby (page, factories, { isPoolingEveryMap: true });
const lobbyPage = new LobbyPage (page);
await expect (lobbyPage.locators.mapVotersBadge).toHaveText (
String (ROOM_SIZE ),
);
await lobbyPage.locators.mapVotersBadge.click ();
await expect (lobbyPage.locators.mapVotersHeader).toBeVisible ();
})a set reported by one side and confirmed by the other counts The Rankings have no head-to-head view before a set is played An Alpha player reports a sweep A Bravo player confirms it The set shows on the Rankings and Result tabs Arrange
Started lobby → { lobby, alphaPlayer, bravoPlayer }
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);1 The Rankings have no head-to-head view before a set is played
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Assert
leaderboard rows count is 8
await expect (lobbyPage.locators.leaderboardRows).toHaveCount (ROOM_SIZE );head to head view chip count is 0
await expect (lobbyPage.locators.headToHeadViewChip).toHaveCount (0 );2 An Alpha player reports a sweep
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team sweep 2
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );3 A Bravo player confirms it
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Confirm set
await lobbyPage.confirmSet ();4 The set shows on the Rankings and Result tabs
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Assert
leaderboard rows count is 8
await expect (lobbyPage.locators.leaderboardRows).toHaveCount (ROOM_SIZE );Act
Click head to head view chip
await lobbyPage.locators.headToHeadViewChip.click ();Assert
head to head rows count is 8
await expect (lobbyPage.locators.headToHeadRows).toHaveCount (ROOM_SIZE );Act
Open tab “result”
await lobbyPage.openTab ("result" );Assert
tab panel contains “2-0”
await expect (lobbyPage.locators.tabPanel).toContainText ("2-0" );Source test ("a set reported by one side and confirmed by the other counts" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);
const lobbyPage = new LobbyPage (page);
await test.step ("The Rankings have no head-to-head view before a set is played" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await expect (lobbyPage.locators.leaderboardRows).toHaveCount (ROOM_SIZE );
await expect (lobbyPage.locators.headToHeadViewChip).toHaveCount (0 );
});
await test.step ("An Alpha player reports a sweep" , async () => {
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
});
await test.step ("A Bravo player confirms it" , async () => {
await impersonate (page, bravoPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.confirmSet ();
});
await test.step ("The set shows on the Rankings and Result tabs" , async () => {
await lobbyPage.goto (lobby.id, "leaderboard" );
await expect (lobbyPage.locators.leaderboardRows).toHaveCount (ROOM_SIZE );
await lobbyPage.locators.headToHeadViewChip.click ();
await expect (lobbyPage.locators.headToHeadRows).toHaveCount (ROOM_SIZE );
await lobbyPage.openTab ("result" );
await expect (lobbyPage.locators.tabPanel).toContainText ("2-0" );
});
})a map report is undone while the set is being played Lobby page Arrange
Started lobby → { lobby, alphaPlayer }
const { lobby, alphaPlayer } = await startedLobby (page, factories);Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team win
await lobbyPage.reportOwnTeamWin ();Assert
tab “result” is visible
await expect (lobbyPage.tab ("result" )).toBeVisible ();Act
Undo report
await lobbyPage.undoReport ();Assert
tab “result” count is 0
await expect (lobbyPage.tab ("result" )).toHaveCount (0 );Source test ("a map report is undone while the set is being played" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer } = await startedLobby (page, factories);
await impersonate (page, alphaPlayer.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamWin ();
await expect (lobbyPage.tab ("result" )).toBeVisible ();
await lobbyPage.undoReport ();
await expect (lobbyPage.tab ("result" )).toHaveCount (0 );
})a reported weapon shows on the Result and Rankings tabs An Alpha player reports their weapon and a sweep A Bravo player confirms the set The weapon shows on the Result and Rankings tabs Arrange
Started lobby → { lobby, alphaPlayer, bravoPlayer }
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);1 An Alpha player reports their weapon and a sweep
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report weapon “Splattershot”
await lobbyPage.reportWeapon (WEAPON_NAME );Report own team sweep 2
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );2 A Bravo player confirms the set
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Confirm set
await lobbyPage.confirmSet ();3 The weapon shows on the Result and Rankings tabs
Lobby page Act
Open tab “result”
await lobbyPage.openTab ("result" );Assert
weapon image “Splattershot” is visible
await expect (lobbyPage.weaponImage (WEAPON_NAME )).toBeVisible ();Act
Open tab “leaderboard”
await lobbyPage.openTab ("leaderboard" );Assert
rankings row alphaPlayer.name › img “Splattershot” is visible
await expect (
lobbyPage
.rankingsRow (alphaPlayer.name)
.getByRole ("img" , { name: WEAPON_NAME }),
).toBeVisible ();Source test ("a reported weapon shows on the Result and Rankings tabs" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);
const lobbyPage = new LobbyPage (page);
await test.step ("An Alpha player reports their weapon and a sweep" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportWeapon (WEAPON_NAME );
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
});
await test.step ("A Bravo player confirms the set" , async () => {
await impersonate (page, bravoPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.confirmSet ();
});
await test.step ("The weapon shows on the Result and Rankings tabs" , async () => {
await lobbyPage.openTab ("result" );
await expect (lobbyPage.weaponImage (WEAPON_NAME )).toBeVisible ();
await lobbyPage.openTab ("leaderboard" );
await expect (
lobbyPage
.rankingsRow (alphaPlayer.name)
.getByRole ("img" , { name: WEAPON_NAME }),
).toBeVisible ();
});
})a disputed result goes back to reporting when the reporting side undoes it An Alpha player reports a sweep A Bravo player disputes it The Alpha player undoes the deciding report Arrange
Started lobby → { lobby, alphaPlayer, bravoPlayer }
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);1 An Alpha player reports a sweep
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team sweep 2
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );2 A Bravo player disputes it
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Dispute result
await lobbyPage.disputeResult ();Assert
disputed text is visible
await expect (lobbyPage.locators.disputedText).toBeVisible ();3 The Alpha player undoes the deciding report
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Undo report
await lobbyPage.undoReport ();Assert
report score button is visible
await expect (lobbyPage.locators.reportScoreButton).toBeVisible ();Source test ("a disputed result goes back to reporting when the reporting side undoes it" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);
const lobbyPage = new LobbyPage (page);
await test.step ("An Alpha player reports a sweep" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
});
await test.step ("A Bravo player disputes it" , async () => {
await impersonate (page, bravoPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.disputeResult ();
await expect (lobbyPage.locators.disputedText).toBeVisible ();
});
await test.step ("The Alpha player undoes the deciding report" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.undoReport ();
await expect (lobbyPage.locators.reportScoreButton).toBeVisible ();
});
})the host undoes a disputed result the other team reported The other team reports a sweep The host disputes it and undoes the deciding report Arrange
Started lobby → { lobby, host, alphaPlayers, bravoPlayers }
const { lobby, host, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);isHostAlpha = alphaPlayers.some ((player) => player.id === host.id)
const isHostAlpha = alphaPlayers.some ((player) => player.id === host.id);opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ]
const opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ];1 The other team reports a sweep
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team sweep 2
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );2 The host disputes it and undoes the deciding report
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Dispute result
await lobbyPage.disputeResult ();Undo report
await lobbyPage.undoReport ();Assert
report score button is visible
await expect (lobbyPage.locators.reportScoreButton).toBeVisible ();Source test ("the host undoes a disputed result the other team reported" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);
const isHostAlpha = alphaPlayers.some ((player) => player.id === host.id);
const opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ];
const lobbyPage = new LobbyPage (page);
await test.step ("The other team reports a sweep" , async () => {
await impersonate (page, opponent.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
});
await test.step ("The host disputes it and undoes the deciding report" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.disputeResult ();
await lobbyPage.undoReport ();
await expect (lobbyPage.locators.reportScoreButton).toBeVisible ();
});
})the host settles a disputed result by confirming it The host reports a sweep for their team The other team disputes it The host confirms the result, the set counting Arrange
Started lobby → { lobby, host, alphaPlayers, bravoPlayers }
const { lobby, host, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);isHostAlpha = alphaPlayers.some ((player) => player.id === host.id)
const isHostAlpha = alphaPlayers.some ((player) => player.id === host.id);opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ]
const opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ];1 The host reports a sweep for their team
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team sweep 2
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );2 The other team disputes it
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Dispute result
await lobbyPage.disputeResult ();3 The host confirms the result, the set counting
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Confirm set as host
await lobbyPage.confirmSetAsHost ();Open tab “action”
await lobbyPage.openTab ("action" );Assert
report score button is visible
await expect (lobbyPage.locators.reportScoreButton).toBeVisible ();Act
Open tab “result”
await lobbyPage.openTab ("result" );Assert
tab panel contains “2-0”
await expect (lobbyPage.locators.tabPanel).toContainText ("2-0" );Source test ("the host settles a disputed result by confirming it" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);
const isHostAlpha = alphaPlayers.some ((player) => player.id === host.id);
const opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ];
const lobbyPage = new LobbyPage (page);
await test.step ("The host reports a sweep for their team" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
});
await test.step ("The other team disputes it" , async () => {
await impersonate (page, opponent.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.disputeResult ();
});
await test.step ("The host confirms the result, the set counting" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.confirmSetAsHost ();
await lobbyPage.openTab ("action" );
await expect (lobbyPage.locators.reportScoreButton).toBeVisible ();
await lobbyPage.openTab ("result" );
await expect (lobbyPage.locators.tabPanel).toContainText ("2-0" );
});
})Between sets After a confirmed set the next one starts right away with the teams reshuffled, nobody keeping all of their teammates. In a room bigger than 8 the extra players sit a set out, rotating in for the next one. When the room is short of 8 the waitlist is asked, with a notification, who is ready to take the open spot, and confirming fills it. The first on the waitlist has priority on the spot for 3 minutes, others confirming before them waiting, without the room's pool and pass. Once the priority runs out the spot goes to whoever confirms first. Signing up while a spot is open counts as confirming.
the next set opens on the Rosters tab with the teams reshuffled Lobby page Arrange
Started lobby → { lobby, players, alphaPlayers, bravoPlayers }
const { lobby, players, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);Act
Play set lobby id lobby.id alpha player alphaPlayers[0 ] bravo player bravoPlayers[0 ]
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: alphaPlayers[0 ],
bravoPlayer: bravoPlayers[0 ],
});Lobby page Assert
tab “rosters” has “aria-selected” = “true”
await expect (lobbyPage.tab ("rosters" )).toHaveAttribute (
"aria-selected" ,
"true" ,
);Act
Roster ids lobbyPage, “Alpha” , players → nextAlphaIds
const nextAlphaIds = await rosterIds (lobbyPage, "Alpha" , players);Assert
nextAlphaIds does not equal idsOf (alphaPlayers)
expect (nextAlphaIds).not.toEqual (idsOf (alphaPlayers));nextAlphaIds does not equal idsOf (bravoPlayers)
expect (nextAlphaIds).not.toEqual (idsOf (bravoPlayers));Source test ("the next set opens on the Rosters tab with the teams reshuffled" , async ({
page,
factories,
}) => {
const { lobby, players, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);
const lobbyPage = new LobbyPage (page);
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: alphaPlayers[0 ],
bravoPlayer: bravoPlayers[0 ],
});
await expect (lobbyPage.tab ("rosters" )).toHaveAttribute (
"aria-selected" ,
"true" ,
);
const nextAlphaIds = await rosterIds (lobbyPage, "Alpha" , players);
expect (nextAlphaIds).not.toEqual (idsOf (alphaPlayers));
expect (nextAlphaIds).not.toEqual (idsOf (bravoPlayers));
})in a room of 9 one sits a set out and plays the next The ninth player spectates the first set They play the next set Arrange
Started lobby room size 9 → { lobby, alphaPlayer, bravoPlayer, sittingOut }
const { lobby, alphaPlayer, bravoPlayer, sittingOut } =
await startedLobby (page, factories, { roomSize: 9 });spectator = sittingOut[0 ]
const spectator = sittingOut[0 ];1 The ninth player spectates the first set
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “You're spectating, you'll rotate in”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're spectating, you'll rotate in" ,
);Act
Play set lobby id lobby.id alphaPlayer bravoPlayer
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });2 They play the next set
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();Source test ("in a room of 9 one sits a set out and plays the next" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer, bravoPlayer, sittingOut } =
await startedLobby (page, factories, { roomSize: 9 });
const spectator = sittingOut[0 ];
const lobbyPage = new LobbyPage (page);
await test.step ("The ninth player spectates the first set" , async () => {
await impersonate (page, spectator.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're spectating, you'll rotate in" ,
);
});
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });
await test.step ("They play the next set" , async () => {
await impersonate (page, spectator.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.tab ("action" )).toBeVisible ();
});
})the waitlist is asked to fill a spot that opens up A player signing up to the full room is waitlisted An Alpha player leaves, opening a spot The waitlisted player is notified and confirms they're ready Arrange
Started lobby → { lobby, alphaPlayer }
const { lobby, alphaPlayer } = await startedLobby (page, factories);Create user → lateSignUp
const lateSignUp = await factories.UserFactory .create ();1 A player signing up to the full room is waitlisted
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Sign up
await lobbyPage.signUp ();Assert
viewer status contains “You're #1 on the waitlist”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #1 on the waitlist" ,
);2 An Alpha player leaves, opening a spot
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Leave mid set
await lobbyPage.leaveMidSet ();3 The waitlisted player is notified and confirms they're ready
Act
Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification (`A spot is open in ${LOBBY_NAME}` ) is visible
await expect (
notifications.notification (`A spot is open in ${LOBBY_NAME}` ),
).toBeVisible ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
ready check is visible
await expect (lobbyPage.locators.readyCheck).toBeVisible ();Act
Confirm ready
await lobbyPage.confirmReady ();Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();Source test ("the waitlist is asked to fill a spot that opens up" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer } = await startedLobby (page, factories);
const lateSignUp = await factories.UserFactory .create ();
const lobbyPage = new LobbyPage (page);
await test.step ("A player signing up to the full room is waitlisted" , async () => {
await impersonate (page, lateSignUp.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #1 on the waitlist" ,
);
});
await test.step ("An Alpha player leaves, opening a spot" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.leaveMidSet ();
});
await test.step ("The waitlisted player is notified and confirms they're ready" , async () => {
await impersonate (page, lateSignUp.id);
const notifications = await openNotifications (page);
await expect (
notifications.notification (`A spot is open in ${LOBBY_NAME}` ),
).toBeVisible ();
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.readyCheck).toBeVisible ();
await lobbyPage.confirmReady ();
await expect (lobbyPage.tab ("action" )).toBeVisible ();
});
})the first on the waitlist takes the spot over a faster confirmer The third on the waitlist confirms first and waits The first on the waitlist confirms and gets the spot The third stays out of the room Arrange
Lobby with open spot → { lobby, waitlist }
const { lobby, waitlist } = await lobbyWithOpenSpot (page, factories);[first, , third] = waitlist
const [first, , third] = waitlist;1 The third on the waitlist confirms first and waits
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
waiting banner contains “The waitlist has been asked to fill the open spots”
await expect (lobbyPage.locators.waitingBanner).toContainText (
"The waitlist has been asked to fill the open spots" ,
);Act
Confirm ready
await lobbyPage.confirmReady ();Assert
ready check contains “Confirmed, waiting for the others”
await expect (lobbyPage.locators.readyCheck).toContainText (
"Confirmed, waiting for the others" ,
);tab “action” is not visible
await isNotVisible (lobbyPage.tab ("action" ));2 The first on the waitlist confirms and gets the spot
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Confirm ready
await lobbyPage.confirmReady ();Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();3 The third stays out of the room
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
tab “action” is not visible
await isNotVisible (lobbyPage.tab ("action" ));Source test ("the first on the waitlist takes the spot over a faster confirmer" , async ({
page,
factories,
}) => {
const { lobby, waitlist } = await lobbyWithOpenSpot (page, factories);
const [first, , third] = waitlist;
const lobbyPage = new LobbyPage (page);
await test.step ("The third on the waitlist confirms first and waits" , async () => {
await impersonate (page, third.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.waitingBanner).toContainText (
"The waitlist has been asked to fill the open spots" ,
);
await lobbyPage.confirmReady ();
await expect (lobbyPage.locators.readyCheck).toContainText (
"Confirmed, waiting for the others" ,
);
await isNotVisible (lobbyPage.tab ("action" ));
});
await test.step ("The first on the waitlist confirms and gets the spot" , async () => {
await impersonate (page, first.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.confirmReady ();
await expect (lobbyPage.tab ("action" )).toBeVisible ();
});
await test.step ("The third stays out of the room" , async () => {
await impersonate (page, third.id);
await lobbyPage.goto (lobby.id);
await isNotVisible (lobbyPage.tab ("action" ));
});
})a player checked in but left waiting for a spot doesn't see the room's pool and pass Lobby page Arrange
Lobby with open spot → { lobby, waitlist }
const { lobby, waitlist } = await lobbyWithOpenSpot (page, factories);third = waitlist[2 ]
const third = waitlist[2 ];Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Confirm ready
await lobbyPage.confirmReady ();Assert
ready check contains “Confirmed, waiting for the others”
await expect (lobbyPage.locators.readyCheck).toContainText (
"Confirmed, waiting for the others" ,
);room pool is not visible
await isNotVisible (lobbyPage.locators.roomPool);room pass is not visible
await isNotVisible (lobbyPage.locators.roomPass);Source test ("a player checked in but left waiting for a spot doesn't see the room's pool and pass" , async ({
page,
factories,
}) => {
const { lobby, waitlist } = await lobbyWithOpenSpot (page, factories);
const third = waitlist[2 ];
const lobbyPage = new LobbyPage (page);
await impersonate (page, third.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.confirmReady ();
await expect (lobbyPage.locators.readyCheck).toContainText (
"Confirmed, waiting for the others" ,
);
await isNotVisible (lobbyPage.locators.roomPool);
await isNotVisible (lobbyPage.locators.roomPass);
})signing up while the waitlist has priority counts as ready Lobby page Arrange
Lobby with open spot → { lobby }
const { lobby } = await lobbyWithOpenSpot (page, factories);Create user → lateSignUp
const lateSignUp = await factories.UserFactory .create ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Sign up
await lobbyPage.signUp ();Assert
ready check contains “Confirmed, waiting for the others”
await expect (lobbyPage.locators.readyCheck).toContainText (
"Confirmed, waiting for the others" ,
);confirm ready button is not visible
await isNotVisible (lobbyPage.locators.confirmReadyButton);Source test ("signing up while the waitlist has priority counts as ready" , async ({
page,
factories,
}) => {
const { lobby } = await lobbyWithOpenSpot (page, factories);
const lateSignUp = await factories.UserFactory .create ();
const lobbyPage = new LobbyPage (page);
await impersonate (page, lateSignUp.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
await expect (lobbyPage.locators.readyCheck).toContainText (
"Confirmed, waiting for the others" ,
);
await isNotVisible (lobbyPage.locators.confirmReadyButton);
})signing up once the priority has run out takes the spot right away Lobby page Arrange
Lobby with open spot → { lobby }
const { lobby } = await lobbyWithOpenSpot (page, factories);Expire ready checks lobby lobby.id
await factories.LobbyFactory .expireReadyChecks (lobby.id);Create user → lateSignUp
const lateSignUp = await factories.UserFactory .create ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Sign up
await lobbyPage.signUp ();Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();Source test ("signing up once the priority has run out takes the spot right away" , async ({
page,
factories,
}) => {
const { lobby } = await lobbyWithOpenSpot (page, factories);
await factories.LobbyFactory .expireReadyChecks (lobby.id);
const lateSignUp = await factories.UserFactory .create ();
const lobbyPage = new LobbyPage (page);
await impersonate (page, lateSignUp.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
await expect (lobbyPage.tab ("action" )).toBeVisible ();
})once the first's priority runs out the spot goes to whoever confirms first The third on the waitlist confirms first and gets the spot The second is too late, the spot taken Arrange
Lobby with open spot → { lobby, waitlist }
const { lobby, waitlist } = await lobbyWithOpenSpot (page, factories);[, second, third] = waitlist
const [, second, third] = waitlist;Expire ready checks lobby lobby.id
await factories.LobbyFactory .expireReadyChecks (lobby.id);1 The third on the waitlist confirms first and gets the spot
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Confirm ready
await lobbyPage.confirmReady ();Assert
tab “action” is visible
await expect (lobbyPage.tab ("action" )).toBeVisible ();2 The second is too late, the spot taken
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
ready check is not visible
await isNotVisible (lobbyPage.locators.readyCheck);viewer status contains “You're #2 on the waitlist”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #2 on the waitlist" ,
);Source test ("once the first's priority runs out the spot goes to whoever confirms first" , async ({
page,
factories,
}) => {
const { lobby, waitlist } = await lobbyWithOpenSpot (page, factories);
const [, second, third] = waitlist;
await factories.LobbyFactory .expireReadyChecks (lobby.id);
const lobbyPage = new LobbyPage (page);
await test.step ("The third on the waitlist confirms first and gets the spot" , async () => {
await impersonate (page, third.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.confirmReady ();
await expect (lobbyPage.tab ("action" )).toBeVisible ();
});
await test.step ("The second is too late, the spot taken" , async () => {
await impersonate (page, second.id);
await lobbyPage.goto (lobby.id);
await isNotVisible (lobbyPage.locators.readyCheck);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're #2 on the waitlist" ,
);
});
})Leaving Leaving mid-set forfeits it for the leaver's team once a map has been reported, whatever the score: the set shows as won by forfeit and counts as a set win and loss on the Rankings, the room left short of players. Leaving before any map is reported calls the set off, nobody losing it. A player can instead ask to leave once the set is confirmed, leaving the lobby then. Asking to is told in the lobby's chat and marked on the Rosters tab, the mark explaining itself when clicked. Changing their mind is told in the chat too, after which they can't ask to leave again for a while.
leaving mid-set forfeits it and the room waits for players Alpha wins the first map, then an Alpha player leaves The others wait for an eighth player, no one on the waitlist to ask Bravo is awarded the set on the Result and Rankings tabs The Rankings tell who has left the lobby Once the lobby has ended no one is marked as left Arrange
Started lobby → { lobby, host, alphaPlayers, bravoPlayer }
const { lobby, host, alphaPlayers, bravoPlayer } = await startedLobby (
page,
factories,
);not the host, who ends the lobby in the end
alphaPlayer = alphaPlayers.find ((player) => player.id !== host.id)!
const alphaPlayer = alphaPlayers.find ((player) => player.id !== host.id)!;1 Alpha wins the first map, then an Alpha player leaves
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team win
await lobbyPage.reportOwnTeamWin ();Leave mid set
await lobbyPage.leaveMidSet ();2 The others wait for an eighth player, no one on the waitlist to ask
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
waiting banner contains “Waiting for players (7/8)”
await expect (lobbyPage.locators.waitingBanner).toContainText (
"Waiting for players (7/8)" ,
);waiting banner does not contain “The waitlist has been asked to fill the open spots”
await expect (lobbyPage.locators.waitingBanner).not.toContainText (
"The waitlist has been asked to fill the open spots" ,
);no set being played, so no rosters to show
tab “rosters” is not visible
await isNotVisible (lobbyPage.tab ("rosters" ));3 Bravo is awarded the set on the Result and Rankings tabs
Lobby page Act
Open tab “result”
await lobbyPage.openTab ("result" );Assert
forfeit note reads “Bravo won by forfeit”
await expect (lobbyPage.locators.forfeitNote).toHaveText (
"Bravo won by forfeit" ,
);Act
Open tab “leaderboard”
await lobbyPage.openTab ("leaderboard" );Assert
rankings row bravoPlayer.name › cell “1-0” is visible
await expect (
lobbyPage
.rankingsRow (bravoPlayer.name)
.getByRole ("cell" , { name: "1-0" , exact: true }),
).toBeVisible ();rankings row alphaPlayer.name › cell “0-1” is visible
await expect (
lobbyPage
.rankingsRow (alphaPlayer.name)
.getByRole ("cell" , { name: "0-1" , exact: true }),
).toBeVisible ();4 The Rankings tell who has left the lobby
Lobby page Assert
left lobby markers count is 1
await expect (lobbyPage.locators.leftLobbyMarkers).toHaveCount (1 );Act
Click left lobby marker alphaPlayer.name
await lobbyPage.leftLobbyMarker (alphaPlayer.name).click ();Assert
left lobby popover reads “Left the lobby”
await expect (lobbyPage.locators.leftLobbyPopover).toHaveText (
"Left the lobby" ,
);5 Once the lobby has ended no one is marked as left
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);End lobby
await lobbyPage.endLobby ();Assert
ended status is visible
await expect (lobbyPage.locators.endedStatus).toBeVisible ();Act
Open tab “leaderboard”
await lobbyPage.openTab ("leaderboard" );Assert
rankings row alphaPlayer.name is visible
await expect (lobbyPage.rankingsRow (alphaPlayer.name)).toBeVisible ();left lobby markers count is 0
await expect (lobbyPage.locators.leftLobbyMarkers).toHaveCount (0 );Source test ("leaving mid-set forfeits it and the room waits for players" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayers, bravoPlayer } = await startedLobby (
page,
factories,
);
// not the host, who ends the lobby in the end
const alphaPlayer = alphaPlayers.find ((player) => player.id !== host.id)!;
const lobbyPage = new LobbyPage (page);
await test.step ("Alpha wins the first map, then an Alpha player leaves" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamWin ();
await lobbyPage.leaveMidSet ();
});
await test.step ("The others wait for an eighth player, no one on the waitlist to ask" , async () => {
await impersonate (page, bravoPlayer.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.waitingBanner).toContainText (
"Waiting for players (7/8)" ,
);
await expect (lobbyPage.locators.waitingBanner).not.toContainText (
"The waitlist has been asked to fill the open spots" ,
);
// no set being played, so no rosters to show
await isNotVisible (lobbyPage.tab ("rosters" ));
});
await test.step ("Bravo is awarded the set on the Result and Rankings tabs" , async () => {
await lobbyPage.openTab ("result" );
await expect (lobbyPage.locators.forfeitNote).toHaveText (
"Bravo won by forfeit" ,
);
await lobbyPage.openTab ("leaderboard" );
await expect (
lobbyPage
.rankingsRow (bravoPlayer.name)
.getByRole ("cell" , { name: "1-0" , exact: true }),
).toBeVisible ();
await expect (
lobbyPage
.rankingsRow (alphaPlayer.name)
.getByRole ("cell" , { name: "0-1" , exact: true }),
).toBeVisible ();
});
await test.step ("The Rankings tell who has left the lobby" , async () => {
await expect (lobbyPage.locators.leftLobbyMarkers).toHaveCount (1 );
await lobbyPage.leftLobbyMarker (alphaPlayer.name).click ();
await expect (lobbyPage.locators.leftLobbyPopover).toHaveText (
"Left the lobby" ,
);
});
await test.step ("Once the lobby has ended no one is marked as left" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.endLobby ();
await expect (lobbyPage.locators.endedStatus).toBeVisible ();
await lobbyPage.openTab ("leaderboard" );
await expect (lobbyPage.rankingsRow (alphaPlayer.name)).toBeVisible ();
await expect (lobbyPage.locators.leftLobbyMarkers).toHaveCount (0 );
});
})a player asks to leave once the set is confirmed An Alpha player asks to leave after the set and plays it out A Bravo player sees they are leaving and confirms the set The Alpha player is out of the lobby Arrange
Started lobby → { lobby, alphaPlayer, bravoPlayer }
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);1 An Alpha player asks to leave after the set and plays it out
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Drop after set
await lobbyPage.dropAfterSet ();Assert
drop after set button reads “Stay after this set”
await expect (lobbyPage.locators.dropAfterSetButton).toHaveText (
"Stay after this set" ,
);Act
Report own team sweep 2
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );2 A Bravo player sees they are leaving and confirms the set
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Open tab “rosters”
await lobbyPage.openTab ("rosters" );Assert
leaving after set markers count is 1
await expect (lobbyPage.locators.leavingAfterSetMarkers).toHaveCount (1 );Act
Click leaving after set marker alphaPlayer.name
await lobbyPage.leavingAfterSetMarker (alphaPlayer.name).click ();Assert
leaving after set popover contains `${alphaPlayer.name} leaves the lobby once this set is confirmed`
await expect (lobbyPage.locators.leavingAfterSetPopover).toContainText (
`${alphaPlayer.name} leaves the lobby once this set is confirmed` ,
);Act
Open tab “action”
await lobbyPage.openTab ("action" );Chat sidebar Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Assert
message `${alphaPlayer.name} will leave after this set` is visible
await expect (
chat.chat ().message (`${alphaPlayer.name} will leave after this set` ),
).toBeVisible ();Lobby page Act
Confirm set
await lobbyPage.confirmSet ();Assert
waiting banner contains “Waiting for players (7/8)”
await expect (lobbyPage.locators.waitingBanner).toContainText (
"Waiting for players (7/8)" ,
);3 The Alpha player is out of the lobby
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
sign up button is visible
await expect (lobbyPage.locators.signUpButton).toBeVisible ();Source test ("a player asks to leave once the set is confirmed" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await test.step ("An Alpha player asks to leave after the set and plays it out" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.dropAfterSet ();
await expect (lobbyPage.locators.dropAfterSetButton).toHaveText (
"Stay after this set" ,
);
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
});
await test.step ("A Bravo player sees they are leaving and confirms the set" , async () => {
await impersonate (page, bravoPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.openTab ("rosters" );
await expect (lobbyPage.locators.leavingAfterSetMarkers).toHaveCount (1 );
await lobbyPage.leavingAfterSetMarker (alphaPlayer.name).click ();
await expect (lobbyPage.locators.leavingAfterSetPopover).toContainText (
`${alphaPlayer.name} leaves the lobby once this set is confirmed` ,
);
await lobbyPage.openTab ("action" );
await chat.selectRoomTab ("Lobby" );
await expect (
chat.chat ().message (`${alphaPlayer.name} will leave after this set` ),
).toBeVisible ();
await lobbyPage.confirmSet ();
await expect (lobbyPage.locators.waitingBanner).toContainText (
"Waiting for players (7/8)" ,
);
});
await test.step ("The Alpha player is out of the lobby" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.signUpButton).toBeVisible ();
});
})a player changing their mind about leaving tells the chat and can't ask again right away Lobby page Chat sidebar Arrange
Started lobby → { lobby, alphaPlayer }
const { lobby, alphaPlayer } = await startedLobby (page, factories);Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Drop after set
await lobbyPage.dropAfterSet ();Assert
drop after set button reads “Stay after this set”
await expect (lobbyPage.locators.dropAfterSetButton).toHaveText (
"Stay after this set" ,
);Act
Drop after set
await lobbyPage.dropAfterSet ();Assert
drop after set button is disabled
await expect (lobbyPage.locators.dropAfterSetButton).toBeDisabled ();drop after set button contains /Leave after this set \(\d+s\)/
await expect (lobbyPage.locators.dropAfterSetButton).toContainText (
/Leave after this set \(\d+s\)/,
);Chat sidebar Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Assert
message `${alphaPlayer.name} changed their mind and will stay after this set` is visible
await expect (
chat
.chat ()
.message (
`${alphaPlayer.name} changed their mind and will stay after this set` ,
),
).toBeVisible ();Source test ("a player changing their mind about leaving tells the chat and can't ask again right away" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer } = await startedLobby (page, factories);
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.dropAfterSet ();
await expect (lobbyPage.locators.dropAfterSetButton).toHaveText (
"Stay after this set" ,
);
await lobbyPage.dropAfterSet ();
await expect (lobbyPage.locators.dropAfterSetButton).toBeDisabled ();
await expect (lobbyPage.locators.dropAfterSetButton).toContainText (
/Leave after this set \(\d+s\)/,
);
await chat.selectRoomTab ("Lobby" );
await expect (
chat
.chat ()
.message (
`${alphaPlayer.name} changed their mind and will stay after this set` ,
),
).toBeVisible ();
})Hosting The host kicks participants, who are told so and can't sign up for the lobby again, a player kicked mid-set forfeiting it for their team. The host also sits players of the room out of the sets until resumed, changes the best of from the next set on and ends the lobby. The host can hand hosting over to another participant, which the lobby's chat tells everyone. When the host leaves, the participant who signed up the earliest becomes the host and is notified of it.
a kicked player is told so and can't sign up again The host kicks them Their open page tells them they were kicked Coming back they still can't sign up Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → kicked
const kicked = await factories.UserFactory .create ();Create lobby host user id host.id signed up user ids kicked.id → lobby
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id },
{ signedUpUserIds: [kicked.id] },
);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);1 The host kicks them
Act
Open second user browser, workerBaseURL, host.id → hostSession
const hostSession = await openSecondUser (
browser,
workerBaseURL,
host.id,
);Try
try {
const hostLobbyPage = new LobbyPage (hostSession.page);
await hostLobbyPage.goto (lobby.id);
await hostLobbyPage.kick (kicked.id);
await expect (hostLobbyPage.locators.participants).toHaveCount (1 );
} finally {
await hostSession.close ();
}Open the lobby page lobby.id
await hostLobbyPage.goto (lobby.id);Kick kicked.id
await hostLobbyPage.kick (kicked.id);participants count is 1
await expect (hostLobbyPage.locators.participants).toHaveCount (1 );2 Their open page tells them they were kicked
Lobby page Assert
viewer status contains “The host kicked you from the lobby”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host kicked you from the lobby" ,
);sign up button is not visible
await isNotVisible (lobbyPage.locators.signUpButton);3 Coming back they still can't sign up
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “The host kicked you from the lobby”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host kicked you from the lobby" ,
);sign up button is not visible
await isNotVisible (lobbyPage.locators.signUpButton);Source test ("a kicked player is told so and can't sign up again" , async ({
page,
browser,
workerBaseURL,
factories,
}) => {
const host = await factories.UserFactory .create ();
const kicked = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id },
{ signedUpUserIds: [kicked.id] },
);
await impersonate (page, kicked.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await test.step ("The host kicks them" , async () => {
const hostSession = await openSecondUser (
browser,
workerBaseURL,
host.id,
);
try {
const hostLobbyPage = new LobbyPage (hostSession.page);
await hostLobbyPage.goto (lobby.id);
await hostLobbyPage.kick (kicked.id);
await expect (hostLobbyPage.locators.participants).toHaveCount (1 );
} finally {
await hostSession.close ();
}
});
await test.step ("Their open page tells them they were kicked" , async () => {
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host kicked you from the lobby" ,
);
await isNotVisible (lobbyPage.locators.signUpButton);
});
await test.step ("Coming back they still can't sign up" , async () => {
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host kicked you from the lobby" ,
);
await isNotVisible (lobbyPage.locators.signUpButton);
});
})kicking a player mid-set forfeits it for their team Lobby page Arrange
Started lobby → { lobby, host, alphaPlayers, bravoPlayers }
const { lobby, host, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);isHostAlpha = alphaPlayers.some ((player) => player.id === host.id)
const isHostAlpha = alphaPlayers.some ((player) => player.id === host.id);opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ]
const opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ];Lobby page Act
before a map is reported the set would be called off instead
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team win
await lobbyPage.reportOwnTeamWin ();the room's players are on the Rankings tab, with the host's player menu
Open tab “leaderboard”
await lobbyPage.openTab ("leaderboard" );Kick opponent.id
await lobbyPage.kick (opponent.id);Open tab “result”
await lobbyPage.openTab ("result" );Assert
forfeit note reads `${isHostAlpha ? "Alpha" : "Bravo"} won by forfeit`
await expect (lobbyPage.locators.forfeitNote).toHaveText (
`${isHostAlpha ? "Alpha" : "Bravo"} won by forfeit` ,
);Source test ("kicking a player mid-set forfeits it for their team" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);
const isHostAlpha = alphaPlayers.some ((player) => player.id === host.id);
const opponent = (isHostAlpha ? bravoPlayers : alphaPlayers)[0 ];
await impersonate (page, host.id);
const lobbyPage = new LobbyPage (page);
// before a map is reported the set would be called off instead
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamWin ();
// the room's players are on the Rankings tab, with the host's player menu
await lobbyPage.openTab ("leaderboard" );
await lobbyPage.kick (opponent.id);
await lobbyPage.openTab ("result" );
await expect (lobbyPage.locators.forfeitNote).toHaveText (
`${isHostAlpha ? "Alpha" : "Bravo"} won by forfeit` ,
);
})a player sat out by the host sits out the sets until resumed The host sits a playing player out They sit the next set out The host resumes them Arrange
Started lobby room size 9 → { lobby, host, alphaPlayer, bravoPlayer, alphaPlayers }
const { lobby, host, alphaPlayer, bravoPlayer, alphaPlayers } =
await startedLobby (page, factories, { roomSize: 9 });satOut = alphaPlayers.find ( (player) => player.id !== host.id && player.id !== alphaPl…
const satOut = alphaPlayers.find (
(player) => player.id !== host.id && player.id !== alphaPlayer.id,
)!;1 The host sits a playing player out
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Sit out satOut.id
await lobbyPage.sitOut (satOut.id);Act
Play set lobby id lobby.id alphaPlayer bravoPlayer
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });2 They sit the next set out
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “The host has you sitting out until they resume you”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host has you sitting out until they resume you" ,
);3 The host resumes them
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Resume satOut.id
await lobbyPage.resume (satOut.id);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “You're spectating, you'll rotate in”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're spectating, you'll rotate in" ,
);Source test ("a player sat out by the host sits out the sets until resumed" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayer, bravoPlayer, alphaPlayers } =
await startedLobby (page, factories, { roomSize: 9 });
const satOut = alphaPlayers.find (
(player) => player.id !== host.id && player.id !== alphaPlayer.id,
)!;
const lobbyPage = new LobbyPage (page);
await test.step ("The host sits a playing player out" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await lobbyPage.sitOut (satOut.id);
});
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });
await test.step ("They sit the next set out" , async () => {
await impersonate (page, satOut.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host has you sitting out until they resume you" ,
);
});
await test.step ("The host resumes them" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await lobbyPage.resume (satOut.id);
await impersonate (page, satOut.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're spectating, you'll rotate in" ,
);
});
})a changed best of applies from the next set The host changes the best of mid-set The next set is a best of 5 Arrange
Started lobby → { lobby, host, alphaPlayer, bravoPlayer }
const { lobby, host, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);1 The host changes the best of mid-set
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Change best of 5
await lobbyPage.changeBestOf (5 );Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
best of 3 is visible
await expect (lobbyPage.bestOf (BEST_OF )).toBeVisible ();Act
Play set lobby id lobby.id alphaPlayer bravoPlayer
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });2 The next set is a best of 5
Lobby page Assert
best of 5 is visible
await expect (lobbyPage.bestOf (5 )).toBeVisible ();Source test ("a changed best of applies from the next set" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayer, bravoPlayer } = await startedLobby (
page,
factories,
);
const lobbyPage = new LobbyPage (page);
await test.step ("The host changes the best of mid-set" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.changeBestOf (5 );
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.bestOf (BEST_OF )).toBeVisible ();
});
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });
await test.step ("The next set is a best of 5" , async () => {
await expect (lobbyPage.bestOf (5 )).toBeVisible ();
});
})the host makes another participant the host The host hands hosting over, the lobby's chat telling of it The new host is marked on the Rankings tab and can manage the lobby Arrange
Started lobby → { lobby, host, players }
const { lobby, host, players } = await startedLobby (page, factories);not the earliest to sign up, who'd be the host anyway were the host to leave
newHost = players.at (-1 )!
const newHost = players.at (-1 )!;1 The host hands hosting over, the lobby's chat telling of it
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Make host newHost.id
await lobbyPage.makeHost (newHost.id);Assert
end lobby button is not visible
await isNotVisible (lobbyPage.locators.endLobbyButton);Chat sidebar Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Assert
message `${newHost.name} is now the host` is visible
await expect (
chat.chat ().message (`${newHost.name} is now the host` ),
).toBeVisible ();2 The new host is marked on the Rankings tab and can manage the lobby
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Assert
host marker newHost.name is visible
await expect (lobbyPage.hostMarker (newHost.name)).toBeVisible ();host marker host.name is not visible
await isNotVisible (lobbyPage.hostMarker (host.name));end lobby button is visible
await expect (lobbyPage.locators.endLobbyButton).toBeVisible ();Source test ("the host makes another participant the host" , async ({
page,
factories,
}) => {
const { lobby, host, players } = await startedLobby (page, factories);
// not the earliest to sign up, who'd be the host anyway were the host to leave
const newHost = players.at (-1 )!;
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await test.step ("The host hands hosting over, the lobby's chat telling of it" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await lobbyPage.makeHost (newHost.id);
await isNotVisible (lobbyPage.locators.endLobbyButton);
await chat.selectRoomTab ("Lobby" );
await expect (
chat.chat ().message (`${newHost.name} is now the host` ),
).toBeVisible ();
});
await test.step ("The new host is marked on the Rankings tab and can manage the lobby" , async () => {
await impersonate (page, newHost.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await expect (lobbyPage.hostMarker (newHost.name)).toBeVisible ();
await isNotVisible (lobbyPage.hostMarker (host.name));
await expect (lobbyPage.locators.endLobbyButton).toBeVisible ();
});
})the earliest to sign up becomes the host when the host leaves The host leaves The earliest to sign up is notified and can manage the lobby Arrange
Create user → host
const host = await factories.UserFactory .create ();Create 2 × user → [earliest, latest]
const [earliest, latest] = await factories.UserFactory .createMany (2 );Create lobby host user id host.id name “Test 8s” signed up user ids earliest.id, latest.id → lobby
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id, name: LOBBY_NAME },
{ signedUpUserIds: [earliest.id, latest.id] },
);1 The host leaves
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Leave
await lobbyPage.leave ();2 The earliest to sign up is notified and can manage the lobby
Act
Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification (`You are now the host of ${LOBBY_NAME}` ) is visible
await expect (
notifications.notification (`You are now the host of ${LOBBY_NAME}` ),
).toBeVisible ();Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
end lobby button is visible
await expect (lobbyPage.locators.endLobbyButton).toBeVisible ();Source test ("the earliest to sign up becomes the host when the host leaves" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const [earliest, latest] = await factories.UserFactory .createMany (2 );
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id, name: LOBBY_NAME },
{ signedUpUserIds: [earliest.id, latest.id] },
);
const lobbyPage = new LobbyPage (page);
await test.step ("The host leaves" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.leave ();
});
await test.step ("The earliest to sign up is notified and can manage the lobby" , async () => {
await impersonate (page, earliest.id);
const notifications = await openNotifications (page);
await expect (
notifications.notification (`You are now the host of ${LOBBY_NAME}` ),
).toBeVisible ();
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.endLobbyButton).toBeVisible ();
});
})Lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create lobby host user id host.id → lobby
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);End lobby
await lobbyPage.endLobby ();Assert
ended status is visible
await expect (lobbyPage.locators.endedStatus).toBeVisible ();Source test ("the host ends the lobby" , async ({ page, factories }) => {
const host = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});
await impersonate (page, host.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.endLobby ();
await expect (lobbyPage.locators.endedStatus).toBeVisible ();
})Applying A host can make a lobby require applying to join it, when making it or later. Signing up then sends the host an application instead, the applicant taking no spot until the host accepts it, which signs them up like signing up would and notifies them. An applicant can withdraw their application, one the host declines can't apply again. Turning the option off accepts everyone still waiting.
an applicant gets in once the host accepts them The host makes a lobby requiring applying Signing up applies, taking no spot The host accepts the application The applicant is notified and signed up Arrange
Create user → applicant
const applicant = await factories.UserFactory .create ();Set friend code user Sendou
await factories.UserFactory .setFriendCode (ADMIN_ID );lobbyId = 0
let lobbyId = 0 ;1 The host makes a lobby requiring applying
New lobby page Act
Open the new lobby page
await newLobby.goto ();Fill name with “Test 8s”
await newLobby.form.fill ("name" , LOBBY_NAME );Check is application required
await newLobby.form.check ("isApplicationRequired" );Save
await newLobby.save ();Lobby page Assert
application required is visible
await expect (lobbyPage.locators.applicationRequired).toBeVisible ();lobbyId = Number (page.url ().split ("/" ).at (-1 ))
lobbyId = Number (page.url ().split ("/" ).at (-1 )); 2 Signing up applies, taking no spot
Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);Apply
await lobbyPage.apply ();Assert
viewer status contains “You applied”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You applied" ,
);participants count is 1
await expect (lobbyPage.locators.participants).toHaveCount (1 );3 The host accepts the application
Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);Assert
applications count is 1
await expect (lobbyPage.locators.applications).toHaveCount (1 );Act
Accept application applicant.id
await lobbyPage.acceptApplication (applicant.id);Assert
applications count is 0
await expect (lobbyPage.locators.applications).toHaveCount (0 );participants count is 2
await expect (lobbyPage.locators.participants).toHaveCount (2 );4 The applicant is notified and signed up
Act
Open notifications → notifications
const notifications = await openNotifications (page);Assert
notifications.notification (`You're in ${LOBBY_NAME}` ) is visible
await expect (
notifications.notification (`You're in ${LOBBY_NAME}` ),
).toBeVisible ();Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);Assert
viewer status contains “You're signed up”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're signed up" ,
);Source test ("an applicant gets in once the host accepts them" , async ({
page,
factories,
}) => {
const applicant = await factories.UserFactory .create ();
await factories.UserFactory .setFriendCode (ADMIN_ID );
const lobbyPage = new LobbyPage (page);
let lobbyId = 0 ;
await test.step ("The host makes a lobby requiring applying" , async () => {
await impersonate (page, ADMIN_ID );
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await newLobby.form.fill ("name" , LOBBY_NAME );
await newLobby.form.check ("isApplicationRequired" );
await newLobby.save ();
await expect (lobbyPage.locators.applicationRequired).toBeVisible ();
lobbyId = Number (page.url ().split ("/" ).at (-1 ));
});
await test.step ("Signing up applies, taking no spot" , async () => {
await impersonate (page, applicant.id);
await lobbyPage.goto (lobbyId);
await lobbyPage.apply ();
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You applied" ,
);
await expect (lobbyPage.locators.participants).toHaveCount (1 );
});
await test.step ("The host accepts the application" , async () => {
await impersonate (page, ADMIN_ID );
await lobbyPage.goto (lobbyId);
await expect (lobbyPage.locators.applications).toHaveCount (1 );
await lobbyPage.acceptApplication (applicant.id);
await expect (lobbyPage.locators.applications).toHaveCount (0 );
await expect (lobbyPage.locators.participants).toHaveCount (2 );
});
await test.step ("The applicant is notified and signed up" , async () => {
await impersonate (page, applicant.id);
const notifications = await openNotifications (page);
await expect (
notifications.notification (`You're in ${LOBBY_NAME}` ),
).toBeVisible ();
await lobbyPage.goto (lobbyId);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"You're signed up" ,
);
});
})a declined applicant can't apply again Lobby page Lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → applicant
const applicant = await factories.UserFactory .create ();Create lobby host user id host.id is application required true applied user ids applicant.id → lobby
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id, isApplicationRequired: true },
{ appliedUserIds: [applicant.id] },
);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Decline application applicant.id
await lobbyPage.declineApplication (applicant.id);Assert
applications count is 0
await expect (lobbyPage.locators.applications).toHaveCount (0 );Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “The host declined your application”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host declined your application" ,
);apply button is not visible
await isNotVisible (lobbyPage.locators.applyButton);Source test ("a declined applicant can't apply again" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const applicant = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id, isApplicationRequired: true },
{ appliedUserIds: [applicant.id] },
);
const lobbyPage = new LobbyPage (page);
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.declineApplication (applicant.id);
await expect (lobbyPage.locators.applications).toHaveCount (0 );
await impersonate (page, applicant.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host declined your application" ,
);
await isNotVisible (lobbyPage.locators.applyButton);
})an applicant withdraws their application Lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user → applicant
const applicant = await factories.UserFactory .create ();Create lobby host user id host.id is application required true applied user ids applicant.id → lobby
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id, isApplicationRequired: true },
{ appliedUserIds: [applicant.id] },
);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Withdraw application
await lobbyPage.withdrawApplication ();Assert
apply button is visible
await expect (lobbyPage.locators.applyButton).toBeVisible ();Source test ("an applicant withdraws their application" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const applicant = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id, isApplicationRequired: true },
{ appliedUserIds: [applicant.id] },
);
const lobbyPage = new LobbyPage (page);
await impersonate (page, applicant.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.withdrawApplication ();
await expect (lobbyPage.locators.applyButton).toBeVisible ();
})Weapon randomizer The host picks a weapon randomizer when making the lobby or between sets. When a set starts it rolls 4 weapons for each team, its players deciding who plays which: chaotic any weapons, balanced ones that even out the teams.
the randomizer picked when making the lobby shows on its card and page New lobby page Lobby page Lobbies page Arrange
Set friend code user Sendou
await factories.UserFactory .setFriendCode (ADMIN_ID );New lobby page Act
Open the new lobby page
await newLobby.goto ();Fill name with “Test 8s”
await newLobby.form.fill ("name" , LOBBY_NAME );Select weapon randomizer “Balanced”
await newLobby.selectWeaponRandomizer ("Balanced" );Save
await newLobby.save ();Lobby page Assert
weapon randomizer reads “Balanced random”
await expect (lobbyPage.locators.weaponRandomizer).toHaveText (
"Balanced random" ,
);Lobbies page Act
Open the lobbies page
await lobbies.goto ();Assert
weapon randomizer “Test 8s” reads “Balanced random”
await expect (lobbies.weaponRandomizer (LOBBY_NAME )).toHaveText (
"Balanced random" ,
);Source test ("the randomizer picked when making the lobby shows on its card and page" , async ({
page,
factories,
}) => {
await factories.UserFactory .setFriendCode (ADMIN_ID );
await impersonate (page, ADMIN_ID );
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await newLobby.form.fill ("name" , LOBBY_NAME );
await newLobby.selectWeaponRandomizer ("Balanced" );
await newLobby.save ();
const lobbyPage = new LobbyPage (page);
await expect (lobbyPage.locators.weaponRandomizer).toHaveText (
"Balanced random" ,
);
const lobbies = new LobbiesPage (page);
await lobbies.goto ();
await expect (lobbies.weaponRandomizer (LOBBY_NAME )).toHaveText (
"Balanced random" ,
);
})the host renames the lobby on its edit page, its other settings kept New lobby page Lobby page Arrange
Set friend code user Sendou
await factories.UserFactory .setFriendCode (ADMIN_ID );New lobby page Act
Open the new lobby page
await newLobby.goto ();Fill name with “Test 8s”
await newLobby.form.fill ("name" , LOBBY_NAME );Select weapon randomizer “Balanced”
await newLobby.selectWeaponRandomizer ("Balanced" );Save
await newLobby.save ();Lobby page Act
Rename “Renamed 8s”
await lobbyPage.rename ("Renamed 8s" );Assert
heading “Renamed 8s” is visible
await expect (lobbyPage.heading ("Renamed 8s" )).toBeVisible ();weapon randomizer reads “Balanced random”
await expect (lobbyPage.locators.weaponRandomizer).toHaveText (
"Balanced random" ,
);Source test ("the host renames the lobby on its edit page, its other settings kept" , async ({
page,
factories,
}) => {
await factories.UserFactory .setFriendCode (ADMIN_ID );
await impersonate (page, ADMIN_ID );
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await newLobby.form.fill ("name" , LOBBY_NAME );
await newLobby.selectWeaponRandomizer ("Balanced" );
await newLobby.save ();
const lobbyPage = new LobbyPage (page);
await lobbyPage.rename ("Renamed 8s" );
await expect (lobbyPage.heading ("Renamed 8s" )).toBeVisible ();
await expect (lobbyPage.locators.weaponRandomizer).toHaveText (
"Balanced random" ,
);
})each team of a set gets 4 weapons on the Rosters tab Lobby page Arrange
Started lobby weapon randomizer “CHAOTIC”
await startedLobby (page, factories, { weaponRandomizer: "CHAOTIC" });Lobby page Assert
weapon randomizer reads “Chaotic random”
await expect (lobbyPage.locators.weaponRandomizer).toHaveText (
"Chaotic random" ,
);roster rolled weapons count is 8
await expect (lobbyPage.locators.rosterRolledWeapons).toHaveCount (8 );Source test ("each team of a set gets 4 weapons on the Rosters tab" , async ({
page,
factories,
}) => {
await startedLobby (page, factories, { weaponRandomizer: "CHAOTIC" });
const lobbyPage = new LobbyPage (page);
await expect (lobbyPage.locators.weaponRandomizer).toHaveText (
"Chaotic random" ,
);
await expect (lobbyPage.locators.rosterRolledWeapons).toHaveCount (8 );
})Map pool The sets' maps are picked from the players' preferences in the modes the host picks, unless the host picks a map pool instead, when making the lobby or between sets: a tournament's or a custom one. Its sets are then played on its maps in plain rotation, so nobody is shown as having voted for them.
a tournament's map pool picked when making the lobby, then a custom one and back to ranked modes by the host The tournament's pool links to its rules from the page and shows on the card The host switches to a custom pool The host goes back to the players' preferences in ranked modes Arrange
Set friend code user Sendou
await factories.UserFactory .setFriendCode (ADMIN_ID );Create tournament author Sendou name “Lobby Warmup Cup” start times dateToDatabaseTimestamp (addDays (new Date (), 1 )) map pool maps LOBBY_MAP_POOL .stageModePairs → tournament
const tournament = await factories.TournamentFactory .create ({
authorId: ADMIN_ID ,
name: MAPS_TOURNAMENT_NAME ,
startTimes: [dateToDatabaseTimestamp (addDays (new Date (), 1 ))],
mapPoolMaps: LOBBY_MAP_POOL .stageModePairs,
});1 The tournament's pool links to its rules from the page and shows on the card
New lobby page Act
Open the new lobby page
await newLobby.goto ();Fill name with “Test 8s”
await newLobby.form.fill ("name" , LOBBY_NAME );Select tournament maps “Lobby Warmup Cup”
await newLobby.selectTournamentMaps (MAPS_TOURNAMENT_NAME );Save
await newLobby.save ();Lobby page Assert
map pool link reads “Lobby Warmup Cup”
await expect (lobbyPage.locators.mapPoolLink).toHaveText (
MAPS_TOURNAMENT_NAME ,
);map pool link has “href” = tournamentRulesPage (tournament.id)
await expect (lobbyPage.locators.mapPoolLink).toHaveAttribute (
"href" ,
tournamentRulesPage (tournament.id),
);Arrange
lobbyId = Number (page.url ().split ("/" ).at (-1 ))
const lobbyId = Number (page.url ().split ("/" ).at (-1 ));Lobbies page Act
Open the lobbies page
await lobbies.goto ();Assert
card “Test 8s” contains “Lobby Warmup Cup”
await expect (lobbies.card (LOBBY_NAME )).toContainText (
MAPS_TOURNAMENT_NAME ,
);Lobby page Act
Open the lobby page lobbyId
await lobbyPage.goto (lobbyId);2 The host switches to a custom pool
Lobby page Act
Change map pool LOBBY_MAP_POOL
await lobbyPage.changeMapPool (LOBBY_MAP_POOL );Assert
map pool link reads “3 maps”
await expect (lobbyPage.locators.mapPoolLink).toHaveText ("3 maps" );3 The host goes back to the players' preferences in ranked modes
Lobby page Act
Use ranked modes
await lobbyPage.useRankedModes ();Assert
map pool link is not visible
await isNotVisible (lobbyPage.locators.mapPoolLink);Source test ("a tournament's map pool picked when making the lobby, then a custom one and back to ranked modes by the host" , async ({
page,
factories,
}) => {
await factories.UserFactory .setFriendCode (ADMIN_ID );
const tournament = await factories.TournamentFactory .create ({
authorId: ADMIN_ID ,
name: MAPS_TOURNAMENT_NAME ,
startTimes: [dateToDatabaseTimestamp (addDays (new Date (), 1 ))],
mapPoolMaps: LOBBY_MAP_POOL .stageModePairs,
});
await impersonate (page, ADMIN_ID );
const lobbyPage = new LobbyPage (page);
await test.step ("The tournament's pool links to its rules from the page and shows on the card" , async () => {
const newLobby = new NewLobbyPage (page);
await newLobby.goto ();
await newLobby.form.fill ("name" , LOBBY_NAME );
await newLobby.selectTournamentMaps (MAPS_TOURNAMENT_NAME );
await newLobby.save ();
await expect (lobbyPage.locators.mapPoolLink).toHaveText (
MAPS_TOURNAMENT_NAME ,
);
await expect (lobbyPage.locators.mapPoolLink).toHaveAttribute (
"href" ,
tournamentRulesPage (tournament.id),
);
const lobbyId = Number (page.url ().split ("/" ).at (-1 ));
const lobbies = new LobbiesPage (page);
await lobbies.goto ();
await expect (lobbies.card (LOBBY_NAME )).toContainText (
MAPS_TOURNAMENT_NAME ,
);
await lobbyPage.goto (lobbyId);
});
await test.step ("The host switches to a custom pool" , async () => {
await lobbyPage.changeMapPool (LOBBY_MAP_POOL );
await expect (lobbyPage.locators.mapPoolLink).toHaveText ("3 maps" );
});
await test.step ("The host goes back to the players' preferences in ranked modes" , async () => {
await lobbyPage.useRankedModes ();
await isNotVisible (lobbyPage.locators.mapPoolLink);
});
})sets are played on the map pool's maps, nobody voting for them Lobby page Arrange
Started lobby is pooling every map true map pool LOBBY_MAP_POOL .stageModePairs
await startedLobby (page, factories, {
isPoolingEveryMap: true ,
mapPool: LOBBY_MAP_POOL .stageModePairs,
});Lobby page Assert
current map has “data-testid” = /^banner-map-SZ -[123 ]$/
await expect (lobbyPage.locators.currentMap).toHaveAttribute (
"data-testid" ,
/^banner-map-SZ -[123 ]$/,
);map voters badge is not visible
await isNotVisible (lobbyPage.locators.mapVotersBadge);Source test ("sets are played on the map pool's maps, nobody voting for them" , async ({
page,
factories,
}) => {
await startedLobby (page, factories, {
isPoolingEveryMap: true ,
mapPool: LOBBY_MAP_POOL .stageModePairs,
});
const lobbyPage = new LobbyPage (page);
await expect (lobbyPage.locators.currentMap).toHaveAttribute (
"data-testid" ,
/^banner-map-SZ -[123 ]$/,
);
await isNotVisible (lobbyPage.locators.mapVotersBadge);
})Chat The lobby's chat is shared by everyone in it and stays with players who leave after playing a set, only a kick takes it away. While a set is played its two teams also get a chat of their own, fresh for every set.
leaving before playing is noted in the chat and takes it away A participant leaves before playing and has no chat anymore The host sees them leave in the chat only Arrange
Create user → host
const host = await factories.UserFactory .create ();Create user discord name “EarlyLeaver” → leaver
const leaver = await factories.UserFactory .create ({
discordName: "EarlyLeaver" ,
});Create lobby host user id host.id signed up user ids leaver.id → lobby
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id },
{ signedUpUserIds: [leaver.id] },
);1 A participant leaves before playing and has no chat anymore
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Assert
open chats count is 1
await expect (chat.locators.openChats).toHaveCount (1 );Lobby page Act
Leave
await lobbyPage.leave ();Assert
sign up button is visible
await expect (lobbyPage.locators.signUpButton).toBeVisible ();open chats is not visible
await isNotVisible (chat.locators.openChats);2 The host sees them leave in the chat only
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Assert
message “EarlyLeaver left the lobby” is visible
await expect (
chat.chat ().message ("EarlyLeaver left the lobby" ),
).toBeVisible ();left users is not visible
await isNotVisible (lobbyPage.locators.leftUsers);Source test ("leaving before playing is noted in the chat and takes it away" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const leaver = await factories.UserFactory .create ({
discordName: "EarlyLeaver" ,
});
const lobby = await factories.LobbyFactory .create (
{ hostUserId: host.id },
{ signedUpUserIds: [leaver.id] },
);
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await test.step ("A participant leaves before playing and has no chat anymore" , async () => {
await impersonate (page, leaver.id);
await lobbyPage.goto (lobby.id);
await expect (chat.locators.openChats).toHaveCount (1 );
await lobbyPage.leave ();
await expect (lobbyPage.locators.signUpButton).toBeVisible ();
await isNotVisible (chat.locators.openChats);
});
await test.step ("The host sees them leave in the chat only" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await expect (
chat.chat ().message ("EarlyLeaver left the lobby" ),
).toBeVisible ();
await isNotVisible (lobbyPage.locators.leftUsers);
});
})leaving after playing keeps the lobby's chat, being kicked takes it away A player leaves mid-set and still writes to the lobby Coming back the chat opens with the lobby The host kicks the one who left The kicked one has no chat anymore Arrange
Started lobby → { lobby, host, alphaPlayers }
const { lobby, host, alphaPlayers } = await startedLobby (page, factories);leaver = alphaPlayers.find ((player) => player.id !== host.id)!
const leaver = alphaPlayers.find ((player) => player.id !== host.id)!;1 A player leaves mid-set and still writes to the lobby
Lobby page Act
Open the lobby page lobby.id, “action”
await lobbyPage.goto (lobby.id, "action" );Report own team win
await lobbyPage.reportOwnTeamWin ();Leave mid set
await lobbyPage.leaveMidSet ();Assert
sign up button is visible
await expect (lobbyPage.locators.signUpButton).toBeVisible ();Chat sidebar Act
Send “left but still here”
await chat.chat ().send ("left but still here" );Assert
message “left but still here” is visible
await expect (chat.chat ().message ("left but still here" )).toBeVisible ();pending messages count is 0
await expect (chat.chat ().locators.pendingMessages).toHaveCount (0 );2 Coming back the chat opens with the lobby
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Assert
message “left but still here” is visible
await expect (chat.chat ().message ("left but still here" )).toBeVisible ();Act
Lobby chat room ids → { lobbyRoomId }
const { lobbyRoomId } = await lobbyChatRoomIds (page);3 The host kicks the one who left
Lobby page Act
Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Chat sidebar Assert
message “left but still here” is visible
await expect (chat.chat ().message ("left but still here" )).toBeVisible ();Lobby page Assert
left users count is 1
await expect (lobbyPage.locators.leftUsers).toHaveCount (1 );Act
Kick left user leaver.id
await lobbyPage.kickLeftUser (leaver.id);Assert
left users count is 0
await expect (lobbyPage.locators.leftUsers).toHaveCount (0 );4 The kicked one has no chat anymore
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
viewer status contains “The host kicked you from the lobby”
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host kicked you from the lobby" ,
);open chats is not visible
await isNotVisible (chat.locators.openChats);chatHistoryStatus (page, lobbyRoomId) is 403
expect (await chatHistoryStatus (page, lobbyRoomId)).toBe (403 );Source test ("leaving after playing keeps the lobby's chat, being kicked takes it away" , async ({
page,
factories,
}) => {
const { lobby, host, alphaPlayers } = await startedLobby (page, factories);
const leaver = alphaPlayers.find ((player) => player.id !== host.id)!;
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await test.step ("A player leaves mid-set and still writes to the lobby" , async () => {
await impersonate (page, leaver.id);
await lobbyPage.goto (lobby.id, "action" );
await lobbyPage.reportOwnTeamWin ();
await lobbyPage.leaveMidSet ();
await expect (lobbyPage.locators.signUpButton).toBeVisible ();
await chat.chat ().send ("left but still here" );
await expect (chat.chat ().message ("left but still here" )).toBeVisible ();
await expect (chat.chat ().locators.pendingMessages).toHaveCount (0 );
});
await test.step ("Coming back the chat opens with the lobby" , async () => {
await lobbyPage.goto (lobby.id);
await expect (chat.chat ().message ("left but still here" )).toBeVisible ();
});
const { lobbyRoomId } = await lobbyChatRoomIds (page);
await test.step ("The host kicks the one who left" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await expect (chat.chat ().message ("left but still here" )).toBeVisible ();
await expect (lobbyPage.locators.leftUsers).toHaveCount (1 );
await lobbyPage.kickLeftUser (leaver.id);
await expect (lobbyPage.locators.leftUsers).toHaveCount (0 );
});
await test.step ("The kicked one has no chat anymore" , async () => {
await impersonate (page, leaver.id);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.viewerStatus).toContainText (
"The host kicked you from the lobby" ,
);
await isNotVisible (chat.locators.openChats);
expect (await chatHistoryStatus (page, lobbyRoomId)).toBe (403 );
});
})a team's chat reaches only its players An Alpha player writes to their team and to the lobby Their teammate reads the team message A Bravo player reads only the lobby message The two chats are one row of the room list Arrange
Started lobby → { lobby, alphaPlayers, bravoPlayer }
const { lobby, alphaPlayers, bravoPlayer } = await startedLobby (
page,
factories,
);[sender, teammate] = alphaPlayers
const [sender, teammate] = alphaPlayers;1 An Alpha player writes to their team and to the lobby
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Assert
as tabs while the view is too short to stack them
split panels count is 2
await expect (chat.locators.splitPanels).toHaveCount (2 );room tabs reads “Lobby” , “Team”
await expect (chat.locators.roomTabs).toHaveText (["Lobby" , "Team" ]);Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Send “alpha only”
await chat.chat ().send ("alpha only" );Assert
message “alpha only” is visible
await expect (chat.chat ().message ("alpha only" )).toBeVisible ();Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Send “hello lobby”
await chat.chat ().send ("hello lobby" );Assert
message “hello lobby” is visible
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();message “alpha only” count is 0
await expect (chat.chat ().message ("alpha only" )).toHaveCount (0 );2 Their teammate reads the team message
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Assert
message “alpha only” is visible
await expect (chat.chat ().message ("alpha only" )).toBeVisible ();3 A Bravo player reads only the lobby message
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Assert
message “alpha only” count is 0
await expect (chat.chat ().message ("alpha only" )).toHaveCount (0 );Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Assert
message “hello lobby” is visible
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();4 The two chats are one row of the room list
Chat sidebar Act
Back to room list
await chat.backToRoomList ();Assert
room rows count is 1
await expect (chat.locators.roomRows).toHaveCount (1 );room rows contains “Lobby · Team”
await expect (chat.locators.roomRows).toContainText ("Lobby · Team" );Source test ("a team's chat reaches only its players" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayers, bravoPlayer } = await startedLobby (
page,
factories,
);
const [sender, teammate] = alphaPlayers;
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await test.step ("An Alpha player writes to their team and to the lobby" , async () => {
await impersonate (page, sender.id);
await lobbyPage.goto (lobby.id);
// as tabs while the view is too short to stack them
await expect (chat.locators.splitPanels).toHaveCount (2 );
await expect (chat.locators.roomTabs).toHaveText (["Lobby" , "Team" ]);
await chat.selectRoomTab ("Team" );
await chat.chat ().send ("alpha only" );
await expect (chat.chat ().message ("alpha only" )).toBeVisible ();
await chat.selectRoomTab ("Lobby" );
await chat.chat ().send ("hello lobby" );
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();
await expect (chat.chat ().message ("alpha only" )).toHaveCount (0 );
});
await test.step ("Their teammate reads the team message" , async () => {
await impersonate (page, teammate.id);
await lobbyPage.goto (lobby.id);
await chat.selectRoomTab ("Team" );
await expect (chat.chat ().message ("alpha only" )).toBeVisible ();
});
await test.step ("A Bravo player reads only the lobby message" , async () => {
await impersonate (page, bravoPlayer.id);
await lobbyPage.goto (lobby.id);
await chat.selectRoomTab ("Team" );
await expect (chat.chat ().message ("alpha only" )).toHaveCount (0 );
await chat.selectRoomTab ("Lobby" );
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();
});
await test.step ("The two chats are one row of the room list" , async () => {
await chat.backToRoomList ();
await expect (chat.locators.roomRows).toHaveCount (1 );
await expect (chat.locators.roomRows).toContainText ("Lobby · Team" );
});
})every set starts with fresh team chats An Alpha player writes to their team and to the lobby in the first set The sender's team chat of the next set starts empty Their new teammate reads only the next set's message A former teammate now on the other team reads neither Arrange
Started lobby → { lobby, players, alphaPlayers, bravoPlayers }
const { lobby, players, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);sender = alphaPlayers[0 ]
const sender = alphaPlayers[0 ];1 An Alpha player writes to their team and to the lobby in the first set
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Send “first set plan”
await chat.chat ().send ("first set plan" );Assert
message “first set plan” is visible
await expect (chat.chat ().message ("first set plan" )).toBeVisible ();Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Send “hello lobby”
await chat.chat ().send ("hello lobby" );Assert
message “hello lobby” is visible
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();Act
Play set lobby id lobby.id alpha player sender bravo player bravoPlayers[0 ]
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: sender,
bravoPlayer: bravoPlayers[0 ],
});Lobby page Assert
tab “rosters” has “aria-selected” = “true”
await expect (lobbyPage.tab ("rosters" )).toHaveAttribute (
"aria-selected" ,
"true" ,
);Act
Roster ids lobbyPage, “Alpha” , players → nextAlphaIds
const nextAlphaIds = await rosterIds (lobbyPage, "Alpha" , players);Arrange
senderTeamIds = nextAlphaIds.includes (sender.id) ? nextAlphaIds : idsOf (players).filter ((id) …
const senderTeamIds = nextAlphaIds.includes (sender.id)
? nextAlphaIds
: idsOf (players).filter ((id) => !nextAlphaIds.includes (id));newTeammate = players.find ( (player) => player.id !== sender.id && senderTeamIds.includes (p…
const newTeammate = players.find (
(player) =>
player.id !== sender.id && senderTeamIds.includes (player.id),
)!;the teams were reshuffled, so someone of the first set's team now plays against the sender
formerTeammate = alphaPlayers.find ( (player) => !senderTeamIds.includes (player.id), )!
const formerTeammate = alphaPlayers.find (
(player) => !senderTeamIds.includes (player.id),
)!;2 The sender's team chat of the next set starts empty
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Send “second set plan”
await chat.chat ().send ("second set plan" );Assert
message “second set plan” is visible
await expect (chat.chat ().message ("second set plan" )).toBeVisible ();message “first set plan” count is 0
await expect (chat.chat ().message ("first set plan" )).toHaveCount (0 );Act
Select room tab “Lobby”
await chat.selectRoomTab ("Lobby" );Assert
message “hello lobby” is visible
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();3 Their new teammate reads only the next set's message
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Assert
message “second set plan” is visible
await expect (chat.chat ().message ("second set plan" )).toBeVisible ();message “first set plan” count is 0
await expect (chat.chat ().message ("first set plan" )).toHaveCount (0 );4 A former teammate now on the other team reads neither
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Chat sidebar Act
Select room tab “Team”
await chat.selectRoomTab ("Team" );Send “other team plan”
await chat.chat ().send ("other team plan" );Assert
message “other team plan” is visible
await expect (chat.chat ().message ("other team plan" )).toBeVisible ();message “second set plan” count is 0
await expect (chat.chat ().message ("second set plan" )).toHaveCount (0 );message “first set plan” count is 0
await expect (chat.chat ().message ("first set plan" )).toHaveCount (0 );Source test ("every set starts with fresh team chats" , async ({
page,
factories,
}) => {
const { lobby, players, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);
const sender = alphaPlayers[0 ];
const lobbyPage = new LobbyPage (page);
const chat = new ChatSidebar (page);
await test.step ("An Alpha player writes to their team and to the lobby in the first set" , async () => {
await impersonate (page, sender.id);
await lobbyPage.goto (lobby.id);
await chat.selectRoomTab ("Team" );
await chat.chat ().send ("first set plan" );
await expect (chat.chat ().message ("first set plan" )).toBeVisible ();
await chat.selectRoomTab ("Lobby" );
await chat.chat ().send ("hello lobby" );
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();
});
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: sender,
bravoPlayer: bravoPlayers[0 ],
});
await expect (lobbyPage.tab ("rosters" )).toHaveAttribute (
"aria-selected" ,
"true" ,
);
const nextAlphaIds = await rosterIds (lobbyPage, "Alpha" , players);
const senderTeamIds = nextAlphaIds.includes (sender.id)
? nextAlphaIds
: idsOf (players).filter ((id) => !nextAlphaIds.includes (id));
const newTeammate = players.find (
(player) =>
player.id !== sender.id && senderTeamIds.includes (player.id),
)!;
// the teams were reshuffled, so someone of the first set's team now plays against the sender
const formerTeammate = alphaPlayers.find (
(player) => !senderTeamIds.includes (player.id),
)!;
await test.step ("The sender's team chat of the next set starts empty" , async () => {
await impersonate (page, sender.id);
await lobbyPage.goto (lobby.id);
await chat.selectRoomTab ("Team" );
await chat.chat ().send ("second set plan" );
await expect (chat.chat ().message ("second set plan" )).toBeVisible ();
await expect (chat.chat ().message ("first set plan" )).toHaveCount (0 );
await chat.selectRoomTab ("Lobby" );
await expect (chat.chat ().message ("hello lobby" )).toBeVisible ();
});
await test.step ("Their new teammate reads only the next set's message" , async () => {
await impersonate (page, newTeammate.id);
await lobbyPage.goto (lobby.id);
await chat.selectRoomTab ("Team" );
await expect (chat.chat ().message ("second set plan" )).toBeVisible ();
await expect (chat.chat ().message ("first set plan" )).toHaveCount (0 );
});
await test.step ("A former teammate now on the other team reads neither" , async () => {
await impersonate (page, formerTeammate.id);
await lobbyPage.goto (lobby.id);
await chat.selectRoomTab ("Team" );
await chat.chat ().send ("other team plan" );
await expect (chat.chat ().message ("other team plan" )).toBeVisible ();
await expect (chat.chat ().message ("second set plan" )).toHaveCount (0 );
await expect (chat.chat ().message ("first set plan" )).toHaveCount (0 );
});
})Voice A player of a set has the lobby's chat and their team's, each with a voice call. When a set starts a call in the team's chat follows the player to their team of the new set, one in the lobby's chat stays put, and a player sitting the set out is dropped from their team's call. Leaving the lobby ends the player's call.
a call in the lobby's chat stays there when the set starts Arrange
Lobby awaiting last check in → { lobby, players }
const { lobby, players } = await lobbyAwaitingLastCheckIn (factories);caller = players[0 ]
const caller = players[0 ];Act
Open second user browser, workerBaseURL, caller.id → callerSession
const callerSession = await openSecondUser (
browser,
workerBaseURL,
caller.id,
);Try
try {
const callerChat = new ChatSidebar (callerSession.page);
const callerVoice = new VoicePanel (callerSession.page);
let lobbyRoomId = 0 ;
await test.step ("A player joins the lobby chat's call before the start" , async () => {
await new LobbyPage (callerSession.page).goto (lobby.id);
({ lobbyRoomId } = await lobbyChatRoomIds (callerSession.page));
await callerVoice.joinVoice (LOBBY_NAME );
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);
});
await startLobby (page, { lobby, players });
await test.step ("Once the set starts they are still in the lobby chat's call" , async () => {
await expect (callerChat.locators.roomTabs).toHaveText ([
"Lobby" ,
"Team" ,
]);
await callerVoice.open ();
await expect (callerVoice.locators.callSection).toContainText (
LOBBY_NAME ,
);
await expect (
callerVoice.joinableRoom (TEAM_VOICE_TITLE ),
).toBeVisible ();
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);
});
} finally {
await callerSession.close ();
}lobbyRoomId = 0
let lobbyRoomId = 0 ;A player joins the lobby chat's call before the start
await test.step ("A player joins the lobby chat's call before the start" , async () => {
await new LobbyPage (callerSession.page).goto (lobby.id);
({ lobbyRoomId } = await lobbyChatRoomIds (callerSession.page));
await callerVoice.joinVoice (LOBBY_NAME );
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);
});Open the lobby page lobby.id
await new LobbyPage (callerSession.page).goto (lobby.id);Lobby chat room ids callerSession.page → { lobbyRoomId }
({ lobbyRoomId } = await lobbyChatRoomIds (callerSession.page)); Join voice “Test 8s”
await callerVoice.joinVoice (LOBBY_NAME );() => voiceRoomUserIds (callerSession.page, lobbyRoomId) equals caller.id
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);Start lobby lobby players
await startLobby (page, { lobby, players });Once the set starts they are still in the lobby chat's call
await test.step ("Once the set starts they are still in the lobby chat's call" , async () => {
await expect (callerChat.locators.roomTabs).toHaveText ([
"Lobby" ,
"Team" ,
]);
await callerVoice.open ();
await expect (callerVoice.locators.callSection).toContainText (
LOBBY_NAME ,
);
await expect (
callerVoice.joinableRoom (TEAM_VOICE_TITLE ),
).toBeVisible ();
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);
});room tabs reads “Lobby” , “Team”
await expect (callerChat.locators.roomTabs).toHaveText ([
"Lobby" ,
"Team" ,
]);Open
await callerVoice.open ();call section contains “Test 8s”
await expect (callerVoice.locators.callSection).toContainText (
LOBBY_NAME ,
);joinable room “/Team (Alpha|Bravo)/” is visible
await expect (
callerVoice.joinableRoom (TEAM_VOICE_TITLE ),
).toBeVisible ();() => voiceRoomUserIds (callerSession.page, lobbyRoomId) equals caller.id
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);Source test ("a call in the lobby's chat stays there when the set starts" , async ({
page,
factories,
browser,
workerBaseURL,
}) => {
const { lobby, players } = await lobbyAwaitingLastCheckIn (factories);
const caller = players[0 ];
const callerSession = await openSecondUser (
browser,
workerBaseURL,
caller.id,
);
try {
const callerChat = new ChatSidebar (callerSession.page);
const callerVoice = new VoicePanel (callerSession.page);
let lobbyRoomId = 0 ;
await test.step ("A player joins the lobby chat's call before the start" , async () => {
await new LobbyPage (callerSession.page).goto (lobby.id);
({ lobbyRoomId } = await lobbyChatRoomIds (callerSession.page));
await callerVoice.joinVoice (LOBBY_NAME );
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);
});
await startLobby (page, { lobby, players });
await test.step ("Once the set starts they are still in the lobby chat's call" , async () => {
await expect (callerChat.locators.roomTabs).toHaveText ([
"Lobby" ,
"Team" ,
]);
await callerVoice.open ();
await expect (callerVoice.locators.callSection).toContainText (
LOBBY_NAME ,
);
await expect (
callerVoice.joinableRoom (TEAM_VOICE_TITLE ),
).toBeVisible ();
await expect
.poll (() => voiceRoomUserIds (callerSession.page, lobbyRoomId))
.toEqual ([caller.id]);
});
} finally {
await callerSession.close ();
}
})a call in the team's chat moves to the player's team of the next set Arrange
Started lobby → { lobby, alphaPlayers, bravoPlayers }
const { lobby, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);playSet plays as alphaPlayers[0] on the other page
caller = alphaPlayers[1 ]
const caller = alphaPlayers[1 ];Act
Open second user browser, workerBaseURL, caller.id → callerSession
const callerSession = await openSecondUser (
browser,
workerBaseURL,
caller.id,
);Try
try {
const callerVoice = new VoicePanel (callerSession.page);
let firstTeamRoomId = 0 ;
await test.step ("A player joins their team chat's call" , async () => {
await new LobbyPage (callerSession.page).goto (lobby.id);
firstTeamRoomId = await teamChatRoomId (callerSession.page);
await callerVoice.joinVoice (TEAM_VOICE_TITLE );
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([caller.id]);
});
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: alphaPlayers[0 ],
bravoPlayer: bravoPlayers[0 ],
});
await test.step ("In the next set they are in the call of their new team's chat" , async () => {
// the next set's chats are made after the first's
await expect
.poll (
async () =>
(await lobbyChatRoomIds (callerSession.page)).teamRoomId,
)
.toBeGreaterThan (firstTeamRoomId);
const nextTeamRoomId = await teamChatRoomId (callerSession.page);
await expect
.poll (() => voiceRoomUserIds (callerSession.page, nextTeamRoomId))
.toEqual ([caller.id]);
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([]);
await callerVoice.open ();
await expect (callerVoice.locators.callSection).toContainText (
TEAM_VOICE_TITLE ,
);
});
} finally {
await callerSession.close ();
}firstTeamRoomId = 0
let firstTeamRoomId = 0 ;A player joins their team chat's call
await test.step ("A player joins their team chat's call" , async () => {
await new LobbyPage (callerSession.page).goto (lobby.id);
firstTeamRoomId = await teamChatRoomId (callerSession.page);
await callerVoice.joinVoice (TEAM_VOICE_TITLE );
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([caller.id]);
});Open the lobby page lobby.id
await new LobbyPage (callerSession.page).goto (lobby.id);Team chat room id callerSession.page → firstTeamRoomId
firstTeamRoomId = await teamChatRoomId (callerSession.page); Join voice “/Team (Alpha|Bravo)/”
await callerVoice.joinVoice (TEAM_VOICE_TITLE );() => voiceRoomUserIds (callerSession.page, firstTeamRoomId) equals caller.id
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([caller.id]);Play set lobby id lobby.id alpha player alphaPlayers[0 ] bravo player bravoPlayers[0 ]
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: alphaPlayers[0 ],
bravoPlayer: bravoPlayers[0 ],
});In the next set they are in the call of their new team's chat
await test.step ("In the next set they are in the call of their new team's chat" , async () => {
// the next set's chats are made after the first's
await expect
.poll (
async () =>
(await lobbyChatRoomIds (callerSession.page)).teamRoomId,
)
.toBeGreaterThan (firstTeamRoomId);
const nextTeamRoomId = await teamChatRoomId (callerSession.page);
await expect
.poll (() => voiceRoomUserIds (callerSession.page, nextTeamRoomId))
.toEqual ([caller.id]);
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([]);
await callerVoice.open ();
await expect (callerVoice.locators.callSection).toContainText (
TEAM_VOICE_TITLE ,
);
});the next set's chats are made after the first's
async () => (await lobbyChatRoomIds (callerSession.page)).teamRoomId is more than firstTeamRoomId
await expect
.poll (
async () =>
(await lobbyChatRoomIds (callerSession.page)).teamRoomId,
)
.toBeGreaterThan (firstTeamRoomId);Team chat room id callerSession.page → nextTeamRoomId
const nextTeamRoomId = await teamChatRoomId (callerSession.page);() => voiceRoomUserIds (callerSession.page, nextTeamRoomId) equals caller.id
await expect
.poll (() => voiceRoomUserIds (callerSession.page, nextTeamRoomId))
.toEqual ([caller.id]);() => voiceRoomUserIds (callerSession.page, firstTeamRoomId) equals
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([]);Open
await callerVoice.open ();call section contains “/Team (Alpha|Bravo)/”
await expect (callerVoice.locators.callSection).toContainText (
TEAM_VOICE_TITLE ,
);Source test ("a call in the team's chat moves to the player's team of the next set" , async ({
page,
factories,
browser,
workerBaseURL,
}) => {
const { lobby, alphaPlayers, bravoPlayers } = await startedLobby (
page,
factories,
);
// playSet plays as alphaPlayers[0] on the other page
const caller = alphaPlayers[1 ];
const callerSession = await openSecondUser (
browser,
workerBaseURL,
caller.id,
);
try {
const callerVoice = new VoicePanel (callerSession.page);
let firstTeamRoomId = 0 ;
await test.step ("A player joins their team chat's call" , async () => {
await new LobbyPage (callerSession.page).goto (lobby.id);
firstTeamRoomId = await teamChatRoomId (callerSession.page);
await callerVoice.joinVoice (TEAM_VOICE_TITLE );
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([caller.id]);
});
await playSet (page, {
lobbyId: lobby.id,
alphaPlayer: alphaPlayers[0 ],
bravoPlayer: bravoPlayers[0 ],
});
await test.step ("In the next set they are in the call of their new team's chat" , async () => {
// the next set's chats are made after the first's
await expect
.poll (
async () =>
(await lobbyChatRoomIds (callerSession.page)).teamRoomId,
)
.toBeGreaterThan (firstTeamRoomId);
const nextTeamRoomId = await teamChatRoomId (callerSession.page);
await expect
.poll (() => voiceRoomUserIds (callerSession.page, nextTeamRoomId))
.toEqual ([caller.id]);
await expect
.poll (() => voiceRoomUserIds (callerSession.page, firstTeamRoomId))
.toEqual ([]);
await callerVoice.open ();
await expect (callerVoice.locators.callSection).toContainText (
TEAM_VOICE_TITLE ,
);
});
} finally {
await callerSession.close ();
}
})leaving the lobby ends the player's call Arrange
Started lobby → { lobby, host, alphaPlayers, bravoPlayer }
const { lobby, host, alphaPlayers, bravoPlayer } = await startedLobby (
page,
factories,
);leaver = alphaPlayers.find ((player) => player.id !== host.id)!
const leaver = alphaPlayers.find ((player) => player.id !== host.id)!;Act
Open second user browser, workerBaseURL, bravoPlayer.id → stayerSession
const stayerSession = await openSecondUser (
browser,
workerBaseURL,
bravoPlayer.id,
);Try
try {
const stayerVoice = new VoicePanel (stayerSession.page);
let lobbyRoomId = 0 ;
await test.step ("Two players join the lobby chat's call" , async () => {
await impersonate (page, leaver.id);
await lobbyPage.goto (lobby.id);
await voice.joinVoice (LOBBY_NAME );
await new LobbyPage (stayerSession.page).goto (lobby.id);
({ lobbyRoomId } = await lobbyChatRoomIds (stayerSession.page));
await stayerVoice.joinVoice (LOBBY_NAME );
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual (idsOf ([leaver, bravoPlayer]));
});
await test.step ("One leaves the lobby and is out of the call" , async () => {
await lobbyPage.leaveMidSet ();
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual ([bravoPlayer.id]);
await isNotVisible (voice.locators.leaveVoiceButton);
});
} finally {
await stayerSession.close ();
}lobbyRoomId = 0
let lobbyRoomId = 0 ;Two players join the lobby chat's call
await test.step ("Two players join the lobby chat's call" , async () => {
await impersonate (page, leaver.id);
await lobbyPage.goto (lobby.id);
await voice.joinVoice (LOBBY_NAME );
await new LobbyPage (stayerSession.page).goto (lobby.id);
({ lobbyRoomId } = await lobbyChatRoomIds (stayerSession.page));
await stayerVoice.joinVoice (LOBBY_NAME );
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual (idsOf ([leaver, bravoPlayer]));
});
await impersonate (page, leaver.id);Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Join voice “Test 8s”
await voice.joinVoice (LOBBY_NAME );Open the lobby page lobby.id
await new LobbyPage (stayerSession.page).goto (lobby.id);Lobby chat room ids stayerSession.page → { lobbyRoomId }
({ lobbyRoomId } = await lobbyChatRoomIds (stayerSession.page)); Join voice “Test 8s”
await stayerVoice.joinVoice (LOBBY_NAME );() => voiceRoomUserIds (stayerSession.page, lobbyRoomId) equals idsOf ([leaver, bravoPlayer])
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual (idsOf ([leaver, bravoPlayer]));One leaves the lobby and is out of the call
await test.step ("One leaves the lobby and is out of the call" , async () => {
await lobbyPage.leaveMidSet ();
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual ([bravoPlayer.id]);
await isNotVisible (voice.locators.leaveVoiceButton);
});Leave mid set
await lobbyPage.leaveMidSet ();() => voiceRoomUserIds (stayerSession.page, lobbyRoomId) equals bravoPlayer.id
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual ([bravoPlayer.id]);leave voice button is not visible
await isNotVisible (voice.locators.leaveVoiceButton);Source test ("leaving the lobby ends the player's call" , async ({
page,
factories,
browser,
workerBaseURL,
}) => {
const { lobby, host, alphaPlayers, bravoPlayer } = await startedLobby (
page,
factories,
);
const leaver = alphaPlayers.find ((player) => player.id !== host.id)!;
const lobbyPage = new LobbyPage (page);
const voice = new VoicePanel (page);
const stayerSession = await openSecondUser (
browser,
workerBaseURL,
bravoPlayer.id,
);
try {
const stayerVoice = new VoicePanel (stayerSession.page);
let lobbyRoomId = 0 ;
await test.step ("Two players join the lobby chat's call" , async () => {
await impersonate (page, leaver.id);
await lobbyPage.goto (lobby.id);
await voice.joinVoice (LOBBY_NAME );
await new LobbyPage (stayerSession.page).goto (lobby.id);
({ lobbyRoomId } = await lobbyChatRoomIds (stayerSession.page));
await stayerVoice.joinVoice (LOBBY_NAME );
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual (idsOf ([leaver, bravoPlayer]));
});
await test.step ("One leaves the lobby and is out of the call" , async () => {
await lobbyPage.leaveMidSet ();
await expect
.poll (() => voiceRoomUserIds (stayerSession.page, lobbyRoomId))
.toEqual ([bravoPlayer.id]);
await isNotVisible (voice.locators.leaveVoiceButton);
});
} finally {
await stayerSession.close ();
}
})a call in the team's chat ends for a player sitting out the next set Arrange
Started lobby room size 9 → { lobby, host, alphaPlayer, bravoPlayer, alphaPlayers }
const { lobby, host, alphaPlayer, bravoPlayer, alphaPlayers } =
await startedLobby (page, factories, { roomSize: 9 });satOut = alphaPlayers.find ( (player) => player.id !== host.id && player.id !== alphaPl…
const satOut = alphaPlayers.find (
(player) => player.id !== host.id && player.id !== alphaPlayer.id,
)!;Act
Open second user browser, workerBaseURL, satOut.id → satOutSession
const satOutSession = await openSecondUser (
browser,
workerBaseURL,
satOut.id,
);Try
try {
const satOutVoice = new VoicePanel (satOutSession.page);
let teamRoomId = 0 ;
await test.step ("A player joins their team chat's call" , async () => {
await new LobbyPage (satOutSession.page).goto (lobby.id);
teamRoomId = await teamChatRoomId (satOutSession.page);
await satOutVoice.joinVoice (TEAM_VOICE_TITLE );
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([satOut.id]);
});
await test.step ("The host sits them out" , async () => {
const lobbyPage = new LobbyPage (page);
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await lobbyPage.sitOut (satOut.id);
});
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });
await test.step ("Their call ends as the next set starts without them" , async () => {
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([]);
await isNotVisible (satOutVoice.locators.leaveVoiceButton);
});
} finally {
await satOutSession.close ();
}teamRoomId = 0
let teamRoomId = 0 ;A player joins their team chat's call
await test.step ("A player joins their team chat's call" , async () => {
await new LobbyPage (satOutSession.page).goto (lobby.id);
teamRoomId = await teamChatRoomId (satOutSession.page);
await satOutVoice.joinVoice (TEAM_VOICE_TITLE );
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([satOut.id]);
});Open the lobby page lobby.id
await new LobbyPage (satOutSession.page).goto (lobby.id);Team chat room id satOutSession.page → teamRoomId
teamRoomId = await teamChatRoomId (satOutSession.page); Join voice “/Team (Alpha|Bravo)/”
await satOutVoice.joinVoice (TEAM_VOICE_TITLE );() => voiceRoomUserIds (satOutSession.page, teamRoomId) equals satOut.id
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([satOut.id]);The host sits them out
await test.step ("The host sits them out" , async () => {
const lobbyPage = new LobbyPage (page);
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await lobbyPage.sitOut (satOut.id);
});
await impersonate (page, host.id);Open the lobby page lobby.id, “leaderboard”
await lobbyPage.goto (lobby.id, "leaderboard" );Sit out satOut.id
await lobbyPage.sitOut (satOut.id);Play set lobby id lobby.id alphaPlayer bravoPlayer
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });Their call ends as the next set starts without them
await test.step ("Their call ends as the next set starts without them" , async () => {
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([]);
await isNotVisible (satOutVoice.locators.leaveVoiceButton);
});() => voiceRoomUserIds (satOutSession.page, teamRoomId) equals
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([]);leave voice button is not visible
await isNotVisible (satOutVoice.locators.leaveVoiceButton);Source test ("a call in the team's chat ends for a player sitting out the next set" , async ({
page,
factories,
browser,
workerBaseURL,
}) => {
const { lobby, host, alphaPlayer, bravoPlayer, alphaPlayers } =
await startedLobby (page, factories, { roomSize: 9 });
const satOut = alphaPlayers.find (
(player) => player.id !== host.id && player.id !== alphaPlayer.id,
)!;
const satOutSession = await openSecondUser (
browser,
workerBaseURL,
satOut.id,
);
try {
const satOutVoice = new VoicePanel (satOutSession.page);
let teamRoomId = 0 ;
await test.step ("A player joins their team chat's call" , async () => {
await new LobbyPage (satOutSession.page).goto (lobby.id);
teamRoomId = await teamChatRoomId (satOutSession.page);
await satOutVoice.joinVoice (TEAM_VOICE_TITLE );
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([satOut.id]);
});
await test.step ("The host sits them out" , async () => {
const lobbyPage = new LobbyPage (page);
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id, "leaderboard" );
await lobbyPage.sitOut (satOut.id);
});
await playSet (page, { lobbyId: lobby.id, alphaPlayer, bravoPlayer });
await test.step ("Their call ends as the next set starts without them" , async () => {
await expect
.poll (() => voiceRoomUserIds (satOutSession.page, teamRoomId))
.toEqual ([]);
await isNotVisible (satOutVoice.locators.leaveVoiceButton);
});
} finally {
await satOutSession.close ();
}
})Closing A started lobby closes on its own after 2 hours waiting for players or 2 hours without a map reported, moving to the Ended tab of its players' lobby list. It also ends when everyone has left after the start.
a lobby waiting for players for 2 hours closes Lobbies page Arrange
Create ROOM_SIZE - 1 × user → [host, ...others]
const [host, ...others] = await factories.UserFactory .createMany (
ROOM_SIZE - 1 ,
);Create lobby host user id host.id name “Test 8s” starts at dateToDatabaseTimestamp (subHours (new Date (), 3 )) pending since dateToDatabaseTimestamp ( subMinutes (new Date (), 2 * 60 + 1 ), ) signed up user ids others.map ((user) => user.id) checked in user ids [host, ...others].map ((user) => user.id)
await factories.LobbyFactory .create (
{
hostUserId: host.id,
name: LOBBY_NAME ,
startsAt: dateToDatabaseTimestamp (subHours (new Date (), 3 )),
pendingSince: dateToDatabaseTimestamp (
subMinutes (new Date (), 2 * 60 + 1 ),
),
},
{
signedUpUserIds: others.map ((user) => user.id),
checkedInUserIds: [host, ...others].map ((user) => user.id),
},
);Act
Run routine “Lobbies”
await runRoutine (page, "Lobbies" );Lobbies page Act
Open the lobbies page
await lobbies.goto ();Open tab “ended”
await lobbies.openTab ("ended" );Assert
card “Test 8s” is visible
await expect (lobbies.card (LOBBY_NAME )).toBeVisible ();Source test ("a lobby waiting for players for 2 hours closes" , async ({
page,
factories,
}) => {
const [host, ...others] = await factories.UserFactory .createMany (
ROOM_SIZE - 1 ,
);
await factories.LobbyFactory .create (
{
hostUserId: host.id,
name: LOBBY_NAME ,
startsAt: dateToDatabaseTimestamp (subHours (new Date (), 3 )),
pendingSince: dateToDatabaseTimestamp (
subMinutes (new Date (), 2 * 60 + 1 ),
),
},
{
signedUpUserIds: others.map ((user) => user.id),
checkedInUserIds: [host, ...others].map ((user) => user.id),
},
);
await impersonate (page, host.id);
await runRoutine (page, "Lobbies" );
const lobbies = new LobbiesPage (page);
await lobbies.goto ();
await lobbies.openTab ("ended" );
await expect (lobbies.card (LOBBY_NAME )).toBeVisible ();
})a set without a map reported for 2 hours closes the lobby Lobby page Arrange
Started lobby → { lobby, alphaPlayer }
const { lobby, alphaPlayer } = await startedLobby (page, factories);Backdate sets lobby lobby.id subMinutes (new Date (), 2 * 60 + 1 )
await factories.LobbyFactory .backdateSets (
lobby.id,
subMinutes (new Date (), 2 * 60 + 1 ),
);Act
Run routine “Lobbies”
await runRoutine (page, "Lobbies" );Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Assert
ended status is visible
await expect (lobbyPage.locators.endedStatus).toBeVisible ();Source test ("a set without a map reported for 2 hours closes the lobby" , async ({
page,
factories,
}) => {
const { lobby, alphaPlayer } = await startedLobby (page, factories);
await factories.LobbyFactory .backdateSets (
lobby.id,
subMinutes (new Date (), 2 * 60 + 1 ),
);
await impersonate (page, alphaPlayer.id);
await runRoutine (page, "Lobbies" );
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await expect (lobbyPage.locators.endedStatus).toBeVisible ();
})a lobby everyone left before its start is deleted The host, the only one in it, leaves and lands on the lobby list The lobby is gone Arrange
Create user → host
const host = await factories.UserFactory .create ();Create lobby host user id host.id → lobby
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});1 The host, the only one in it, leaves and lands on the lobby list
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Leave
await lobbyPage.leave ();Assert
the page URL is lobbiesPage ()
await expect (page).toHaveURL (lobbiesPage ());2 The lobby is gone
Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Error page Assert
not found heading is visible
await expect (
new ErrorPage (page).locators.notFoundHeading,
).toBeVisible ();Source test ("a lobby everyone left before its start is deleted" , async ({
page,
factories,
}) => {
const host = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create ({
hostUserId: host.id,
});
const lobbyPage = new LobbyPage (page);
await test.step ("The host, the only one in it, leaves and lands on the lobby list" , async () => {
await impersonate (page, host.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.leave ();
await expect (page).toHaveURL (lobbiesPage ());
});
await test.step ("The lobby is gone" , async () => {
await lobbyPage.goto (lobby.id);
await expect (
new ErrorPage (page).locators.notFoundHeading,
).toBeVisible ();
});
})a started lobby everyone left ends Lobby page Arrange
Create user → host
const host = await factories.UserFactory .create ();Create lobby host user id host.id starts at dateToDatabaseTimestamp (subMinutes (new Date (), 1 )) checked in user ids host.id → lobby
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{ checkedInUserIds: [host.id] },
);Lobby page Act
Open the lobby page lobby.id
await lobbyPage.goto (lobby.id);Leave
await lobbyPage.leave ();Assert
ended status is visible
await expect (lobbyPage.locators.endedStatus).toBeVisible ();Source test ("a started lobby everyone left ends" , async ({ page, factories }) => {
const host = await factories.UserFactory .create ();
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{ checkedInUserIds: [host.id] },
);
await impersonate (page, host.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.leave ();
await expect (lobbyPage.locators.endedStatus).toBeVisible ();
})NewLobbyPage.gotoe2e/pages/lobbies/new-lobby-page.ts:25
async goto () {
await navigate ({ page: this .page, url: newLobbyPage () });
}newLobbySchema.nameapp/features/lobbies/lobbies-schemas.ts:135
No JSDoc
name: nameField newLobbySchema.descriptionapp/features/lobbies/lobbies-schemas.ts:136
No JSDoc
description: descriptionField NewLobbyPage.savee2e/pages/lobbies/new-lobby-page.ts:46
async save () {
await submit (this .page);
}LobbyPage.headinge2e/pages/lobbies/lobby-page.ts:159
heading (name: string ) {
return this .page.getByRole ("heading" , { name, exact: true });
}LobbyPage.locators.descriptione2e/pages/lobbies/lobby-page.ts:92
No JSDoc
page.getByTestId ("lobby-description" ) LobbyPage.locators.participantse2e/pages/lobbies/lobby-page.ts:51
No JSDoc
page.getByTestId ("lobby-participant" ) LobbyPage.gotoe2e/pages/lobbies/lobby-page.ts:114
async goto (lobbyId: number , tab?: Tab ) {
await navigate ({
page: this .page,
url: tab ? `${lobbyPage(lobbyId)}?tab=${tab}` : lobbyPage (lobbyId),
});
}LobbyPage.signUpe2e/pages/lobbies/lobby-page.ts:205
async signUp () {
await waitForPOSTResponse (this .page, () =>
this .locators.signUpButton.click (),
);
}LobbyPage.locators.viewerStatuse2e/pages/lobbies/lobby-page.ts:47
No JSDoc
page.getByTestId ("lobby-viewer-status" ) LobbyPage.locators.startBannere2e/pages/lobbies/lobby-page.ts:86
No JSDoc
page.getByTestId ("lobby-start-banner" ) LobbyPage.locators.checkInButtone2e/pages/lobbies/lobby-page.ts:44
No JSDoc
page.getByTestId ("lobby-check-in-button" ) isNotVisiblee2e/helpers/playwright.ts:779
No JSDoc
export function isNotVisible (locator: Locator ) {
return expect (locator).toHaveCount (0 );
}NewLobbyPagee2e/pages/lobbies/new-lobby-page.ts:8
LobbyPagee2e/pages/lobbies/lobby-page.ts:28
openNotificationse2e/lobbies.spec.ts:2638
async function openNotifications (page: Page ) {
await navigate ({ page, url: "/" });
const notifications = new NotificationPopover (page);
await notifications.open ();
return notifications;
}fullLobbye2e/lobbies.spec.ts:2392
async function fullLobby (
factories: Factories ,
{
waitlistedUserIds = [],
startsAt,
}: { waitlistedUserIds?: number []; startsAt?: number } = {},
) {
const [host, signedUp, ...others] =
await factories.UserFactory .createMany (ROOM_SIZE );
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
name: LOBBY_NAME ,
roomSize: ROOM_SIZE ,
// … runRoutinee2e/helpers/playwright.ts:497
export async function runRoutine (page: Page , name: string ) {
const response = await retryPost (page, "/run-routine" , {
form: { name },
});
if (!response?.ok ()) {
throw new Error (
`Running routine ${name} failed with status ${response?.status()}` ,
);
}
}LobbyPage.checkIne2e/pages/lobbies/lobby-page.ts:240
async checkIn () {
await waitForPOSTResponse (this .page, () =>
this .locators.checkInButton.click (),
);
}LobbyPage.locators.roomPoole2e/pages/lobbies/lobby-page.ts:90
No JSDoc
page.getByRole ("main" ).getByText ("Pool" , { exact: true }) LobbyPage.locators.roomPasse2e/pages/lobbies/lobby-page.ts:91
No JSDoc
page.getByTestId ("room-pass" ) LobbyPage.leavee2e/pages/lobbies/lobby-page.ts:254
async leave () {
await this .locators.leaveButton.click ();
await modalClickConfirmButton (this .page);
}LobbyPage.locators.signUpButtone2e/pages/lobbies/lobby-page.ts:37
No JSDoc
page.getByTestId ("lobby-sign-up-button" ) startingLobbye2e/lobbies.spec.ts:2424
async function startingLobby (factories: Factories ) {
const [host, ...others] = await factories.UserFactory .createMany (ROOM_SIZE );
const waitlisted = await factories.UserFactory .create ();
const lastToCheckIn = others.at (-1 )!;
const lobby = await factories.LobbyFactory .create (
{
hostUserId: host.id,
roomSize: ROOM_SIZE ,
startsAt: dateToDatabaseTimestamp (subMinutes (new Date (), 1 )),
},
{
signedUpUserIds: [...others, waitlisted].map ((user) => user.id),
checkedInUserIds: [host, ...others.slice (0 , -1 )].map ((user) => user.id),
},
// … LobbyPage.tabe2e/pages/lobbies/lobby-page.ts:164
tab (tab: Tab ) {
return this .page.getByRole ("tab" , { name: TAB_NAMES [tab] });
}LobbyPage.locators.friendCodeNeededTexte2e/pages/lobbies/lobby-page.ts:48
No JSDoc
page.getByText ("Set your friend code to sign up" ) NewLobbyPage.locators.friendCodeNeededTexte2e/pages/lobbies/new-lobby-page.ts:17
No JSDoc
page.getByText (
"Set your friend code to make a lobby." ,
) NewLobbyPage.locators.noPermissionsTexte2e/pages/lobbies/new-lobby-page.ts:20
No JSDoc
page.getByText ("No permissions to add lobbies." ) startedLobbye2e/lobbies.spec.ts:2448
async function startedLobby (
page: Page ,
factories: Factories ,
options: {
roomSize?: LobbyRoomSize ;
weaponRandomizer?: LobbyWeaponRandomizer ;
isPoolingEveryMap?: boolean ;
mapPool?: ModeWithStage [];
} = {},
) {
return startLobby (page, await lobbyAwaitingLastCheckIn (factories, options));
}LobbiesPage.gotoe2e/pages/lobbies/lobbies-page.ts:23
async goto () {
await navigate ({ page: this .page, url: lobbiesPage () });
}LobbiesPage.openTabe2e/pages/lobbies/lobbies-page.ts:28
async openTab (tab: "running" | "upcoming" | "ended" ) {
await this .page.getByTestId (`lobbies-${tab}-tab` ).click ();
}LobbiesPage.limitedVisibilityIcone2e/pages/lobbies/lobbies-page.ts:56
limitedVisibilityIcon (name: string ) {
return this .card (name).getByLabel ("Limited visibility" );
}LobbiesPage.carde2e/pages/lobbies/lobbies-page.ts:33
card (name: string ) {
return this .locators.cards.filter ({ hasText: name });
}ErrorPage.locators.notFoundHeadinge2e/pages/layout/error-page.ts:13
No JSDoc
page.getByRole ("heading" , {
name: "Error 404 - Page not found" ,
}) LobbiesPagee2e/pages/lobbies/lobbies-page.ts:10
ErrorPagee2e/pages/layout/error-page.ts:5
LobbyPage.copyShareLinkAsHoste2e/pages/lobbies/lobby-page.ts:150
async copyShareLinkAsHost (): Promise <string > {
await this .locators.inviteLinkButton.click ();
const link = await this .copyShareLink ();
await this .page.keyboard.press ("Escape" );
return link;
}LobbyPage.resetShareLinke2e/pages/lobbies/lobby-page.ts:135
async resetShareLink () {
await this .locators.inviteLinkButton.click ();
await waitForPOSTResponse (this .page, () =>
this .locators.resetShareLinkButton.click (),
);
await this .page.keyboard.press ("Escape" );
}LobbyPage.locators.shareLinkResetToaste2e/pages/lobbies/lobby-page.ts:70
No JSDoc
page.getByText (
"Invite link reset, the old one no longer works" ,
) LobbyPage.locators.copyShareLinkButtone2e/pages/lobbies/lobby-page.ts:68
No JSDoc
page.getByTestId ("lobby-copy-share-link-button" ) LobbyPage.gotoViaShareLinke2e/pages/lobbies/lobby-page.ts:122
async gotoViaShareLink (shareLink: string ) {
const url = new URL (shareLink);
await navigate ({ page: this .page, url: url.pathname + url.search });
}LobbyPage.changeVisibilitye2e/pages/lobbies/lobby-page.ts:128
async changeVisibility (label: string ) {
await this .openEditPage ();
await this .page.getByLabel ("Visibility" ).selectOption ({ label });
await this .saveEdit ();
}NewLobbyPage.selectVisibilitye2e/pages/lobbies/new-lobby-page.ts:30
async selectVisibility (label: string ) {
await this .page.getByLabel ("Visibility" ).selectOption ({ label });
}LobbyPage.locators.inviteOnlyHeadinge2e/pages/lobbies/lobby-page.ts:75
No JSDoc
page.getByRole ("heading" , { name: "Invite only" }) LobbyPage.copyShareLinke2e/pages/lobbies/lobby-page.ts:144
async copyShareLink (): Promise <string > {
await this .locators.copyShareLinkButton.click ();
return this .page.evaluate ("navigator.clipboard.readText()" );
}LobbiesPage.locators.selectedTabe2e/pages/lobbies/lobbies-page.ts:18
No JSDoc
page.getByRole ("tab" , { selected: true }) LobbiesPage.joine2e/pages/lobbies/lobbies-page.ts:38
async join (name: string ) {
await waitForPOSTResponse (this .page, () =>
this .card (name).getByTestId ("lobby-join-button" ).click (),
);
}LobbiesPage.leavee2e/pages/lobbies/lobbies-page.ts:45
async leave (name: string ) {
await this .card (name).getByTestId ("lobby-leave-button" ).click ();
await modalClickConfirmButton (this .page);
}LobbyPage.locators.mapVotersBadgee2e/pages/lobbies/lobby-page.ts:87
No JSDoc
page.getByTestId ("map-voters-badge" ) LobbyPage.locators.mapVotersHeadere2e/pages/lobbies/lobby-page.ts:88
No JSDoc
page.getByText ("Voted for this map" ) LobbyPage.locators.leaderboardRowse2e/pages/lobbies/lobby-page.ts:77
No JSDoc
page.getByTestId ("lobby-leaderboard-row" ) LobbyPage.locators.headToHeadViewChipe2e/pages/lobbies/lobby-page.ts:79
No JSDoc
page
.getByRole ("radiogroup" , { name: "Rankings view" })
.getByText ("Head-to-head" , { exact: true }) LobbyPage.reportOwnTeamSweepe2e/pages/lobbies/lobby-page.ts:274
async reportOwnTeamSweep (mapsToWin: number ) {
for (let i = 0 ; i < mapsToWin - 1 ; i++) {
await this .reportOwnTeamWin ();
}
await this .locators.winnerRadios.filter ({ hasText: "My team" }).click ();
await this .locators.reportScoreButton.click ();
await waitForPOSTResponse (this .page, () =>
this .locators.confirmSetEndButton.click (),
);
}LobbyPage.confirmSete2e/pages/lobbies/lobby-page.ts:330
async confirmSet () {
await waitForPOSTResponse (this .page, () =>
this .locators.confirmSetButton.click (),
);
}LobbyPage.locators.headToHeadRowse2e/pages/lobbies/lobby-page.ts:78
No JSDoc
page.getByTestId ("lobby-head-to-head-row" ) LobbyPage.openTabe2e/pages/lobbies/lobby-page.ts:187
async openTab (tab: Tab ) {
await this .page.getByRole ("tab" , { name: TAB_NAMES [tab] }).click ();
}LobbyPage.locators.tabPanele2e/pages/lobbies/lobby-page.ts:106
No JSDoc
page.getByRole ("main" ).getByRole ("tabpanel" ) LobbyPage.reportOwnTeamWine2e/pages/lobbies/lobby-page.ts:287
async reportOwnTeamWin () {
await this .locators.winnerRadios.filter ({ hasText: "My team" }).click ();
await waitForPOSTResponse (this .page, () =>
this .locators.reportScoreButton.click (),
);
await expect (this .locators.selectedWinner).toHaveCount (0 );
}LobbyPage.undoReporte2e/pages/lobbies/lobby-page.ts:350
async undoReport () {
await waitForPOSTResponse (this .page, () =>
this .locators.undoReportButton.click (),
);
}LobbyPage.reportWeapone2e/pages/lobbies/lobby-page.ts:316
async reportWeapon (name: string ) {
// already expanded when the viewer's preference says so, a click would collapse it
if (await this .locators.reportWeaponsButton.isVisible ()) {
await waitForPOSTResponse (this .page, () =>
this .locators.reportWeaponsButton.click (),
);
}
await selectWeapon ({ page: this .page, name });
await waitForPOSTResponse (this .page, () =>
this .locators.submitWeaponButton.click (),
);
}LobbyPage.weaponImagee2e/pages/lobbies/lobby-page.ts:182
weaponImage (name: string ) {
return this .page.getByRole ("img" , { name }).first ();
}LobbyPage.rankingsRowe2e/pages/lobbies/lobby-page.ts:296
rankingsRow (username: string ) {
return this .locators.leaderboardRows.filter ({ hasText: username });
}LobbyPage.disputeResulte2e/pages/lobbies/lobby-page.ts:343
async disputeResult () {
await waitForPOSTResponse (this .page, () =>
this .locators.disputeButton.click (),
);
}LobbyPage.locators.disputedTexte2e/pages/lobbies/lobby-page.ts:76
No JSDoc
page.getByText ("The result was disputed" ) LobbyPage.locators.reportScoreButtone2e/pages/lobbies/lobby-page.ts:54
No JSDoc
page.getByTestId ("report-score-button" ) LobbyPage.confirmSetAsHoste2e/pages/lobbies/lobby-page.ts:337
async confirmSetAsHost () {
await this .locators.hostConfirmSetButton.click ();
await modalClickConfirmButton (this .page);
}playSete2e/lobbies.spec.ts:2569
async function playSet (
page: Page ,
{
lobbyId,
alphaPlayer,
bravoPlayer,
}: { lobbyId: number ; alphaPlayer: Player ; bravoPlayer: Player },
) {
const lobbyPage = new LobbyPage (page);
await test.step ("Alpha sweeps the set and Bravo confirms it" , async () => {
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobbyId, "action" );
await lobbyPage.reportOwnTeamSweep (MAPS_TO_WIN );
// … rosterIdse2e/lobbies.spec.ts:2591
async function rosterIds (
lobbyPage: LobbyPage ,
side: "Alpha" | "Bravo" ,
players: Player [],
) {
const names = await lobbyPage.rosterUsernames (side);
return idsOf (
players.filter ((player) =>
names.some ((name) => name.includes (player.name)),
),
);
}LobbyPage.leaveMidSete2e/pages/lobbies/lobby-page.ts:260
async leaveMidSet () {
await this .page.getByTestId ("lobby-viewer-menu-button" ).click ();
await this .page.getByTestId ("lobby-leave-now-menu-item" ).click ();
await modalClickConfirmButton (this .page);
}LobbyPage.locators.readyChecke2e/pages/lobbies/lobby-page.ts:49
No JSDoc
page.getByTestId ("lobby-ready-check" ) LobbyPage.confirmReadye2e/pages/lobbies/lobby-page.ts:247
async confirmReady () {
await waitForPOSTResponse (this .page, () =>
this .locators.confirmReadyButton.click (),
);
}lobbyWithOpenSpote2e/lobbies.spec.ts:2550
async function lobbyWithOpenSpot (page: Page , factories: Factories ) {
const { lobby, alphaPlayer } = await startedLobby (page, factories);
const waitlist = await factories.UserFactory .createMany (3 );
const lobbyPage = new LobbyPage (page);
for (const user of waitlist) {
await impersonate (page, user.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.signUp ();
}
await impersonate (page, alphaPlayer.id);
await lobbyPage.goto (lobby.id);
await lobbyPage.leaveMidSet ();
// … LobbyPage.locators.waitingBannere2e/pages/lobbies/lobby-page.ts:85
No JSDoc
page.getByTestId ("lobby-waiting-banner" ) LobbyPage.locators.confirmReadyButtone2e/pages/lobbies/lobby-page.ts:50
No JSDoc
page.getByTestId ("lobby-confirm-ready-button" ) LobbyPage.locators.forfeitNotee2e/pages/lobbies/lobby-page.ts:84
No JSDoc
page.getByTestId ("lobby-forfeit-note" ) LobbyPage.locators.leftLobbyMarkerse2e/pages/lobbies/lobby-page.ts:103
No JSDoc
page.getByRole ("button" , { name: "Left the lobby" }) LobbyPage.leftLobbyMarkere2e/pages/lobbies/lobby-page.ts:309
leftLobbyMarker (username: string ) {
return this .rankingsRow (username).getByRole ("button" , {
name: "Left the lobby" ,
});
}LobbyPage.locators.leftLobbyPopovere2e/pages/lobbies/lobby-page.ts:104
No JSDoc
page.getByTestId ("lobby-left-popover" ) LobbyPage.endLobbye2e/pages/lobbies/lobby-page.ts:430
async endLobby () {
await this .locators.endLobbyButton.click ();
await modalClickConfirmButton (this .page);
}LobbyPage.locators.endedStatuse2e/pages/lobbies/lobby-page.ts:83
No JSDoc
page.getByText ("· Ended" ) LobbyPage.dropAfterSete2e/pages/lobbies/lobby-page.ts:267
async dropAfterSet () {
await waitForPOSTResponse (this .page, () =>
this .locators.dropAfterSetButton.click (),
);
}LobbyPage.locators.dropAfterSetButtone2e/pages/lobbies/lobby-page.ts:46
No JSDoc
page.getByTestId ("lobby-drop-after-set-button" ) LobbyPage.locators.leavingAfterSetMarkerse2e/pages/lobbies/lobby-page.ts:99
No JSDoc
page.getByRole ("button" , {
name: "Leaving after this set" ,
}) LobbyPage.leavingAfterSetMarkere2e/pages/lobbies/lobby-page.ts:174
leavingAfterSetMarker (username: string ) {
return this .locators.tabPanel
.getByRole ("listitem" )
.filter ({ hasText: username })
.getByRole ("button" , { name: "Leaving after this set" });
}LobbyPage.locators.leavingAfterSetPopovere2e/pages/lobbies/lobby-page.ts:102
No JSDoc
page.getByTestId ("roster-leaving-popover" ) ChatSidebar.selectRoomTabe2e/pages/layout/chat-sidebar.ts:59
async selectRoomTab (label: string ) {
await this .locators.roomTabs.filter ({ hasText: label }).click ();
}ChatSidebar.chate2e/pages/layout/chat-sidebar.ts:76
chat (nth = 0 ) {
return new ChatRoom (this .locators.openChats.nth (nth));
}ChatSidebare2e/pages/layout/chat-sidebar.ts:8
openSecondUsere2e/helpers/chat.ts:7
export async function openSecondUser (
browser: Browser ,
baseURL: string ,
userId = ADMIN_ID ,
) {
const context = await browser.newContext ({ baseURL });
// the `context` fixture blocks these for the test's own context only
await context.route (
/^https:\/\/fonts\.(googleapis|gstatic)\.com\//,
(route) => route.abort (),
);
const page = await context.newPage ();
await impersonate (page, userId);
// … LobbyPage.kicke2e/pages/lobbies/lobby-page.ts:357
async kick (userId: number ) {
await this .openPlayerMenu (userId);
await this .page.getByRole ("menuitem" , { name: "Kick" }).click ();
await modalClickConfirmButton (this .page);
}LobbyPage.sitOute2e/pages/lobbies/lobby-page.ts:380
async sitOut (userId: number ) {
await this .openPlayerMenu (userId);
await waitForPOSTResponse (this .page, () =>
this .page.getByRole ("menuitem" , { name: "Sit out" }).click (),
);
}LobbyPage.resumee2e/pages/lobbies/lobby-page.ts:388
async resume (userId: number ) {
await this .openPlayerMenu (userId);
await waitForPOSTResponse (this .page, () =>
this .page.getByRole ("menuitem" , { name: "Resume" }).click (),
);
}LobbyPage.changeBestOfe2e/pages/lobbies/lobby-page.ts:403
async changeBestOf (count: number ) {
await this .openEditPage ();
await this .page.getByText (`Bo${count}` , { exact: true }).click ();
await this .saveEdit ();
}LobbyPage.bestOfe2e/pages/lobbies/lobby-page.ts:169
bestOf (count: number ) {
return this .page.getByText (`Best of ${count}` , { exact: true });
}LobbyPage.makeHoste2e/pages/lobbies/lobby-page.ts:373
async makeHost (userId: number ) {
await this .openPlayerMenu (userId);
await this .page.getByRole ("menuitem" , { name: "Make host" }).click ();
await modalClickConfirmButton (this .page);
}LobbyPage.locators.endLobbyButtone2e/pages/lobbies/lobby-page.ts:82
No JSDoc
page.getByTestId ("lobby-end-button" ) LobbyPage.hostMarkere2e/pages/lobbies/lobby-page.ts:301
hostMarker (username: string ) {
return this .rankingsRow (username).getByRole ("button" , {
name: "Host" ,
exact: true ,
});
}newLobbySchema.isApplicationRequiredapp/features/lobbies/lobbies-schemas.ts:158
No JSDoc
isApplicationRequired: isApplicationRequiredField LobbyPage.locators.applicationRequirede2e/pages/lobbies/lobby-page.ts:43
No JSDoc
page.getByTestId ("lobby-application-required" ) LobbyPage.applye2e/pages/lobbies/lobby-page.ts:212
async apply () {
await waitForPOSTResponse (this .page, () =>
this .locators.applyButton.click (),
);
}LobbyPage.locators.applicationse2e/pages/lobbies/lobby-page.ts:42
No JSDoc
page.getByTestId ("lobby-application" ) LobbyPage.acceptApplicatione2e/pages/lobbies/lobby-page.ts:226
async acceptApplication (userId: number ) {
await waitForPOSTResponse (this .page, () =>
this .page.getByTestId (`lobby-accept-application-${userId}` ).click (),
);
}LobbyPage.declineApplicatione2e/pages/lobbies/lobby-page.ts:233
async declineApplication (userId: number ) {
await waitForPOSTResponse (this .page, () =>
this .page.getByTestId (`lobby-decline-application-${userId}` ).click (),
);
}LobbyPage.locators.applyButtone2e/pages/lobbies/lobby-page.ts:38
No JSDoc
page.getByTestId ("lobby-apply-button" ) LobbyPage.withdrawApplicatione2e/pages/lobbies/lobby-page.ts:219
async withdrawApplication () {
await waitForPOSTResponse (this .page, () =>
this .locators.withdrawApplicationButton.click (),
);
}NewLobbyPage.selectWeaponRandomizere2e/pages/lobbies/new-lobby-page.ts:35
async selectWeaponRandomizer (label: "Off" | "Chaotic" | "Balanced" ) {
await this .page.getByText (label, { exact: true }).click ();
}LobbyPage.locators.weaponRandomizere2e/pages/lobbies/lobby-page.ts:93
No JSDoc
page.getByTestId ("lobby-weapon-randomizer" ) LobbiesPage.weaponRandomizere2e/pages/lobbies/lobbies-page.ts:51
weaponRandomizer (name: string ) {
return this .card (name).getByTestId ("lobby-weapon-randomizer" );
}LobbyPage.renamee2e/pages/lobbies/lobby-page.ts:396
async rename (name: string ) {
await this .openEditPage ();
await this .editForm.fill ("name" , name);
await this .saveEdit ();
}LobbyPage.locators.rosterRolledWeaponse2e/pages/lobbies/lobby-page.ts:94
No JSDoc
page
.getByRole ("main" )
.getByRole ("tabpanel" )
.getByTestId ("lobby-rolled-weapons" )
.getByRole ("img" ) NewLobbyPage.selectTournamentMapse2e/pages/lobbies/new-lobby-page.ts:40
async selectTournamentMaps (tournamentName: string ) {
await this .form.select ("maps" , "TOURNAMENT" );
await selectTournament ({ page: this .page, query: tournamentName });
}LobbyPage.locators.mapPoolLinke2e/pages/lobbies/lobby-page.ts:66
No JSDoc
page.getByTestId ("lobby-map-pool-link" ) LobbyPage.changeMapPoole2e/pages/lobbies/lobby-page.ts:410
async changeMapPool (mapPool: MapPool ) {
await this .openEditPage ();
await this .selectMaps ("Custom..." );
await this .page
.getByRole ("button" , { name: "Paste from a map pool link" })
.click ();
await this .page
.getByLabel ("Map pool link" )
.fill (`https://sendou.ink${mapsPageWithMapPool(mapPool)}` );
await this .saveEdit ();
}LobbyPage.useRankedModese2e/pages/lobbies/lobby-page.ts:423
async useRankedModes () {
await this .openEditPage ();
await this .selectMaps ("Ranked modes only" );
await this .saveEdit ();
}LobbyPage.locators.currentMape2e/pages/lobbies/lobby-page.ts:67
No JSDoc
page.locator ('[data-testid^="banner-map-"]' ) ChatSidebar.locators.openChatse2e/pages/layout/chat-sidebar.ts:28
page.locator ("[class*='chatContainer']:visible" ) LobbyPage.locators.leftUserse2e/pages/lobbies/lobby-page.ts:52
No JSDoc
page.getByTestId ("lobby-left-user" ) lobbyChatRoomIdse2e/lobbies.spec.ts:2606
async function lobbyChatRoomIds (page: Page ) {
const loaderData = Object .values (
JSON .parse (await loaderDataJson (page)) as Record <string , unknown >,
);
const lobbyData = loaderData.find (
(
data,
): data is {
lobby: { chatRoomId: number };
teamChatRoomId: number | null ;
} => typeof data === "object" && data !== null && "teamChatRoomId" in data,
);
if (!lobbyData) throw new Error ("Not on a lobby page" );
// … LobbyPage.kickLeftUsere2e/pages/lobbies/lobby-page.ts:364
async kickLeftUser (userId: number ) {
await this .locators.leftUsers
.getByTestId (`lobby-player-menu-${userId}` )
.click ();
await this .page.getByRole ("menuitem" , { name: "Kick" }).click ();
await modalClickConfirmButton (this .page);
}ChatSidebar.locators.splitPanelse2e/pages/layout/chat-sidebar.ts:30
page.locator (
"[class*='splitView']:visible [role='tabpanel']" ,
) ChatSidebar.locators.roomTabse2e/pages/layout/chat-sidebar.ts:36
page.locator ("[class*='splitView']:visible" ).getByRole ("tab" ) ChatSidebar.backToRoomListe2e/pages/layout/chat-sidebar.ts:49
async backToRoomList () {
await this .locators.backButton.click ();
}ChatSidebar.locators.roomRowse2e/pages/layout/chat-sidebar.ts:21
No JSDoc
page.locator ("[class*='roomItem']:visible" ) lobbyAwaitingLastCheckIne2e/lobbies.spec.ts:2465
async function lobbyAwaitingLastCheckIn (
factories: Factories ,
{
roomSize = ROOM_SIZE ,
weaponRandomizer = "OFF" ,
isPoolingEveryMap = false ,
mapPool,
}: {
roomSize?: LobbyRoomSize ;
weaponRandomizer?: LobbyWeaponRandomizer ;
isPoolingEveryMap?: boolean ;
mapPool?: ModeWithStage [];
} = {},
) {
// … VoicePanel.joinVoicee2e/pages/layout/voice-panel.ts:42
async joinVoice (title: string | RegExp ) {
await this .open ();
await this .joinableRoom (title)
.getByRole ("button" , { name: "Join voice" })
.click ();
await expect (this .locators.callSection).toContainText ("Voice connected" );
}startLobbye2e/lobbies.spec.ts:2517
async function startLobby (
page: Page ,
{ lobby, players }: { lobby: { id: number }; players: Player [] },
) {
await impersonate (page, players.at (-1 )!.id);
const lobbyPage = new LobbyPage (page);
await lobbyPage.goto (lobby.id);
await lobbyPage.checkIn ();
const alphaIds = await rosterIds (lobbyPage, "Alpha" , players);
const bravoIds = await rosterIds (lobbyPage, "Bravo" , players);
const alphaPlayers = players.filter ((player) => alphaIds.includes (player.id));
const bravoPlayers = players.filter ((player) => bravoIds.includes (player.id));
// … VoicePanel.opene2e/pages/layout/voice-panel.ts:24
No JSDoc
async open () {
if (await this .locators.panel.isVisible ()) return ;
await this .locators.toggleButton.click ();
await expect (this .locators.panel).toBeVisible ();
}VoicePanel.locators.callSectione2e/pages/layout/voice-panel.ts:17
panel
.locator ("section" )
.filter ({ has: page.getByRole ("button" , { name: "Leave voice" }) }) VoicePanel.joinableRoome2e/pages/layout/voice-panel.ts:32
joinableRoom (title: string | RegExp ) {
return this .locators.panel.locator ("section" ).filter ({
hasText: title,
has: this .locators.panel.page ().getByRole ("button" , {
name: "Join voice" ,
}),
});
}teamChatRoomIde2e/lobbies.spec.ts:2626
No JSDoc
async function teamChatRoomId (page: Page ) {
const { teamRoomId } = await lobbyChatRoomIds (page);
if (teamRoomId === null ) throw new Error ("Not playing a set" );
return teamRoomId;
}VoicePanel.locators.leaveVoiceButtone2e/pages/layout/voice-panel.ts:20
No JSDoc
panel.getByRole ("button" , { name: "Leave voice" })