Skip to content

Commit 1bf64db

Browse files
Merge pull request #1214 from appwrite/tests-improve-stability
test: improve stability of e2e tests
2 parents e346bdb + e7838f2 commit 1bf64db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/e2e/steps/pro-project.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@ type Metadata = {
77
};
88

99
export async function enterCreditCard(page: Page) {
10+
const dialog = page.locator('.modal').filter({
11+
hasText: 'add payment method'
12+
});
13+
await dialog.waitFor({
14+
state: 'visible'
15+
});
1016
await page.getByPlaceholder('cardholder').fill('Test User');
1117
const stripe = page.frameLocator('[title="Secure payment input frame"]');
1218
await stripe.locator('id=Field-numberInput').fill('4242424242424242');
1319
await stripe.locator('id=Field-expiryInput').fill('1250');
1420
await stripe.locator('id=Field-cvcInput').fill('123');
1521
await stripe.locator('id=Field-countryInput').selectOption('DE');
1622
await page.getByRole('button', { name: 'Add', exact: true }).click();
23+
await dialog.waitFor({
24+
state: 'hidden'
25+
});
1726
}
1827

1928
export async function createProProject(page: Page): Promise<Metadata> {
@@ -24,7 +33,6 @@ export async function createProProject(page: Page): Promise<Metadata> {
2433
await page.locator('id=plan').selectOption('tier-1');
2534
await page.getByRole('button', { name: 'get started' }).click();
2635
await page.waitForURL('/console/create-organization**');
27-
await new Promise((r) => setTimeout(r, 1000));
2836
await page.getByRole('button', { name: 'add' }).first().click();
2937
await enterCreditCard(page);
3038
// skip members

0 commit comments

Comments
 (0)