The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix stale selectors in create-record and create-kanban-view e2e tests (#28380)
Charles Bochet71821f69d051
diff --git a/packages/twenty-e2e-testing/tests/create-kanban-view.spec.ts b/packages/twenty-e2e-testing/tests/create-kanban-view.spec.tsindex 4e8f50ee161..7b03d866db7 100644--- a/packages/twenty-e2e-testing/tests/create-kanban-view.spec.ts+++ b/packages/twenty-e2e-testing/tests/create-kanban-view.spec.ts@@ -26,12 +26,10 @@ test('Create Industry Select Field', async ({ page }) => {test('Create Kanban View from Industry Select Field', async ({ page }) => {await page.getByRole('link', { name: 'Opportunities' }).click();- await page.getByRole('button', { name: /All Opportunities/ }).click();+ await page.getByRole('button', { name: /By Stage/ }).click();await page.getByText('Add view').click();await page.getByRole('textbox').press('ControlOrMeta+a');await page.getByRole('textbox').fill('By industry');- await page.getByRole('button', { name: 'Table', exact: true }).click();- await page.getByText('Kanban').click();await page.getByText('Stages', { exact: true }).locator('xpath=..')@@ -39,7 +37,7 @@ test('Create Kanban View from Industry Select Field', async ({ page }) => {.click();await page.getByRole('dialog', { name: 'Stages' })- .getByRole('button', { name: industryLabel })+ .getByRole('option', { name: industryLabel }).click();await page.getByRole('button', { name: 'Create new view' }).click();await expect(page.getByText('Food')).toBeVisible({ timeout: 30000 });diff --git a/packages/twenty-e2e-testing/tests/create-record.spec.ts b/packages/twenty-e2e-testing/tests/create-record.spec.tsindex 0aae534924c..d6c16f305fe 100644--- a/packages/twenty-e2e-testing/tests/create-record.spec.ts+++ b/packages/twenty-e2e-testing/tests/create-record.spec.ts@@ -71,23 +71,26 @@ test('Create and update record', async ({ page }) => {const randomEmail = `testuser_${Math.random().toString(36).substring(2, 10)}@example.com`;- const firstNameInput = page.locator('[contenteditable]').filter({- has: page.locator('p[data-placeholder="First name"]'),+ const firstNameInput = page.getByRole('textbox', {+ name: 'First Name',+ exact: true,});await expect(firstNameInput).toBeVisible();await firstNameInput.click();await expect(firstNameInput).toBeFocused();await page.keyboard.type('John');- const lastNameInput = page.locator('[contenteditable]').filter({- has: page.locator('p[data-placeholder="Last name"]'),+ const lastNameInput = page.getByRole('textbox', {+ name: 'Last Name',+ exact: true,});await lastNameInput.click();await expect(lastNameInput).toBeFocused();await page.keyboard.type('Doe');- const emailInput = page.locator('[contenteditable]').filter({- has: page.locator('p[data-placeholder="Primary Email"]'),+ const emailInput = page.getByRole('textbox', {+ name: 'Emails',+ exact: true,});await emailInput.click();await expect(emailInput).toBeFocused();