User card edits banner and bio from the looking page Renders/q/looking /user-card/edit
SendouQ looking page Arrange
Create SQ group member user ids Sendou
await factories.SQGroupFactory .create ({ memberUserIds: [ADMIN_ID ] });SendouQ looking page Act
Open the SendouQ looking page
await looking.goto ();Open member card “Sendou” → card
const card = await looking.ownGroupCard.openMemberCard ("Sendou" );Open edit page → cardEdit
const cardEdit = await card.openEditPage ();Assert
the page URL is /\/user-card\/edit/
await expect (page).toHaveURL (/\/user-card\/edit/);Act
newBio = "New bio from e2e test"
const newBio = "New bio from e2e test" ;Fill short bio with newBio
await cardEdit.form.fill ("shortBio" , newBio);Select “COLOR” for banner type
await cardEdit.form.select ("bannerType" , "COLOR" );Select banner color “#4169e1”
await cardEdit.selectBannerColor ("#4169e1" );Save
await cardEdit.save ();Assert
the page URL is SENDOUQ_LOOKING_PAGE
await expect (page).toHaveURL (SENDOUQ_LOOKING_PAGE );Act
Open member card “Sendou”
await looking.ownGroupCard.openMemberCard ("Sendou" );Assert
card.bio (newBio) is visible
await expect (card.bio (newBio)).toBeVisible ();card.locators.banner have CSS “background-color” , “rgb(65, 105, 225)”
await expect (card.locators.banner).toHaveCSS (
"background-color" ,
"rgb(65, 105, 225)" ,
);Source test ("edits banner and bio from the looking page" , async ({
page,
factories,
}) => {
await factories.SQGroupFactory .create ({ memberUserIds: [ADMIN_ID ] });
await impersonate (page);
const looking = new SendouQLookingPage (page);
await looking.goto ();
const card = await looking.ownGroupCard.openMemberCard ("Sendou" );
const cardEdit = await card.openEditPage ();
await expect (page).toHaveURL (/\/user-card\/edit/);
const newBio = "New bio from e2e test" ;
await cardEdit.form.fill ("shortBio" , newBio);
await cardEdit.form.select ("bannerType" , "COLOR" );
await cardEdit.selectBannerColor ("#4169e1" );
await cardEdit.save ();
await expect (page).toHaveURL (SENDOUQ_LOOKING_PAGE );
await looking.ownGroupCard.openMemberCard ("Sendou" );
await expect (card.bio (newBio)).toBeVisible ();
await expect (card.locators.banner).toHaveCSS (
"background-color" ,
"rgb(65, 105, 225)" ,
);
})shows the verified peak XP of the selected division Renders/q/looking /user-card/edit
SendouQ looking page Arrange
Create SQ group member user ids Sendou
await factories.SQGroupFactory .create ({ memberUserIds: [ADMIN_ID ] });Create X rank placement player Sendou power 3010 region “WEST”
await factories.XRankPlacementFactory .create ({
playerUserId: ADMIN_ID ,
power: 3010 ,
region: "WEST" ,
});Create X rank placement player Sendou power 3000 region “JPN” refresh peak xp true
await factories.XRankPlacementFactory .create (
{ playerUserId: ADMIN_ID , power: 3000 , region: "JPN" },
{ refreshPeakXp: true },
);SendouQ looking page Act
Open the SendouQ looking page
await looking.goto ();Open member card “Sendou” → card
const card = await looking.ownGroupCard.openMemberCard ("Sendou" );Assert
card.xp (3010 ) is visible
await expect (card.xp (3010 )).toBeVisible ();Act
Open edit page → cardEdit
const cardEdit = await card.openEditPage ();Select “JPN” for xp division
await cardEdit.form.select ("xpDivision" , "JPN" );Save
await cardEdit.save ();Assert
the page URL is SENDOUQ_LOOKING_PAGE
await expect (page).toHaveURL (SENDOUQ_LOOKING_PAGE );Act
Open member card “Sendou”
await looking.ownGroupCard.openMemberCard ("Sendou" );Assert
card.xp (3000 ) is visible
await expect (card.xp (3000 )).toBeVisible ();card.xp (3010 ) is not visible
await expect (card.xp (3010 )).not.toBeVisible ();Source test ("shows the verified peak XP of the selected division" , async ({
page,
factories,
}) => {
await factories.SQGroupFactory .create ({ memberUserIds: [ADMIN_ID ] });
await factories.XRankPlacementFactory .create ({
playerUserId: ADMIN_ID ,
power: 3010 ,
region: "WEST" ,
});
await factories.XRankPlacementFactory .create (
{ playerUserId: ADMIN_ID , power: 3000 , region: "JPN" },
{ refreshPeakXp: true },
);
await impersonate (page);
const looking = new SendouQLookingPage (page);
await looking.goto ();
const card = await looking.ownGroupCard.openMemberCard ("Sendou" );
await expect (card.xp (3010 )).toBeVisible ();
const cardEdit = await card.openEditPage ();
await cardEdit.form.select ("xpDivision" , "JPN" );
await cardEdit.save ();
await expect (page).toHaveURL (SENDOUQ_LOOKING_PAGE );
await looking.ownGroupCard.openMemberCard ("Sendou" );
await expect (card.xp (3000 )).toBeVisible ();
await expect (card.xp (3010 )).not.toBeVisible ();
})User card friend request Renders/friends /lfg
Friends page LFG page Friends page Arrange
Create LFG post author N-ZAP
await factories.LFGPostFactory .create ({ authorId: NZAP_TEST_ID });Friends page Act
Open the friends page
await friends.goto ();Send request “Sendou”
await friends.sendRequest ("Sendou" );Assert
cancel request button is visible
await expect (friends.locators.cancelRequestButton).toBeVisible ();LFG page Act
Open the LFG page
await lfg.goto ();Open user card “N-ZAP” → card
const card = await lfg.openUserCard ("N-ZAP" );Assert
card.locators.acceptFriendRequestButton is visible
await expect (card.locators.acceptFriendRequestButton).toBeVisible ();card.locators.pendingFriendRequestButton is not visible
await expect (card.locators.pendingFriendRequestButton).not.toBeVisible ();Act
Accept friend request
await card.acceptFriendRequest ();Assert
card.locators.friendRequestAcceptedToast is in the page
await expect (card.locators.friendRequestAcceptedToast).toBeAttached ();card.locators.acceptFriendRequestButton is not visible
await expect (card.locators.acceptFriendRequestButton).not.toBeVisible ();card.locators.sendFriendRequestButton is not visible
await expect (card.locators.sendFriendRequestButton).not.toBeVisible ();Friends page Act
Open the friends page
await friends.goto ();Assert
first friend button “N-ZAP” is visible
await expect (friends.friendButton ("N-ZAP" ).first ()).toBeVisible ();Source test ("receiver sees add friend button that accepts the incoming request" , async ({
page,
factories,
}) => {
await factories.LFGPostFactory .create ({ authorId: NZAP_TEST_ID });
await impersonate (page, NZAP_TEST_ID );
const friends = new FriendsPage (page);
await friends.goto ();
await friends.sendRequest ("Sendou" );
await expect (friends.locators.cancelRequestButton).toBeVisible ();
await impersonate (page);
const lfg = new LFGPage (page);
await lfg.goto ();
const card = await lfg.openUserCard ("N-ZAP" );
await expect (card.locators.acceptFriendRequestButton).toBeVisible ();
await expect (card.locators.pendingFriendRequestButton).not.toBeVisible ();
await card.acceptFriendRequest ();
await expect (card.locators.friendRequestAcceptedToast).toBeAttached ();
await expect (card.locators.acceptFriendRequestButton).not.toBeVisible ();
await expect (card.locators.sendFriendRequestButton).not.toBeVisible ();
await friends.goto ();
await expect (friends.friendButton ("N-ZAP" ).first ()).toBeVisible ();
})sender still sees pending state on the receiver's card Renders/friends /lfg
Friends page LFG page Arrange
Create LFG post author N-ZAP
await factories.LFGPostFactory .create ({ authorId: NZAP_TEST_ID });Friends page Act
Open the friends page
await friends.goto ();Send request “N-ZAP”
await friends.sendRequest ("N-ZAP" );Assert
cancel request button is visible
await expect (friends.locators.cancelRequestButton).toBeVisible ();LFG page Act
Open the LFG page
await lfg.goto ();Open user card “N-ZAP” → card
const card = await lfg.openUserCard ("N-ZAP" );Assert
card.locators.pendingFriendRequestButton is visible
await expect (card.locators.pendingFriendRequestButton).toBeVisible ();card.locators.pendingFriendRequestButton is disabled
await expect (card.locators.pendingFriendRequestButton).toBeDisabled ();card.locators.acceptFriendRequestButton is not visible
await expect (card.locators.acceptFriendRequestButton).not.toBeVisible ();Source test ("sender still sees pending state on the receiver's card" , async ({
page,
factories,
}) => {
await factories.LFGPostFactory .create ({ authorId: NZAP_TEST_ID });
await impersonate (page);
const friends = new FriendsPage (page);
await friends.goto ();
await friends.sendRequest ("N-ZAP" );
await expect (friends.locators.cancelRequestButton).toBeVisible ();
const lfg = new LFGPage (page);
await lfg.goto ();
const card = await lfg.openUserCard ("N-ZAP" );
await expect (card.locators.pendingFriendRequestButton).toBeVisible ();
await expect (card.locators.pendingFriendRequestButton).toBeDisabled ();
await expect (card.locators.acceptFriendRequestButton).not.toBeVisible ();
})sending a request does not mark another user's card pending after navigating between user pages Renders/u/:identifier /u/:identifier
User page Global search dialog User page Arrange
otherUsername = "FriendTarget"
const otherUsername = "FriendTarget" ;Create user discord name otherUsername
await factories.UserFactory .create ({ discordName: otherUsername });User page Act
Open the user page N-ZAP
await userPage.goto (NZAP_TEST_ID );Open user card “N-ZAP” → nzapCard
const nzapCard = await userPage.openUserCard ("N-ZAP" );Send friend request
await nzapCard.sendFriendRequest ();Assert
nzapCard.locators.pendingFriendRequestButton is visible
await expect (nzapCard.locators.pendingFriendRequestButton).toBeVisible ();Act
Close
await nzapCard.close ();Global search dialog Act
Open
await search.open ();Select type “users”
await search.selectType ("users" );Search otherUsername
await search.search (otherUsername);Select option otherUsername
await search.selectOption (otherUsername);User page Assert
username heading otherUsername is visible
await expect (userPage.usernameHeading (otherUsername)).toBeVisible ();Act
Open user card otherUsername → otherCard
const otherCard = await userPage.openUserCard (otherUsername);Assert
otherCard.locators.sendFriendRequestButton is visible
await expect (otherCard.locators.sendFriendRequestButton).toBeVisible ();otherCard.locators.pendingFriendRequestButton is not visible
await expect (
otherCard.locators.pendingFriendRequestButton,
).not.toBeVisible ();Source test ("sending a request does not mark another user's card pending after navigating between user pages" , async ({
page,
factories,
}) => {
const otherUsername = "FriendTarget" ;
await factories.UserFactory .create ({ discordName: otherUsername });
await impersonate (page);
const userPage = new UserPage (page);
await userPage.goto (NZAP_TEST_ID );
const nzapCard = await userPage.openUserCard ("N-ZAP" );
await nzapCard.sendFriendRequest ();
await expect (nzapCard.locators.pendingFriendRequestButton).toBeVisible ();
await nzapCard.close ();
const search = new GlobalSearchDialog (page);
await search.open ();
await search.selectType ("users" );
await search.search (otherUsername);
await search.selectOption (otherUsername);
await expect (userPage.usernameHeading (otherUsername)).toBeVisible ();
const otherCard = await userPage.openUserCard (otherUsername);
await expect (otherCard.locators.sendFriendRequestButton).toBeVisible ();
await expect (
otherCard.locators.pendingFriendRequestButton,
).not.toBeVisible ();
})SendouQLookingPage.gotoe2e/pages/sendouq/sendouq-looking-page.ts:31
No JSDoc
async goto () {
await navigate ({ page: this .page, url: SENDOUQ_LOOKING_PAGE });
}SendouQLookingPagee2e/pages/sendouq/sendouq-looking-page.ts:13
No JSDoc
FriendsPage.gotoe2e/pages/friends/friends-page.ts:35
No JSDoc
async goto () {
await navigate ({ page: this .page, url: FRIENDS_PAGE });
}FriendsPage.sendRequeste2e/pages/friends/friends-page.ts:39
No JSDoc
async sendRequest (userName: string ) {
await selectUser ({
page: this .page,
userName,
labelName: this .form.getLabel ("userId" ),
});
await submit (this .page);
}FriendsPage.locators.cancelRequestButtone2e/pages/friends/friends-page.ts:23
No JSDoc
this .page.getByRole ("button" , { name: "Cancel" })LFGPage.gotoe2e/pages/lfg/lfg-page.ts:23
No JSDoc
async goto () {
await navigate ({ page: this .page, url: LFG_PAGE });
}LFGPage.openUserCarde2e/pages/lfg/lfg-page.ts:36
No JSDoc
openUserCard (name: string ) {
return UserCard .open (
this .page,
this .page.getByRole ("button" , { name }).first (),
);
}FriendsPage.friendButtone2e/pages/friends/friends-page.ts:56
friendButton (name: string ) {
return this .page
.getByRole ("main" )
.getByRole ("button" , { name, exact: true });
}FriendsPagee2e/pages/friends/friends-page.ts:13
LFGPagee2e/pages/lfg/lfg-page.ts:8
No JSDoc
UserPage.gotoe2e/pages/user/user-page.ts:35
No JSDoc
async goto (userId: number ) {
await navigate ({ page: this .page, url: userPage ({ id: userId }) });
}UserPage.openUserCarde2e/pages/user/user-page.ts:99
openUserCard (username: string ) {
return UserCard .open (
this .page,
this .usernameHeading (username).getByRole ("button" ),
);
}GlobalSearchDialog.opene2e/pages/search/global-search-dialog.ts:29
No JSDoc
async open () {
await this .locators.openButton.click ();
await this .locators.dialog.waitFor ({ state: "visible" });
}GlobalSearchDialog.selectTypee2e/pages/search/global-search-dialog.ts:48
async selectType (type : keyof typeof TYPE_LABELS ) {
await this .locators.dialog.getByText (TYPE_LABELS [type ]).click ();
}GlobalSearchDialog.searche2e/pages/search/global-search-dialog.ts:52
No JSDoc
async search (query: string ) {
await this .locators.input.fill (query);
}GlobalSearchDialog.selectOptione2e/pages/search/global-search-dialog.ts:61
No JSDoc
async selectOption (name: string ) {
const option = this .option (name);
await option.waitFor ({ state: "visible" });
await option.click ({ force: true });
}UserPage.usernameHeadinge2e/pages/user/user-page.ts:94
No JSDoc
usernameHeading (username: string ) {
return this .page.getByRole ("heading" , { name: username });
}UserPagee2e/pages/user/user-page.ts:12
No JSDoc
GlobalSearchDialoge2e/pages/search/global-search-dialog.ts:11
No JSDoc