Skip to content

Commit

Permalink
Merge pull request #1214 from appwrite/tests-improve-stability
Browse files Browse the repository at this point in the history
test: improve stability of e2e tests
  • Loading branch information
TorstenDittmann authored Jul 18, 2024
2 parents e346bdb + e7838f2 commit 1bf64db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/e2e/steps/pro-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ 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');
await stripe.locator('id=Field-expiryInput').fill('1250');
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> {
Expand All @@ -24,7 +33,6 @@ export async function createProProject(page: Page): Promise<Metadata> {
await page.locator('id=plan').selectOption('tier-1');
await page.getByRole('button', { name: 'get started' }).click();
await page.waitForURL('/console/create-organization**');
await new Promise((r) => setTimeout(r, 1000));
await page.getByRole('button', { name: 'add' }).first().click();
await enterCreditCard(page);
// skip members
Expand Down

0 comments on commit 1bf64db

Please sign in to comment.