mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
test: waiting for modal on entering cc
This commit is contained in:
@@ -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-**');
|
||||
|
||||
Reference in New Issue
Block a user