Files
windmill/frontend/e2e/global-setup.ts
T
hugocasaandClaude Opus 5.5 2b55a8afbc feat: replace the hub_sync script with an opt-in daily server sync (#11624)
* feat: sync hub resource types daily from the server

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: retire the legacy hub_sync script and its schedule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: sync only from the hub on the daily schedule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: sync resource types through the endpoint in e2e setup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: honor ACCEPT_INVALID_CERTS in the hub resource type sync

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: audit manual hub resource type syncs that change types

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: show the AI step's resource type sync as a setting card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep the hub_sync opt-out and move sync state to task state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: hold the daily hub sync until the legacy hub_sync is retired

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: turn off the daily sync when an edited hub_sync is scheduled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: make the daily hub resource type sync opt-in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: bring back the setup wizard's daily resource type sync toggle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: apply the image's resource types on every SYNC_CACHED_RT start

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:32:05 +02:00

63 lines
1.9 KiB
TypeScript

// global-setup.ts
import { chromium, FullConfig } from '@playwright/test'
async function globalSetup(config: FullConfig) {
process.env.TEST_UNIQUE_ID = Date.now().toString()
const browser = await chromium.launch()
const context = await browser.newContext({
permissions: ['clipboard-read', 'clipboard-write']
})
const page = await context.newPage()
// Use baseURL from config
const baseURL = config.projects[0].use.baseURL || 'http://localhost:3000'
await page.goto(baseURL)
// Wait for and fill the email input
const emailInput = page.locator('input#email[type="email"]')
await emailInput.waitFor({ state: 'visible' })
await emailInput.fill('admin@windmill.dev')
// Wait for and fill the password input
const passwordInput = page.locator('input#password[type="password"]')
await passwordInput.waitFor({ state: 'visible' })
await passwordInput.fill('changeme')
// Click the sign-in button
const signInButton = page.locator('button:has-text("Sign in")')
await signInButton.click()
// Handle potential first-time user flow
await page.waitForURL(/\/user\/(first-time|workspaces)/)
if (page.url().includes('/user/first-time')) {
const skipButton = page.locator('button:has-text("Skip")')
await skipButton.click()
}
// Wait for navigation to workspaces page
await page.waitForURL('**/user/workspaces')
// Click on the "Admins" workspace
const adminsWorkspace = page.locator('text=Admins').first()
await adminsWorkspace.waitFor({ state: 'visible' })
await adminsWorkspace.click()
// Wait for workspace to load
await page.waitForURL('**/')
if (!process.env.SKIP_HUB_SYNC) {
const res = await page.request.post(`${baseURL}/api/settings/sync_cached_resource_types`)
if (!res.ok()) {
throw new Error(`Resource type sync failed: ${await res.text()}`)
}
}
// Save the authenticated state
await context.storageState({ path: './e2e/auth.json' })
await browser.close()
}
export default globalSetup
declare const process: any // ignore TS errors