Weapon parameters
table filtering, comparison bar graph and history rows (via Analyzer)
Renders/analyzer/params/:slug
Analyzer page Act
Open the analyzer page
await analyzer.goto();
Pick weapon “Splattershot”
await analyzer.pickWeapon("Splattershot");Open raw parameters “splattershot” → weaponParams
const weaponParams = await analyzer.openRawParameters("splattershot");
Assert
the page URL is /\/params\/splattershot/
await expect(page).toHaveURL(/\/params\/splattershot/);
Arrange
a sibling column has to render after the client-side navigation first, or the count is taken mid-hydration
{ weaponHeaders, showAllWeaponsButton } = locators
const { weaponHeaders, showAllWeaponsButton } = weaponParams.locators;
Assert
weaponHeaders.nth(1) is visible
await expect(weaponHeaders.nth(1)).toBeVisible();
Act
Count → initialColumnCount
const initialColumnCount = await weaponHeaders.count();
Assert
initialColumnCount is more than 1
expect(initialColumnCount).toBeGreaterThan(1);
Weapon params page Act
Hide weapon
await weaponParams.hideWeapon();
Assert
showAllWeaponsButton is visible
await expect(showAllWeaponsButton).toBeVisible();
weaponHeaders count is initialColumnCount - 1
await expect(weaponHeaders).toHaveCount(initialColumnCount - 1);
the page URL is /hidden=\d/
await expect(page).toHaveURL(/hidden=\d/);
Act
Reload
await weaponParams.reload();
Assert
the page URL is /hidden=\d/
await expect(page).toHaveURL(/hidden=\d/);
showAllWeaponsButton is visible
await expect(showAllWeaponsButton).toBeVisible();
weaponHeaders count is initialColumnCount - 1
await expect(weaponHeaders).toHaveCount(initialColumnCount - 1);
Act
Show all weapons
await weaponParams.showAllWeapons();
Assert
showAllWeaponsButton is not visible
await expect(showAllWeaponsButton).not.toBeVisible();
weaponHeaders count is initialColumnCount
await expect(weaponHeaders).toHaveCount(initialColumnCount);
the page URL is not /hidden=\d/
await expect(page).not.toHaveURL(/hidden=\d/);
Act
Open param comparison
await weaponParams.openParamComparison();
Assert
comparison dialog is visible
await expect(weaponParams.locators.comparisonDialog).toBeVisible();
count be greater than or equal 2
expect(
await weaponParams.locators.comparisonBars.count(),
).toBeGreaterThanOrEqual(2);
Act
Close param comparison
await weaponParams.closeParamComparison();
Assert
comparison dialog is not visible
await expect(weaponParams.locators.comparisonDialog).not.toBeVisible();
Act
the patch-count badge shows only while the row is collapsed, signalling the toggle state
History row 0 → historyRow
const historyRow = weaponParams.historyRow(0);
Param history row Assert
root is visible
await expect(historyRow.root).toBeVisible();
history badge is visible
await expect(historyRow.historyBadge).toBeVisible();
Act
Toggle
await historyRow.toggle();
Assert
history badge is not visible
await expect(historyRow.historyBadge).not.toBeVisible();
Act
Toggle
await historyRow.toggle();
Assert
history badge is visible
await expect(historyRow.historyBadge).toBeVisible();
Source
test("table filtering, comparison bar graph and history rows (via Analyzer)", async ({
page,
}) => {
const analyzer = new AnalyzerPage(page);
await analyzer.goto();
await analyzer.pickWeapon("Splattershot");
const weaponParams = await analyzer.openRawParameters("splattershot");
await expect(page).toHaveURL(/\/params\/splattershot/);
// a sibling column has to render after the client-side navigation first, or the count is taken mid-hydration
const { weaponHeaders, showAllWeaponsButton } = weaponParams.locators;
await expect(weaponHeaders.nth(1)).toBeVisible();
const initialColumnCount = await weaponHeaders.count();
expect(initialColumnCount).toBeGreaterThan(1);
await weaponParams.hideWeapon();
await expect(showAllWeaponsButton).toBeVisible();
await expect(weaponHeaders).toHaveCount(initialColumnCount - 1);
await expect(page).toHaveURL(/hidden=\d/);
await weaponParams.reload();
await expect(page).toHaveURL(/hidden=\d/);
await expect(showAllWeaponsButton).toBeVisible();
await expect(weaponHeaders).toHaveCount(initialColumnCount - 1);
await weaponParams.showAllWeapons();
await expect(showAllWeaponsButton).not.toBeVisible();
await expect(weaponHeaders).toHaveCount(initialColumnCount);
await expect(page).not.toHaveURL(/hidden=\d/);
await weaponParams.openParamComparison();
await expect(weaponParams.locators.comparisonDialog).toBeVisible();
expect(
await weaponParams.locators.comparisonBars.count(),
).toBeGreaterThanOrEqual(2);
await weaponParams.closeParamComparison();
await expect(weaponParams.locators.comparisonDialog).not.toBeVisible();
// the patch-count badge shows only while the row is collapsed, signalling the toggle state
const historyRow = weaponParams.historyRow(0);
await expect(historyRow.root).toBeVisible();
await expect(historyRow.historyBadge).toBeVisible();
await historyRow.toggle();
await expect(historyRow.historyBadge).not.toBeVisible();
await historyRow.toggle();
await expect(historyRow.historyBadge).toBeVisible();
})patch history tab persists across refresh (via weapon search)
Renders//params/:slug
Act
Go to “/”
await navigate({ page, url: "/" });
Global search dialog Act
Open
await search.open();
Search “splattershot”
await search.search("splattershot");Select option “Splattershot”
await search.selectOption("Splattershot");Select option “Parameters”
await search.selectOption("Parameters");
Assert
the page URL is /\/params\/splattershot/
await expect(page).toHaveURL(/\/params\/splattershot/);
Act
{ patchHistoryTab, subAndSpecialChangesSwitch } = locators
const { patchHistoryTab, subAndSpecialChangesSwitch } =
weaponParams.locators;
Weapon params page Act
Open patch history tab
await weaponParams.openPatchHistoryTab();
Assert
the page URL is /tab=patches/
await expect(page).toHaveURL(/tab=patches/);
Act
Reload
await weaponParams.reload();
Assert
the page URL is /tab=patches/
await expect(page).toHaveURL(/tab=patches/);
patchHistoryTab has “aria-selected” = “true”
await expect(patchHistoryTab).toHaveAttribute("aria-selected", "true");Either patch columns are shown or the empty state
first patch columns is visible
await expect(weaponParams.locators.patchColumns.first()).toBeVisible();
subAndSpecialChangesSwitch is checked
await expect(subAndSpecialChangesSwitch).toBeChecked();
Act
Toggle sub and special changes
await weaponParams.toggleSubAndSpecialChanges();
Assert
the page URL is /kitExtras=false/
await expect(page).toHaveURL(/kitExtras=false/);
Act
Reload
await weaponParams.reload();
Assert
the page URL is /kitExtras=false/
await expect(page).toHaveURL(/kitExtras=false/);
subAndSpecialChangesSwitch is not checked
await expect(subAndSpecialChangesSwitch).not.toBeChecked();
Source
test("patch history tab persists across refresh (via weapon search)", async ({
page,
}) => {
await impersonate(page, NZAP_TEST_ID);
await navigate({ page, url: "/" });
const search = new GlobalSearchDialog(page);
await search.open();
await search.search("splattershot");
await search.selectOption("Splattershot");
await search.selectOption("Parameters");
await expect(page).toHaveURL(/\/params\/splattershot/);
const weaponParams = new WeaponParamsPage(page);
const { patchHistoryTab, subAndSpecialChangesSwitch } =
weaponParams.locators;
await weaponParams.openPatchHistoryTab();
await expect(page).toHaveURL(/tab=patches/);
await weaponParams.reload();
await expect(page).toHaveURL(/tab=patches/);
await expect(patchHistoryTab).toHaveAttribute("aria-selected", "true");
// Either patch columns are shown or the empty state
await expect(weaponParams.locators.patchColumns.first()).toBeVisible();
await expect(subAndSpecialChangesSwitch).toBeChecked();
await weaponParams.toggleSubAndSpecialChanges();
await expect(page).toHaveURL(/kitExtras=false/);
await weaponParams.reload();
await expect(page).toHaveURL(/kitExtras=false/);
await expect(subAndSpecialChangesSwitch).not.toBeChecked();
})AnalyzerPage.gotoe2e/pages/analyzer/analyzer-page.ts:27
No JSDoc
async goto() {
await navigate({ page: this.page, url: ANALYZER_URL });
}AnalyzerPage.pickWeapone2e/pages/analyzer/analyzer-page.ts:49
async pickWeapon(name: string) {
const { weaponLanding } = this.locators;
await weaponLanding.getByRole("searchbox").fill(name);
await weaponLanding.getByText(name, { exact: true }).click();
}AnalyzerPage.openRawParameterse2e/pages/analyzer/analyzer-page.ts:82
async openRawParameters(weaponSlug: string) {
await expect(this.locators.rawParametersLink).toHaveAttribute(
"href",
new RegExp(weaponParamsPage(weaponSlug)),
);
await this.locators.rawParametersLink.click();
return new WeaponParamsPage(this.page);
}WeaponParamsPage.hideWeapone2e/pages/analyzer/weapon-params-page.ts:43
No JSDoc
async hideWeapon(nth = 0) {
await this.locators.hideWeaponButtons.nth(nth).click();
}WeaponParamsPage.reloade2e/pages/analyzer/weapon-params-page.ts:34
async reload() {
await this.page.reload();
await expectIsHydrated(this.page);
}WeaponParamsPage.showAllWeaponse2e/pages/analyzer/weapon-params-page.ts:47
No JSDoc
async showAllWeapons() {
await this.locators.showAllWeaponsButton.click();
}WeaponParamsPage.openParamComparisone2e/pages/analyzer/weapon-params-page.ts:51
No JSDoc
async openParamComparison(nth = 0) {
await this.locators.compareParamButtons.nth(nth).click();
}WeaponParamsPage.locators.comparisonDialoge2e/pages/analyzer/weapon-params-page.ts:16
No JSDoc
page.getByRole("dialog")WeaponParamsPage.locators.comparisonBarse2e/pages/analyzer/weapon-params-page.ts:17
No JSDoc
page
.getByRole("dialog")
.locator("[class*='bars'] [class*='row']")WeaponParamsPage.closeParamComparisone2e/pages/analyzer/weapon-params-page.ts:55
No JSDoc
async closeParamComparison() {
await this.page.keyboard.press("Escape");
}WeaponParamsPage.historyRowe2e/pages/analyzer/weapon-params-page.ts:39
No JSDoc
historyRow(nth: number) {
return new ParamHistoryRow(this.locators.expandableRows.nth(nth));
}ParamHistoryRow.historyBadgee2e/pages/analyzer/weapon-params-page.ts:76
get historyBadge() {
return this.root.locator("[class*='historyBadge']").first();
}ParamHistoryRow.togglee2e/pages/analyzer/weapon-params-page.ts:80
No JSDoc
async toggle() {
await this.root.locator("td[class*='paramName']").click();
}AnalyzerPagee2e/pages/analyzer/analyzer-page.ts:10
No JSDoc
WeaponParamsPagee2e/pages/analyzer/weapon-params-page.ts:5
No JSDoc
ParamHistoryRowe2e/pages/analyzer/weapon-params-page.ts:68
No JSDoc
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.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 });
}WeaponParamsPage.openPatchHistoryTabe2e/pages/analyzer/weapon-params-page.ts:59
No JSDoc
async openPatchHistoryTab() {
await this.locators.patchHistoryTab.click();
}WeaponParamsPage.locators.patchColumnse2e/pages/analyzer/weapon-params-page.ts:22
No JSDoc
page.locator("[class*='column']")WeaponParamsPage.toggleSubAndSpecialChangese2e/pages/analyzer/weapon-params-page.ts:63
No JSDoc
async toggleSubAndSpecialChanges() {
await this.locators.subAndSpecialChangesSwitch.click({ force: true });
}GlobalSearchDialoge2e/pages/search/global-search-dialog.ts:11
No JSDoc