Add ui tests for sub-issue creation (#2053)

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

View File

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

View File

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

View File

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

View File

@ -3,34 +3,30 @@ import { PlatformSetting, PlatformURI } from './utils'
test.use({
storageState: PlatformSetting
})
test('create-issue', async ({ page }) => {
test('create-issue-and-sub-issue', async ({ page }) => {
await page.goto(`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp`)
// 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`)
// Click button:has-text("New issue")
await page.click('button:has-text("New issue")')
// Click [placeholder="Issue\ title"]
await page.click('[placeholder="Issue\\ title"]')
// Fill [placeholder="Issue\ title"]
await page.fill('[placeholder="Issue\\ title"]', 'test-issue')
// Click p
await page.fill('.ProseMirror', 'some description')
// Click button:has-text("Backlog")
await page.click('button:has-text("Backlog")')
// 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")')
// 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")')
// Click text=Issues Active Backlog Board Projects >> span
await page.click('text=Issues Active Backlog Board Projects >> span')
await expect(page).toHaveURL(
`${PlatformURI}/workbench%3Acomponent%3AWorkbenchApp/tracker%3Aapp%3ATracker/tracker%3Ateam%3ADefaultTeam/issues`
)
// Click text=TSK-1
await page.click('text=TSK-1')
await page.click('.antiNav-element__dropbox :text("Issues")')
await page.click('.listGrid :has-text("test-issue") span')
await page.click('#add-sub-issue')
await page.click('[placeholder="Issue\\ title"]')
await page.fill('[placeholder="Issue\\ title"]', 'sub-issue')
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")')
})