Add ui tests for sub-issue creation ()

This commit is contained in:
Sergei Ogorelkov 2022-06-10 22:49:42 +07:00 committed by GitHub
parent 546eac5dee
commit 059bc3fdf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 35 deletions
plugins/tracker-resources/src/components/issues/edit
tests/sanity/tests

View File

@ -98,16 +98,17 @@
<div bind:this={thisRef} class="flex-col root"> <div bind:this={thisRef} class="flex-col root">
<div class="flex-row-top"> <div class="flex-row-top">
<StatusEditor <div id="status-editor">
value={newIssue} <StatusEditor
statuses={issueStatuses} value={newIssue}
kind="transparent" statuses={issueStatuses}
width="min-content" kind="transparent"
size="medium" width="min-content"
tooltipFill={false} size="medium"
tooltipAlignment="bottom" tooltipAlignment="bottom"
on:change={({ detail }) => (newIssue.status = detail)} on:change={({ detail }) => (newIssue.status = detail)}
/> />
</div>
<div class="w-full flex-col content"> <div class="w-full flex-col content">
<EditBox <EditBox
bind:value={newIssue.title} bind:value={newIssue.title}

View File

@ -95,13 +95,7 @@
<span class="flex-no-shrink text" on:click={() => openIssue(issue)}> <span class="flex-no-shrink text" on:click={() => openIssue(issue)}>
{getIssueId(currentTeam, issue)} {getIssueId(currentTeam, issue)}
</span> </span>
<StatusEditor <StatusEditor value={issue} statuses={issueStatuses} kind="transparent" tooltipAlignment="bottom" />
value={issue}
statuses={issueStatuses}
kind="transparent"
tooltipFill={false}
tooltipAlignment="bottom"
/>
<span class="text name" title={issue.title} on:click={() => openIssue(issue)}> <span class="text name" title={issue.title} on:click={() => openIssue(issue)}>
{issue.title} {issue.title}
</span> </span>

View File

@ -71,6 +71,7 @@
<Tooltip label={tracker.string.AddSubIssues} props={{ subIssues: 1 }} direction="bottom"> <Tooltip label={tracker.string.AddSubIssues} props={{ subIssues: 1 }} direction="bottom">
<Button <Button
id="add-sub-issue"
width="min-content" width="min-content"
icon={hasSubIssues ? IconAdd : undefined} icon={hasSubIssues ? IconAdd : undefined}
label={hasSubIssues ? undefined : tracker.string.AddSubIssues} label={hasSubIssues ? undefined : tracker.string.AddSubIssues}

View File

@ -3,34 +3,30 @@ import { PlatformSetting, PlatformURI } from './utils'
test.use({ test.use({
storageState: PlatformSetting storageState: PlatformSetting
}) })
test('create-issue', async ({ page }) => { test('create-issue-and-sub-issue', async ({ page }) => {
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp`) await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp`)
// Click [id="app-tracker\:string\:TrackerApplication"]
await page.click('[id="app-tracker\\:string\\:TrackerApplication"]') await page.click('[id="app-tracker\\:string\\:TrackerApplication"]')
await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker`) await expect(page).toHaveURL(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker`)
// Click button:has-text("New issue")
await page.click('button:has-text("New issue")') await page.click('button:has-text("New issue")')
// Click [placeholder="Issue\ title"]
await page.click('[placeholder="Issue\\ title"]') await page.click('[placeholder="Issue\\ title"]')
// Fill [placeholder="Issue\ title"]
await page.fill('[placeholder="Issue\\ title"]', 'test-issue') await page.fill('[placeholder="Issue\\ title"]', 'test-issue')
// Click p
await page.fill('.ProseMirror', 'some description') await page.fill('.ProseMirror', 'some description')
// Click button:has-text("Backlog")
await page.click('button:has-text("Backlog")') await page.click('button:has-text("Backlog")')
// Click button:has-text("Todo")
await page.click('button:has-text("Todo")') await page.click('button:has-text("Todo")')
// Click button:has-text("No priority")
await page.click('button:has-text("No priority")') await page.click('button:has-text("No priority")')
// Click button:has-text("Urgent")
await page.click('button:has-text("Urgent")') await page.click('button:has-text("Urgent")')
// Click button:has-text("Save issue")
await page.click('button:has-text("Save issue")') await page.click('button:has-text("Save issue")')
// Click text=Issues Active Backlog Board Projects >> span
await page.click('text=Issues Active Backlog Board Projects >> span') await page.click('.antiNav-element__dropbox :text("Issues")')
await expect(page).toHaveURL( await page.click('.listGrid :has-text("test-issue") span')
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker/tracker%3Ateam%3ADefaultTeam/issues` await page.click('#add-sub-issue')
) await page.click('[placeholder="Issue\\ title"]')
// Click text=TSK-1 await page.fill('[placeholder="Issue\\ title"]', 'sub-issue')
await page.click('text=TSK-1') await page.fill('.ProseMirror', 'sub-issue description')
await page.click('#status-editor')
await page.click('button:has-text("In Progress")')
await page.click('button:has-text("Assignee")')
await page.click('.selectPopup button:has-text("John Appleseed")')
await page.click('button:has-text("Save")')
await page.click('span.name:text("sub-issue")')
}) })