platform/tests/sanity/tests/contact.duplicate.spec.ts
Vyacheslav Tumanov ad9ffff2e5
TSK-1012: Change text names for Organizations to Companies (#2963)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
2023-04-12 23:46:49 +07:00

59 lines
1.7 KiB
TypeScript

import { test } from '@playwright/test'
import { generateId, PlatformSetting, PlatformURI } from './utils'
test.use({
storageState: PlatformSetting
})
test.describe('duplicate-org-test', () => {
test.beforeEach(async ({ page }) => {
// Create user and workspace
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('check-contact-exists', async ({ page }) => {
await page.click('[id="app-lead\\:string\\:LeadApplication"]')
// Click text=Customers
await page.click('text=Customers')
// Click button:has-text("New Customer")
await page.click('button:has-text("New Customer")')
// Click button:has-text("Person")
await page.click('button:has-text("Person")')
// Click button:has-text("Company")
await page.click('button:has-text("Company")')
// Click [placeholder="Apple"]
await page.click('[placeholder="Company name"]')
const genId = 'Asoft-' + generateId(4)
// Fill [placeholder="Apple"]
await page.fill('[placeholder="Company name"]', genId)
// Click button:has-text("Create")
await page.click('button:has-text("Create")')
await page.waitForSelector('form.antiCard', { state: 'detached' })
// Click button:has-text("New Customer")
await page.click('button:has-text("New Customer")')
// Click button:has-text("Person")
await page.click('button:has-text("Person")')
// Click button:has-text("Company")
await page.click('button:has-text("Company")')
// Click [placeholder="Apple"]
await page.click('[placeholder="Company name"]')
// Fill [placeholder="Apple"]
await page.fill('[placeholder="Company name"]', genId)
// Click text=Person already exists...
await page.click('text=Contact already exists...')
})
})