update: regexify the tests.

This commit is contained in:
Darshan
2025-03-17 12:28:02 +05:30
parent 07e754e29c
commit 18d08c437f
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ test('upgrade - free tier', async ({ page }) => {
await createFreeProject(page);
await test.step('upgrade project', async () => {
await page.getByRole('link', { name: 'Upgrade', exact: true }).click();
await page.waitForURL('./organization-**/change-plan');
await page.waitForURL(/\/organization-[^/]+\/change-plan/);
await page.locator('input[value="tier-1"]').click();
await page.getByRole('button', { name: 'add' }).first().click();
await enterCreditCard(page);
+2 -2
View File
@@ -13,12 +13,12 @@ export async function createFreeProject(page: Page): Promise<Metadata> {
await page.locator('id=name').fill('test org');
await page.locator('id=plan').selectOption('tier-0');
await page.getByRole('button', { name: 'get started' }).click();
await page.waitForURL('./organization-**');
await page.waitForURL(/\/organization-[^/]+/);
return getOrganizationIdFromUrl(page.url());
});
const projectId = await test.step('create project', async () => {
await page.waitForURL('./organization-**');
await page.waitForURL(/\/organization-[^/]+/);
await page.getByRole('button', { name: 'create project' }).first().click();
await page.locator('id=name').fill('test project');
await page.getByRole('button', { name: 'next' }).click();
+3 -3
View File
@@ -32,18 +32,18 @@ export async function createProProject(page: Page): Promise<Metadata> {
await page.locator('id=name').fill('test org');
await page.locator('id=plan').selectOption('tier-1');
await page.getByRole('button', { name: 'get started' }).click();
await page.waitForURL('./create-organization**');
await page.waitForURL(/\/create-organization.*/);
await page.getByRole('button', { name: 'add' }).first().click();
await enterCreditCard(page);
// skip members
await page.getByRole('button', { name: 'create organization' }).click();
await page.waitForURL('./organization-**');
await page.waitForURL(/\/organization-[^/]+/);
return getOrganizationIdFromUrl(page.url());
});
const projectId = await test.step('create project', async () => {
await page.waitForURL('./organization-**');
await page.waitForURL(/\/organization-[^/]+/);
await page.getByRole('button', { name: 'create project' }).first().click();
await page.getByPlaceholder('project name').fill('test project');
await page.getByRole('button', { name: 'next' }).click();