Allow timestamp placeholders for Paddle sandbox tenant email
This commit is contained in:
@@ -6,7 +6,7 @@ const shouldRun = process.env.E2E_PADDLE_SANDBOX === '1';
|
|||||||
const baseUrl = process.env.E2E_BASE_URL ?? 'https://test-y0k0.fotospiel.app';
|
const baseUrl = process.env.E2E_BASE_URL ?? 'https://test-y0k0.fotospiel.app';
|
||||||
const locale = process.env.E2E_LOCALE ?? 'de';
|
const locale = process.env.E2E_LOCALE ?? 'de';
|
||||||
const checkoutSlug = locale === 'en' ? 'checkout' : 'bestellen';
|
const checkoutSlug = locale === 'en' ? 'checkout' : 'bestellen';
|
||||||
const tenantEmail = process.env.E2E_TENANT_EMAIL ?? process.env.E2E_PADDLE_EMAIL ?? null;
|
const tenantEmail = buildTenantEmail();
|
||||||
const tenantPassword = process.env.E2E_TENANT_PASSWORD ?? null;
|
const tenantPassword = process.env.E2E_TENANT_PASSWORD ?? null;
|
||||||
const sandboxCard = {
|
const sandboxCard = {
|
||||||
number: process.env.E2E_PADDLE_CARD_NUMBER ?? '4242 4242 4242 4242',
|
number: process.env.E2E_PADDLE_CARD_NUMBER ?? '4242 4242 4242 4242',
|
||||||
@@ -178,6 +178,20 @@ async function completeHostedPaddleCheckout(
|
|||||||
await payButton.click();
|
await payButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildTenantEmail(): string | null {
|
||||||
|
const rawEmail = process.env.E2E_TENANT_EMAIL ?? process.env.E2E_PADDLE_EMAIL ?? null;
|
||||||
|
if (!rawEmail) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rawEmail.includes('{timestamp}')) {
|
||||||
|
return rawEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
const timestamp = Math.floor(Date.now() / 1000).toString();
|
||||||
|
return rawEmail.replaceAll('{timestamp}', timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
async function fillInAnyFrame(page: Page, selectors: string[], value: string): Promise<void> {
|
async function fillInAnyFrame(page: Page, selectors: string[], value: string): Promise<void> {
|
||||||
const filled = await attemptFill(page, selectors, value);
|
const filled = await attemptFill(page, selectors, value);
|
||||||
if (filled) {
|
if (filled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user