platform/tests/sanity/tests/contact.duplicate.spec.ts
Andrey Sobolev bbe6c12474
Fixing few issues. (#2220)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
2022-07-07 09:16:20 +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 page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/sanity-ws`)
})
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("Organization")
await page.click('button:has-text("Organization")')
// Click [placeholder="Apple"]
await page.click('[placeholder="Apple"]')
const genId = 'Asoft-' + generateId(4)
// Fill [placeholder="Apple"]
await page.fill('[placeholder="Apple"]', 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("Organization")
await page.click('button:has-text("Organization")')
// Click [placeholder="Apple"]
await page.click('[placeholder="Apple"]')
// Fill [placeholder="Apple"]
await page.fill('[placeholder="Apple"]', genId)
// Click text=Person already exists...
await page.click('text=Contact already exists...')
})
})