mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-29 17:14:37 +03:00
Add verifications for some test steps (#2371)
* Add verifications for some test steps Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> * Add verifications for some test steps Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> * remove random from tests Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> * return random and fix internal loop index Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> * remove outer loop Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru> Signed-off-by: Ruslan Bayandinov <wazsone@ya.ru>
This commit is contained in:
parent
cdbead6584
commit
4fcec640a4
@ -208,22 +208,25 @@ test('report-time-from-issue-card', async ({ page }) => {
|
|||||||
await navigate(page)
|
await navigate(page)
|
||||||
const assignee = 'Rosamund Chen'
|
const assignee = 'Rosamund Chen'
|
||||||
const status = 'In Progress'
|
const status = 'In Progress'
|
||||||
const values = ['0.25', '0.5', '0.75', '1']
|
const values = [0.25, 0.5, 0.75, 1]
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
const random = Math.floor(Math.random() * values.length)
|
const random = Math.floor(Math.random() * values.length)
|
||||||
const time = values[random]
|
const time = values[random]
|
||||||
const name = getIssueName()
|
const name = getIssueName()
|
||||||
await createIssue(page, { name, assignee, status })
|
await createIssue(page, { name, assignee, status })
|
||||||
|
await page.waitForSelector(`text="${name}"`)
|
||||||
|
await page.waitForSelector('text="View issue"')
|
||||||
await page.click('text="View issue"')
|
await page.click('text="View issue"')
|
||||||
|
|
||||||
await page.click('#ReportedTimeEditor')
|
await page.click('#ReportedTimeEditor')
|
||||||
|
await page.waitForSelector('text="Time spend reports"')
|
||||||
await page.click('#ReportsPopupAddButton')
|
await page.click('#ReportsPopupAddButton')
|
||||||
|
await page.waitForSelector('text="Add time report"')
|
||||||
await expect(page.locator('button:has-text("Create")')).toBeDisabled()
|
await expect(page.locator('button:has-text("Create")')).toBeDisabled()
|
||||||
await page.fill('[placeholder="Reported\\ time"]', time)
|
await page.fill('[placeholder="Reported\\ time"]', `${time}`)
|
||||||
await expect(page.locator('button:has-text("Create")')).toBeEnabled()
|
await expect(page.locator('button:has-text("Create")')).toBeEnabled()
|
||||||
await page.click('button:has-text("Create")')
|
await page.click('button:has-text("Create")')
|
||||||
await page.keyboard.press('Escape')
|
await page.click('#card-close')
|
||||||
|
|
||||||
await expect(page.locator('#TimeSpendReportValue')).toContainText(`${time}d`)
|
await expect(page.locator('#TimeSpendReportValue')).toContainText(`${time}d`)
|
||||||
}
|
}
|
||||||
@ -241,28 +244,28 @@ test('report-time-from-main-view', async ({ page }) => {
|
|||||||
const values = [0.25, 0.5, 0.75, 1]
|
const values = [0.25, 0.5, 0.75, 1]
|
||||||
const assignee = 'Rosamund Chen'
|
const assignee = 'Rosamund Chen'
|
||||||
const status = 'In Progress'
|
const status = 'In Progress'
|
||||||
for (let i = 0; i < 5; i++) {
|
|
||||||
const name = getIssueName()
|
const name = getIssueName()
|
||||||
|
|
||||||
await createIssue(page, { name, assignee, status })
|
await createIssue(page, { name, assignee, status })
|
||||||
await page.waitForSelector(`text="${name}"`)
|
await page.waitForSelector(`text="${name}"`)
|
||||||
await page.click('.close-button >> button')
|
await page.click('.close-button > .button')
|
||||||
|
|
||||||
let count = 0
|
let count = 0
|
||||||
for (let i = 0; i < 5; i++) {
|
for (let j = 0; j < 5; j++) {
|
||||||
const random = Math.floor(Math.random() * values.length)
|
const random = Math.floor(Math.random() * values.length)
|
||||||
const time = values[random]
|
const time = values[random]
|
||||||
count += time
|
count += time
|
||||||
await page.click('.estimation-container')
|
await page.locator('.estimation-container').first().click()
|
||||||
await page.waitForSelector('text="Estimation"')
|
await page.waitForSelector('text="Estimation"')
|
||||||
|
|
||||||
await page.click('text="Add time report"')
|
await page.click('button:has-text("Add time report")')
|
||||||
|
await page.waitForSelector('.antiCard-header >> .antiCard-header__title-wrap >> span:has-text("Add time report")')
|
||||||
await expect(page.locator('button:has-text("Create")')).toBeDisabled()
|
await expect(page.locator('button:has-text("Create")')).toBeDisabled()
|
||||||
await page.fill('[placeholder="Reported\\ time"]', `${time}`)
|
await page.fill('[placeholder="Reported\\ time"]', `${time}`)
|
||||||
await expect(page.locator('button:has-text("Create")')).toBeEnabled()
|
await expect(page.locator('button:has-text("Create")')).toBeEnabled()
|
||||||
await page.click('button:has-text("Create")')
|
await page.click('button:has-text("Create")')
|
||||||
await page.keyboard.press('Escape')
|
await page.click('#card-close')
|
||||||
|
|
||||||
await expect(page.locator('.estimation-container >> span').nth(0)).toContainText(`${Number(count.toFixed(2))}d`)
|
await expect(page.locator('.estimation-container >> span').first()).toContainText(`${Number(count.toFixed(2))}d`)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user