Skip to content

Commit 33dc524

Browse files
committed
test(org): keep the walk off the auth limiter and on its own chat
1 parent a4a4100 commit 33dc524

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎apps/sim/scripts/test-org-redesign-e2e.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ const routes: {
135135
}[] = []
136136
const firstPaints: FirstPaint[] = []
137137
const unexpected: Problem[] = []
138+
let clientAddress = 0
138139
let currentCheck = 'Setup'
139140
let currentSection = 'Setup'
140141
/** What the running check expects to fail; everything else is reported. */
@@ -285,7 +286,12 @@ interface OpenOptions {
285286

286287
async function open(persona: Persona | null, options: OpenOptions = {}): Promise<Session> {
287288
const viewport = options.viewport ?? DESKTOP
289+
clientAddress += 1
288290
const context = await browser.newContext({
291+
// Better Auth limits by address, and hundreds of loads from one would be nobody's real traffic.
292+
extraHTTPHeaders: {
293+
'x-forwarded-for': `10.0.${Math.floor(clientAddress / 250)}.${clientAddress % 250}`,
294+
},
289295
viewport: { width: viewport.width, height: viewport.height },
290296
colorScheme: options.theme ?? 'light',
291297
hasTouch: viewport === PHONE,
@@ -3136,7 +3142,7 @@ function routesFor(persona: Persona): { name: string; path: string }[] {
31363142
if (persona === ADMIN || persona === OWNER)
31373143
return [
31383144
...shared,
3139-
{ name: 'agent-chat', path: `chat/${ADMIN_CHATS.agent.id}` },
3145+
...(persona === ADMIN ? [{ name: 'agent-chat', path: `chat/${ADMIN_CHATS.agent.id}` }] : []),
31403146
...SETTINGS_FOR_ADMIN.map((section) => ({
31413147
name: `settings-${section}`,
31423148
path: `settings/${section}`,
@@ -3200,6 +3206,10 @@ async function walkOne(persona: Persona, viewport: Viewport, theme: Theme) {
32003206
for (const route of routesFor(persona)) {
32013207
const response = await page.goto(url(`${root}/${route.path}`), { timeout: 60_000 })
32023208
await session.settle()
3209+
if (route.name === 'home')
3210+
await composer(page)
3211+
.waitFor({ timeout: 20_000 })
3212+
.catch(() => failures.push('home never left its skeleton'))
32033213
const screenshot = `${persona.key}__${route.name}__${viewport.name}__${theme}.png`
32043214
const path = resolve(artifactDirectory, screenshot)
32053215
await fullPageScreenshot(page, path, viewport)

0 commit comments

Comments
 (0)