Skip to content

Commit d41cc5d

Browse files
authored
Merge pull request #2278 from appwrite/fix-e2e
Fix: e2e flow
2 parents 009eb89 + 0ec01c0 commit d41cc5d

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

e2e/journeys/upgrade-free-tier.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ test('upgrade - free tier', async ({ page }) => {
1010
await page.getByRole('link', { name: 'Upgrade', exact: true }).click();
1111
await page.waitForURL(/\/organization-[^/]+\/change-plan/);
1212
await page.locator('input[value="tier-1"]').click();
13-
await page.getByRole('button', { name: 'add' }).first().click();
1413

1514
await enterCreditCard(page);
1615

e2e/steps/pro-project.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ 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-
});
10+
// click the `add` button inside correct view layer
11+
await page
12+
.locator('#no-payments-card-stack')
13+
.getByRole('button', { name: 'add' })
14+
.first()
15+
.click();
16+
17+
const dialog = page.locator('.modal').filter({ hasText: 'add payment method' });
18+
await dialog.waitFor({ state: 'visible' });
1619
await page.getByPlaceholder('cardholder').fill('Test User');
1720
const stripe = page.locator('[title="Secure payment input frame"]').nth(0).contentFrame();
1821
await stripe.locator('id=Field-numberInput').fill('4242424242424242');
@@ -35,7 +38,6 @@ export async function createProProject(page: Page): Promise<Metadata> {
3538
await page.getByRole('radio', { name: /^Pro\b/ }).check();
3639
// `create organization` because there's already free created on start!
3740
await page.getByRole('button', { name: 'create organization' }).click();
38-
await page.getByRole('button', { name: 'add' }).first().click();
3941
await enterCreditCard(page);
4042
// skip members
4143
await page.getByRole('button', { name: 'create organization' }).click();

src/lib/components/billing/selectPaymentMethod.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</Layout.Stack>
7979
{:else}
8080
<Card.Base variant="secondary" radius="s" padding="xs">
81-
<Layout.Stack direction="row">
81+
<Layout.Stack direction="row" id="no-payments-card-stack">
8282
<Layout.Stack direction="row" gap="xxs" alignItems="center">
8383
<Icon
8484
icon={IconExclamationCircle}

src/routes/(console)/organization-[organization]/change-plan/+page.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,10 @@
143143
null
144144
);
145145
146-
trackDowngradeFeedback();
147-
148-
await invalidate(Dependencies.ORGANIZATION);
146+
await Promise.all([trackDowngradeFeedback(), invalidate(Dependencies.ORGANIZATION)]);
149147
150148
await goto(previousPage);
149+
151150
addNotification({
152151
type: 'success',
153152
message: `${$organization.name} plan has been successfully updated.`

0 commit comments

Comments
 (0)