test: waiting for modal on entering cc

This commit is contained in:
Torsten Dittmann
2024-07-18 19:19:35 +02:00
parent f99fde76d4
commit e61528469c
+9 -9
View File
@@ -7,6 +7,12 @@ type Metadata = {
};
export async function enterCreditCard(page: Page) {
const dialog = page.locator('.modal').filter({
hasText: 'Add payment method'
});
await dialog.waitFor({
state: 'visible'
});
await page.getByPlaceholder('cardholder').fill('Test User');
const stripe = page.frameLocator('[title="Secure payment input frame"]');
await stripe.locator('id=Field-numberInput').fill('4242424242424242');
@@ -14,6 +20,9 @@ export async function enterCreditCard(page: Page) {
await stripe.locator('id=Field-cvcInput').fill('123');
await stripe.locator('id=Field-countryInput').selectOption('DE');
await page.getByRole('button', { name: 'Add', exact: true }).click();
await dialog.waitFor({
state: 'hidden'
});
}
export async function createProProject(page: Page): Promise<Metadata> {
@@ -25,16 +34,7 @@ export async function createProProject(page: Page): Promise<Metadata> {
await page.getByRole('button', { name: 'get started' }).click();
await page.waitForURL('/console/create-organization**');
await page.getByRole('button', { name: 'add' }).first().click();
const dialog = page.locator('.modal').filter({
hasText: 'Add payment method'
});
await dialog.waitFor({
state: 'visible'
});
await enterCreditCard(page);
await dialog.waitFor({
state: 'hidden'
});
// skip members
await page.getByRole('button', { name: 'create organization' }).click();
await page.waitForURL('/console/organization-**');