railyard/apps/ritgram/web/e2e/pages/account-settings.page.ts
caelum0x f80b04ae0f feat(ritgram): move GitGram app into railyard as Ritgram, next to Rithub
Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram).
AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan.
Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:18:46 +03:00

52 lines
1.2 KiB
TypeScript

import { type Locator, type Page, expect } from '@playwright/test'
/**
* Page Object for the account settings page (/settings/account).
*
* Allows editing username, bio, and notification preferences.
*/
export class AccountSettingsPage {
readonly page: Page
// Form fields
readonly usernameInput: Locator
readonly bioTextarea: Locator
// Save button
readonly saveButton: Locator
// GitHub connection
readonly connectGithubButton: Locator
constructor(page: Page) {
this.page = page
this.usernameInput = page.getByLabel(/username/i).first()
this.bioTextarea = page.getByLabel(/bio/i).first()
this.saveButton = page
.getByRole('button', { name: /save/i })
.first()
this.connectGithubButton = page
.getByRole('button', { name: /connect.*github/i })
.first()
}
async goto() {
await this.page.goto('/settings/account')
}
async updateProfile(fields: { username?: string; bio?: string }) {
if (fields.username !== undefined) {
await this.usernameInput.clear()
await this.usernameInput.fill(fields.username)
}
if (fields.bio !== undefined) {
await this.bioTextarea.clear()
await this.bioTextarea.fill(fields.bio)
}
await this.saveButton.click()
}
}