set license key

This commit is contained in:
Diego Imbert
2026-01-07 11:31:27 +01:00
parent 30b7eff282
commit 86d5db2c48
+22
View File
@@ -43,6 +43,28 @@ async function globalSetup(config: FullConfig) {
await page.waitForURL('**/')
await page.locator('text=Home').first().waitFor({ state: 'visible' })
const licenseKey = process.env.LICENSE_KEY
if (licenseKey) {
// Navigate to superadmin settings to configure license key
await page.goto(`${baseURL}/#superadmin-settings`)
// Wait for the license key input
const licenseKeyInput = page.locator('input#license_key')
await licenseKeyInput.waitFor({ state: 'visible' })
// Fill in the license key from environment variable
await licenseKeyInput.fill(licenseKey)
// Click the Save button
const saveButton = page.locator('button:has-text("Save")')
await saveButton.click()
// Wait a moment for the save to complete
await page.waitForTimeout(1000)
}
// Save the authenticated state
await context.storageState({ path: './e2e/auth.json' })
await browser.close()