From bbe6c1247478e90a286b1d8e57a9926465b4eb3f Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Thu, 7 Jul 2022 09:16:20 +0700 Subject: [PATCH] Fixing few issues. (#2220) Signed-off-by: Andrey Sobolev --- packages/presentation/src/components/Card.svelte | 2 +- .../src/components/issues/edit/EditIssue.svelte | 4 +++- plugins/tracker-resources/src/issues.ts | 2 +- tests/sanity/tests/contact.duplicate.spec.ts | 4 +++- tests/sanity/tests/contacts.spec.ts | 6 ++++-- tests/sanity/tests/org.members.spec.ts | 1 + tests/sanity/tests/recruit.review.spec.ts | 1 + tests/sanity/tests/recruit.spec.ts | 8 +++++++- tests/sanity/tests/tags.spec.ts | 4 ++++ tests/sanity/tests/tracker.projects.spec.ts | 2 ++ tests/sanity/tests/tracker.spec.ts | 3 ++- 11 files changed, 29 insertions(+), 8 deletions(-) diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index eaf38d0b65..4434dff554 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -84,7 +84,7 @@ } okProcessing = true const r = okAction() - if (r instanceof Promise && createMore) { + if (r instanceof Promise) { r.then(() => { okProcessing = false dispatch('close') diff --git a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte index d7a797a0b5..5b6735aad8 100644 --- a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte @@ -283,7 +283,9 @@ {#if issueId}{issueId}{/if} - + {#if issueId} + + {/if} diff --git a/plugins/tracker-resources/src/issues.ts b/plugins/tracker-resources/src/issues.ts index 4a7b0cea99..38b0c68ebe 100644 --- a/plugins/tracker-resources/src/issues.ts +++ b/plugins/tracker-resources/src/issues.ts @@ -48,7 +48,7 @@ export async function copyToClipboard (object: Issue, ev: Event, { type }: { typ export function generateIssueShortLink (issueId: string): string { const location = getCurrentLocation() - return `${window.location.host}/${workbenchId}/${location.path[1]}/${trackerId}/${issueId}` + return `${window.location.protocol}//${window.location.host}/${workbenchId}/${location.path[1]}/${trackerId}/${issueId}` } export async function generateIssueLocation (loc: Location, issueId: string): Promise { diff --git a/tests/sanity/tests/contact.duplicate.spec.ts b/tests/sanity/tests/contact.duplicate.spec.ts index a50587c4dc..6f140bf3a9 100644 --- a/tests/sanity/tests/contact.duplicate.spec.ts +++ b/tests/sanity/tests/contact.duplicate.spec.ts @@ -10,7 +10,7 @@ test.describe('duplicate-org-test', () => { // Create user and workspace await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/sanity-ws`) }) - test('test', async ({ page }) => { + test('check-contact-exists', async ({ page }) => { await page.click('[id="app-lead\\:string\\:LeadApplication"]') // Click text=Customers @@ -35,6 +35,8 @@ test.describe('duplicate-org-test', () => { // 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")') diff --git a/tests/sanity/tests/contacts.spec.ts b/tests/sanity/tests/contacts.spec.ts index 16930735a4..442fc7356c 100644 --- a/tests/sanity/tests/contacts.spec.ts +++ b/tests/sanity/tests/contacts.spec.ts @@ -30,6 +30,7 @@ test.describe('contact tests', () => { await lastName.fill(last) await page.locator('.antiCard').locator('button:has-text("Create")').click() + await page.waitForSelector('form.antiCard', { state: 'detached' }) }) test('create-organization', async ({ page }) => { await page.locator('[id="app-contact\\:string\\:Contacts"]').click() @@ -45,7 +46,7 @@ test.describe('contact tests', () => { await firstName.fill(orgName) await page.locator('.antiCard').locator('button:has-text("Create")').click() - await page.isHidden('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await expect(page.locator(`text=${orgName}`)).toBeVisible() }) test('contact-search', async ({ page }) => { @@ -86,7 +87,8 @@ test.describe('contact tests', () => { await lastName.click() await lastName.fill(last) - await page.locator('.antiCard').locator('button:has-text("Create")').click() + await page.locator('.antiCard button:has-text("Create")').click() + await page.waitForSelector('form.antiCard', { state: 'detached' }) // Click #context-menu svg await page.hover(`td:has-text("${first} ${last}")`) diff --git a/tests/sanity/tests/org.members.spec.ts b/tests/sanity/tests/org.members.spec.ts index a4e8123a0e..066bba0882 100644 --- a/tests/sanity/tests/org.members.spec.ts +++ b/tests/sanity/tests/org.members.spec.ts @@ -19,6 +19,7 @@ test.describe('recruit tests', () => { const orgId = 'Organiation-' + generateId() await page.fill('[placeholder="Apple"]', orgId) await page.click('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click(`text=${orgId}`) await page.click('[id="contact:string:AddMember"]') diff --git a/tests/sanity/tests/recruit.review.spec.ts b/tests/sanity/tests/recruit.review.spec.ts index 8029233a86..39ea69b115 100644 --- a/tests/sanity/tests/recruit.review.spec.ts +++ b/tests/sanity/tests/recruit.review.spec.ts @@ -29,6 +29,7 @@ test.describe('recruit review tests', () => { await page.click('button:has-text("Rosamund Chen")') await page.click('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click(`tr:has-text('${reviewId}') td a`) await page.click('button:has-text("2 members")') diff --git a/tests/sanity/tests/recruit.spec.ts b/tests/sanity/tests/recruit.spec.ts index 5137cbeaaf..4bcd4536f1 100644 --- a/tests/sanity/tests/recruit.spec.ts +++ b/tests/sanity/tests/recruit.spec.ts @@ -44,7 +44,8 @@ test.describe('recruit tests', () => { await emailInput.fill(email) await emailInput.press('Enter') - await page.locator('.antiCard').locator('button:has-text("Create")').click() + await page.locator('.antiCard button:has-text("Create")').click() + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click(`text="${first} ${last}"`) @@ -86,6 +87,7 @@ test.describe('recruit tests', () => { await page.click(`button:has-text("${vacancyId}")`) await page.click('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click(`tr:has-text("${vacancyId}") >> text=APP-`) await page.click('button:has-text("Assigned recruiter")') @@ -102,6 +104,8 @@ test.describe('recruit tests', () => { await page.click('button:has-text("Vacancy")') await page.fill('form [placeholder="Software\\ Engineer"]', vacancyId) await page.click('form button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) + await page.click(`tr > :has-text("${vacancyId}")`) // Create Applicatio n1 @@ -109,6 +113,7 @@ test.describe('recruit tests', () => { await page.click('form[id="recruit:string:CreateApplication"] button:has-text("Talent")') await page.click('button:has-text("Alex P.")') await page.click('form[id="recruit:string:CreateApplication"] button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await expect(page.locator('text=APP-').first()).toBeVisible() await expect(page.locator('text=Alex P.').first()).toBeVisible() @@ -170,6 +175,7 @@ test.describe('recruit tests', () => { await page.click('form button:has-text("Talent")') await page.click('button:has-text("Andrey P.")') await page.click('text=Create') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click('td:has-text("RVE-")') }) diff --git a/tests/sanity/tests/tags.spec.ts b/tests/sanity/tests/tags.spec.ts index 8f9609be90..8615a9408e 100644 --- a/tests/sanity/tests/tags.spec.ts +++ b/tests/sanity/tests/tags.spec.ts @@ -35,6 +35,7 @@ test.describe('recruit tests', () => { await page.fill('[placeholder="Please\\ type\\ \\ title"]', 's1') // Click text=Create Skill s1 Please type description here Category Other Create Cancel >> button await page.click('form[id="tags:string:AddTag"] button:has-text("Create")') + await page.waitForSelector('form[id="tags:string:AddTag"]', { state: 'detached' }) await page.click('button:has-text("Other")') // Click text=s1 // await page.click('text=s1') @@ -45,6 +46,7 @@ test.describe('recruit tests', () => { await page.keyboard.press('Escape') // Click button:has-text("Create") await page.click('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) }) test('create-tag-candidate', async ({ page }) => { @@ -76,6 +78,7 @@ test.describe('recruit tests', () => { await page.fill('[placeholder="Please\\ type\\ skill\\ title"]', 'C++') // Click button:has-text("Create") await page.click('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) // Click text=Talents await page.click('text=Talents') await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/sanity-ws/recruit/talents`) @@ -101,6 +104,7 @@ test.describe('recruit tests', () => { await page.fill('[placeholder="Appleseed"]', last) // Click button:has-text("Create") await page.click('button:has-text("Create")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) // Click text=q w await page.click(`tr > :has-text("${first} ${last}")`) // Click text=java diff --git a/tests/sanity/tests/tracker.projects.spec.ts b/tests/sanity/tests/tracker.projects.spec.ts index 2a177a9d2a..9860c5f700 100644 --- a/tests/sanity/tests/tracker.projects.spec.ts +++ b/tests/sanity/tests/tracker.projects.spec.ts @@ -31,6 +31,7 @@ test.describe('project tests', () => { await page.click('form button:has-text("Project")') await page.click(`button:has-text("${prjId}")`) await page.click('button:has-text("Save issue")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click(`button:has-text("${prjId}")`) await page.click('button:has-text("No project")') }) @@ -47,6 +48,7 @@ test.describe('project tests', () => { await page.click('text=Backlog Lead Members Start date Target date >> button') await page.click('button:has-text("In progress")') await page.click('button:has-text("Create project")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) await page.click(`text=${prjId}`) await page.click('button:has-text("In progress")') await page.click('button:has-text("Completed")') diff --git a/tests/sanity/tests/tracker.spec.ts b/tests/sanity/tests/tracker.spec.ts index df96d29fd3..3daad4c040 100644 --- a/tests/sanity/tests/tracker.spec.ts +++ b/tests/sanity/tests/tracker.spec.ts @@ -53,6 +53,7 @@ async function createIssue (page: Page, props: IssueProps): Promise { await page.click('button:has-text("New issue")') await fillIssueForm(page, props) await page.click('button:has-text("Save issue")') + await page.waitForSelector('form.antiCard', { state: 'detached' }) } async function createSubissue (page: Page, props: IssueProps): Promise { @@ -70,7 +71,7 @@ async function createLabel (page: Page, { label }: LabelProps): Promise { await page.click('.buttons-group >> button >> nth=-1') await page.fill('[id="tags:string:AddTag"] >> input >> nth=0', label) await page.click('[id="tags:string:AddTag"] >> button:has-text("Create")') - await page.waitForTimeout(100) + await page.waitForSelector('form.antiCard[id="tags:string:AddTag"]', { state: 'detached' }) await page.keyboard.press('Escape') await page.waitForTimeout(100) await page.keyboard.press('Escape')