Refactor pages (#5448)

Signed-off-by: Jasmin <jasmin@hardcoreeng.com>
This commit is contained in:
JasminMus 2024-04-24 17:02:50 +02:00 committed by GitHub
parent 4e3063fff1
commit d434c54509
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 364 additions and 281 deletions

View File

@ -20,7 +20,7 @@ test.describe('channel tests', () => {
})
test('create new private channel tests', async () => {
await leftSideMenuPage.buttonChunter.click()
await leftSideMenuPage.clickChunter()
await chunterPage.clickChannelBrowser()
await chunterPage.clickNewChannelHeader()
const channel = 'channel-' + generateId()

View File

@ -43,8 +43,8 @@ test.describe('Collaborative tests for Application', () => {
await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/recruit`))?.finished()
const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage)
await leftSideMenuPageSecond.checkExistNewNotification(userSecondPage)
await leftSideMenuPageSecond.buttonNotification.click()
await leftSideMenuPageSecond.checkExistNewNotification()
await leftSideMenuPageSecond.clickNotification()
// TODO: rewrite checkNotificationCollaborators and uncomment
// const notificationPageSecond = new NotificationPage(userSecondPage)
@ -68,8 +68,8 @@ test.describe('Collaborative tests for Application', () => {
await test.step('User1. Check notification and check comment from user1', async () => {
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.checkExistNewNotification(page)
await leftSideMenuPage.buttonNotification.click()
await leftSideMenuPage.checkExistNewNotification()
await leftSideMenuPage.clickNotification()
// TODO: rewrite checkNotificationCollaborators and uncomment
// const notificationPage = new NotificationPage(page)

View File

@ -38,7 +38,7 @@ test.describe('Collaborative test for issue', () => {
// create a new issue by first user
await (await page.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished()
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.createNewIssue(newIssue)
@ -153,7 +153,7 @@ test.describe('Collaborative test for issue', () => {
// const notificationPageSecond = new NotificationPage(userSecondPage)
// await notificationPageSecond.checkNotificationIssue(issue.title, newAssignee)
//
// await leftSideMenuPageSecond.buttonTracker.click()
// await leftSideMenuPageSecond.clickTracker()
// })
await test.step('user2. check issue assignee', async () => {

View File

@ -19,7 +19,7 @@ test.describe('Documents link tests', () => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.clickOnButtonCreateDocument()
@ -31,7 +31,7 @@ test.describe('Documents link tests', () => {
await documentContentPage.executeMoreAction('Public link')
// remove after UBERF-5994 fixed
await documentContentPage.closePopup(page)
await documentContentPage.closePopup()
await page.reload({ waitUntil: 'commit' })
await documentContentPage.executeMoreAction('Public link')

View File

@ -21,7 +21,7 @@ test.describe('Documents tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.clickOnButtonCreateDocument()
@ -43,7 +43,7 @@ test.describe('Documents tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.clickOnButtonCreateDocument()
@ -77,7 +77,7 @@ test.describe('Documents tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.checkTeamspaceNotExist(moveTeamspace.title)
@ -112,7 +112,7 @@ test.describe('Documents tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.openTeamspace(colDocument.space)
@ -135,7 +135,7 @@ test.describe('Documents tests', () => {
await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage)
await leftSideMenuPageSecond.buttonDocuments.click()
await leftSideMenuPageSecond.clickDocuments()
const documentsPageSecond = new DocumentsPage(userSecondPage)
await documentsPageSecond.openTeamspace(colDocument.space)
@ -168,7 +168,7 @@ test.describe('Documents tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.clickOnButtonCreateDocument()

View File

@ -21,7 +21,7 @@ test.describe('Teamspace tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.checkTeamspaceNotExist(newTeamspace.title)
@ -35,7 +35,7 @@ test.describe('Teamspace tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.checkTeamspaceExist(archiveTeamspace.title)
@ -59,7 +59,7 @@ test.describe('Teamspace tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
const documentsPage = new DocumentsPage(page)
await documentsPage.checkTeamspaceNotExist(editTeamspace.title)

View File

@ -27,7 +27,7 @@ test.describe('Fulltext index', () => {
test.describe('Documents', () => {
test.beforeEach(async ({ page }) => {
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonDocuments.click()
await leftSideMenuPage.clickDocuments()
})
test('Search created document', async ({ page }) => {
@ -60,7 +60,7 @@ test.describe('Fulltext index', () => {
await test.step('close document', async () => {
// Go to inbox to close the document and trigger indexation
await leftSideMenuPage.buttonNotification.click()
await leftSideMenuPage.clickNotification()
})
await test.step('search by title', async () => {
@ -124,7 +124,7 @@ test.describe('Fulltext index', () => {
await test.step('close document', async () => {
// Go to inbox to close the document and trigger indexation
await leftSideMenuPage.buttonNotification.click()
await leftSideMenuPage.clickNotification()
})
await test.step('search by old title', async () => {
@ -196,7 +196,7 @@ test.describe('Fulltext index', () => {
await documentContentPage.executeMoreAction('Delete')
await documentContentPage.pressYesForPopup(page)
// Go to inbox to close the document and trigger indexation
await leftSideMenuPage.buttonNotification.click()
await leftSideMenuPage.clickNotification()
})
await test.step('search by title', async () => {
@ -213,7 +213,7 @@ test.describe('Fulltext index', () => {
test.describe('Issues', () => {
test.beforeEach(async ({ page }) => {
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
})
test('Search created issue', async ({ page }) => {
@ -388,7 +388,7 @@ test.describe('Fulltext index', () => {
const spotlight = new SpotlightPopup(page)
await test.step('create issue', async () => {
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
await issuesPage.createNewIssue(newIssue)
})
@ -411,14 +411,14 @@ test.describe('Fulltext index', () => {
const newWorkspaceName = `New Workspace Name - ${generateId(2)}`
await loginPage.goto()
await loginPage.linkSignUp.click()
await loginPage.clickSignUp()
await signUpPage.signUp(newUser)
await selectWorkspacePage.createWorkspace(newWorkspaceName)
})
await test.step('search by title', async () => {
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
await expect(async () => {
await spotlight.open()
await spotlight.fillSearchInput(titleId)

View File

@ -3,56 +3,65 @@ import { CommonPage } from './common-page'
export class CalendarPage extends CommonPage {
readonly page: Page
readonly buttonDatePopupToday: Locator
readonly inputTargetDateDay: Locator
readonly inputTargetDateMonth: Locator
readonly inputTargetDateYear: Locator
readonly buttonTargetDateSave: Locator
readonly inputPopupDateDay: Locator
readonly inputPopupDateMonth: Locator
readonly inputPopupDateYear: Locator
readonly inputPopupTime: Locator
readonly inputPopupDateSave: Locator
constructor (page: Page) {
super()
super(page)
this.page = page
this.buttonDatePopupToday = page.locator('div.popup div.today:not(.wrongMonth)')
this.inputTargetDateDay = page.locator('div.date-popup-container div.datetime-input span.digit:nth-child(1)')
this.inputTargetDateMonth = page.locator('div.date-popup-container div.datetime-input span.digit:nth-child(3)')
this.inputTargetDateYear = page.locator('div.date-popup-container div.datetime-input span.digit:nth-child(5)')
this.buttonTargetDateSave = page.locator('div.date-popup-container div.footer button')
this.inputPopupDateDay = page.locator('div[class*="date-popup"] div.datetime-input span.digit:first-child')
this.inputPopupDateMonth = page.locator('div[class*="date-popup"] div.datetime-input span.digit:nth-child(3)')
this.inputPopupDateYear = page.locator('div[class*="date-popup"] div.datetime-input span.digit:nth-child(5)')
this.inputPopupTime = page.locator('div[class*="date-popup"] div.datetime-input span.digit:nth-child(7)')
this.inputPopupDateSave = page.locator('div[class*="date-popup"] div.footer button')
}
buttonDatePopupToday = (): Locator => this.page.locator('div.popup div.today:not(.wrongMonth)')
inputTargetDateDay = (): Locator =>
this.page.locator('div.date-popup-container div.datetime-input span.digit:nth-child(1)')
inputTargetDateMonth = (): Locator =>
this.page.locator('div.date-popup-container div.datetime-input span.digit:nth-child(3)')
inputTargetDateYear = (): Locator =>
this.page.locator('div.date-popup-container div.datetime-input span.digit:nth-child(5)')
buttonTargetDateSave = (): Locator => this.page.locator('div.date-popup-container div.footer button')
inputPopupDateDay = (): Locator =>
this.page.locator('div[class*="date-popup"] div.datetime-input span.digit:first-child')
inputPopupDateMonth = (): Locator =>
this.page.locator('div[class*="date-popup"] div.datetime-input span.digit:nth-child(3)')
inputPopupDateYear = (): Locator =>
this.page.locator('div[class*="date-popup"] div.datetime-input span.digit:nth-child(5)')
inputPopupTime = (): Locator =>
this.page.locator('div[class*="date-popup"] div.datetime-input span.digit:nth-child(7)')
inputPopupDateSave = (): Locator => this.page.locator('div[class*="date-popup"] div.footer button')
buttonInDays = (inDays: string): Locator =>
this.page.locator('div.popup div.shift-container div.btn span', { hasText: inDays })
async clickButtonDatePopupToday (): Promise<void> {
await this.buttonDatePopupToday().click()
}
async fillDatePopup (day: string, month: string, year: string): Promise<void> {
await expect(this.inputTargetDateDay).toBeVisible()
await this.inputTargetDateDay.pressSequentially(day)
await this.inputTargetDateMonth.pressSequentially(month)
await this.inputTargetDateYear.pressSequentially(year)
await this.buttonTargetDateSave.click()
await expect(this.inputTargetDateDay()).toBeVisible()
await this.inputTargetDateDay().pressSequentially(day)
await this.inputTargetDateMonth().pressSequentially(month)
await this.inputTargetDateYear().pressSequentially(year)
await this.buttonTargetDateSave().click()
}
async fillDatePopupInDays (inDays: string): Promise<void> {
await expect(this.inputTargetDateDay).toBeVisible()
await this.page.locator('div.popup div.shift-container div.btn span', { hasText: inDays }).click()
await expect(this.inputTargetDateDay()).toBeVisible()
await this.buttonInDays(inDays).click()
}
async fillSelectDatePopup (day: string, month: string, year: string, time: string): Promise<void> {
await this.inputPopupDateDay.click()
await this.inputPopupDateDay.pressSequentially(day)
await this.inputPopupDateMonth.click()
await this.inputPopupDateMonth.pressSequentially(month)
await this.inputPopupDateYear.click()
await this.inputPopupDateYear.pressSequentially(year)
await this.inputPopupTime.click()
await this.inputPopupTime.pressSequentially(time)
await this.inputPopupDateSave.click()
await this.inputPopupDateDay().click()
await this.inputPopupDateDay().pressSequentially(day)
await this.inputPopupDateMonth().click()
await this.inputPopupDateMonth().pressSequentially(month)
await this.inputPopupDateYear().click()
await this.inputPopupDateYear().pressSequentially(year)
await this.inputPopupTime().click()
await this.inputPopupTime().pressSequentially(time)
await this.inputPopupDateSave().click()
}
}

View File

@ -1,119 +1,162 @@
import { Page, expect } from '@playwright/test'
import { type Locator, type Page, expect } from '@playwright/test'
export class CommonPage {
readonly page: Page
constructor (page: Page) {
this.page = page
}
selectPopupInput = (): Locator => this.page.locator('div.selectPopup input')
selectPopupInputSearch = (): Locator => this.page.locator('div.popup input.search')
selectPopupListItem = (name: string): Locator => this.page.locator('div.selectPopup div.list-item', { hasText: name })
selectPopupListItemFirst = (): Locator => this.page.locator('div.selectPopup div.list-item')
selectPopupHeaderButtonLast = (): Locator => this.page.locator('div.selectPopup div.header button:last-child')
selectPopupButton = (): Locator => this.page.locator('div.selectPopup button')
selectPopupHeaderButtonFirst = (): Locator => this.page.locator('div.selectPopup div.header button:nth-of-type(1)')
popupSpanLabel = (point: string): Locator =>
this.page.locator('div[class$="opup"] span[class*="label"]', { hasText: point })
selectPopupSpanLines = (item: string): Locator =>
this.page.locator('div.selectPopup span[class^="lines"]', { hasText: item })
popupButtonChannelOk = (): Locator => this.page.locator('div.popup button#channel-ok')
viewStringDeleteObjectButtonPrimary = (): Locator =>
this.page.locator('form[id="view:string:DeleteObject"] button.primary')
tagsStringAddTagForm = (field: string): Locator =>
this.page.locator(`div.popup form[id="tags:string:AddTag"] input[placeholder$="${field}"]`)
tagsStringAddTagButtonSubmit = (): Locator =>
this.page.locator('div.popup form[id="tags:string:AddTag"] button[type="submit"]')
notifyContainerButton = (): Locator => this.page.locator('div.notify-container button[type="button"].small').nth(0)
errorSpan = (): Locator => this.page.locator('div.ERROR span')
infoSpan = (): Locator => this.page.locator('div.INFO span')
popupSubmitButton = (): Locator => this.page.locator('div.popup button[type="submit"]')
historyBoxButtonFirst = (): Locator => this.page.locator('div.history-box button:first-child')
inboxNotyButton = (): Locator => this.page.locator('button[id$="Inbox"] > div.noty')
mentionPopupListItem = (mentionName: string): Locator =>
this.page.locator('form.mentionPoup div.list-item span.name', { hasText: mentionName })
hulyPopupRowButton = (name: string): Locator =>
this.page.locator('div.hulyPopup-container button.hulyPopup-row', { hasText: name })
cardCloseButton = (): Locator => this.page.locator('div.popup button[id="card-close"]')
menuPopupItemButton = (itemText: string): Locator =>
this.page.locator('div.selectPopup button.menu-item', { hasText: itemText })
async selectMenuItem (page: Page, name: string, fullWordFilter: boolean = false): Promise<void> {
if (name !== 'first') {
const filterText = fullWordFilter ? name : name.split(' ')[0]
await page.locator('div.selectPopup input').fill(filterText)
await this.selectPopupInput().fill(filterText)
// TODO need to remove after fixed UBERF-4968
await page.waitForTimeout(300)
}
await page.locator('div.selectPopup div.list-item:first-child').click()
await this.selectPopupListItemFirst().first().click()
}
async pressCreateButtonSelectPopup (page: Page): Promise<void> {
await page.locator('div.selectPopup div.header button:last-child').click()
await this.selectPopupHeaderButtonLast().click()
}
async pressShowAllButtonSelectPopup (page: Page): Promise<void> {
await page.locator('div.selectPopup div.header button:nth-of-type(1)').click()
await this.selectPopupHeaderButtonFirst().click()
}
async selectFromDropdown (page: Page, point: string): Promise<void> {
await page.locator('div[class$="opup"] span[class*="label"]', { hasText: point }).click()
await this.popupSpanLabel(point).click()
}
async checkDropdownHasNo (page: Page, item: string): Promise<void> {
await expect(page.locator('div.selectPopup span[class^="lines"]', { hasText: item })).not.toBeVisible()
await expect(this.selectPopupSpanLines(item)).not.toBeVisible()
}
async fillToDropdown (page: Page, input: string): Promise<void> {
await page.locator('div.popup input.search').fill(input)
await page.locator('div.popup button#channel-ok').click()
await this.selectPopupInputSearch().fill(input)
await this.popupButtonChannelOk().click()
}
async fillToSelectPopup (page: Page, input: string): Promise<void> {
await expect(page.locator('div.selectPopup input')).toBeVisible()
await page.locator('div.selectPopup input').fill(input)
await page.locator('div.selectPopup button').click()
await expect(this.selectPopupInput()).toBeVisible()
await this.selectPopupInput().fill(input)
await this.selectPopupButton().click()
}
async checkFromDropdown (page: Page, point: string): Promise<void> {
await page.locator('div.selectPopup span[class^="lines"]', { hasText: point }).first().click()
await this.selectPopupSpanLines(point).first().click()
}
async pressYesDeletePopup (page: Page): Promise<void> {
await page.locator('form[id="view:string:DeleteObject"] button.primary').click()
await this.viewStringDeleteObjectButtonPrimary().click()
}
async addNewTagPopup (page: Page, title: string, description: string): Promise<void> {
await page.locator('div.popup form[id="tags:string:AddTag"] input[placeholder$="title"]').fill(title)
await page
.locator('div.popup form[id="tags:string:AddTag"] input[placeholder="Please type description here"]')
.fill(description)
await page.locator('div.popup form[id="tags:string:AddTag"] button[type="submit"]').click()
await page.locator('div.popup form[id="tags:string:AddTag"]').waitFor({ state: 'hidden' })
await this.tagsStringAddTagForm('title').fill(title)
await this.tagsStringAddTagForm('Please type description here').fill(description)
await this.tagsStringAddTagButtonSubmit().click()
await this.tagsStringAddTagButtonSubmit().waitFor({ state: 'hidden' })
}
async selectAssignee (page: Page, name: string): Promise<void> {
if (name !== 'first') {
await page.locator('div.selectPopup input').fill(name.split(' ')[0])
await expect(page.locator('div.selectPopup div.list-item')).toHaveCount(1)
await this.selectPopupInput().fill(name.split(' ')[0])
await expect(this.selectPopupListItemFirst()).toHaveCount(1)
}
await page.locator('div.selectPopup div.list-item').click()
await this.selectPopupListItemFirst().first().click()
}
async checkExistNewNotification (page: Page): Promise<void> {
await expect(page.locator('button[id$="Inbox"] > div.noty')).toBeVisible()
async checkExistNewNotification (): Promise<void> {
await expect(this.inboxNotyButton()).toBeVisible()
}
async pressYesForPopup (page: Page): Promise<void> {
await expect(page.locator('div.popup button[type="submit"]')).toBeVisible()
await page.locator('div.popup button[type="submit"]').click()
await expect(this.popupSubmitButton()).toBeVisible()
await this.popupSubmitButton().click()
}
async pressButtonBack (page: Page): Promise<void> {
await page.locator('div.history-box button:first-child').click()
await this.historyBoxButtonFirst().click()
}
async checkFromDropdownWithSearch (page: Page, point: string): Promise<void> {
await page.locator('div.selectPopup input').fill(point)
await page.locator('div.selectPopup span[class^="lines"]', { hasText: point }).click()
await this.selectPopupInput().fill(point)
await this.selectPopupSpanLines(point).click()
}
async closeNotification (page: Page): Promise<void> {
await page.locator('div.notify-container button[type="button"].small').nth(0).click()
await this.notifyContainerButton().click()
}
async checkError (page: Page, errorMessage: string): Promise<void> {
await expect(page.locator('div.ERROR span')).toHaveText(errorMessage)
await expect(this.errorSpan()).toHaveText(errorMessage)
}
async checkInfo (page: Page, errorMessage: string): Promise<void> {
await expect(page.locator('div.INFO span')).toHaveText(errorMessage)
await expect(this.infoSpan()).toHaveText(errorMessage)
}
async checkInfoSectionNotExist (page: Page): Promise<void> {
await expect(page.locator('div.INFO span')).not.toBeAttached()
await expect(this.infoSpan()).not.toBeAttached()
}
async selectMention (page: Page, mentionName: string): Promise<void> {
await page.locator('form.mentionPoup div.list-item span.name', { hasText: mentionName }).click()
async selectMention (mentionName: string): Promise<void> {
await this.mentionPopupListItem(mentionName).click()
}
async selectListItem (page: Page, name: string): Promise<void> {
await page.locator('div.selectPopup div.list-item', { hasText: name }).click({ delay: 100 })
async selectListItem (name: string): Promise<void> {
await this.selectPopupListItem(name).click({ delay: 100 })
}
async selectPopupItem (page: Page, name: string): Promise<void> {
await page.locator('div.hulyPopup-container button.hulyPopup-row', { hasText: name }).click({ delay: 100 })
async selectPopupItem (name: string): Promise<void> {
await this.hulyPopupRowButton(name).click({ delay: 100 })
}
async closePopup (page: Page): Promise<void> {
await page.locator('div.popup button[id="card-close"]').click()
async closePopup (): Promise<void> {
await this.cardCloseButton().click()
}
async checkPopupItem (page: Page, itemText: string): Promise<void> {
await expect(page.locator('div.selectPopup button.menu-item', { hasText: itemText })).toBeVisible()
async checkPopupItem (itemText: string): Promise<void> {
await expect(this.menuPopupItemButton(itemText)).toBeVisible()
}
}

View File

@ -6,7 +6,7 @@ export class EmployeeDetailsPage extends CommonPage {
readonly page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
}

View File

@ -5,7 +5,7 @@ export class EmployeesPage extends CommonPage {
readonly page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
}

View File

@ -5,7 +5,7 @@ export class DocumentContentPage extends CommonPage {
readonly page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
}

View File

@ -6,7 +6,7 @@ export class DocumentCreatePopup extends CommonPage {
readonly page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
}

View File

@ -5,7 +5,7 @@ export class DocumentMovePopup extends CommonPage {
readonly page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
}

View File

@ -8,7 +8,7 @@ export class DocumentsPage extends CommonPage {
readonly page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
this.popupCreateDocument = new DocumentCreatePopup(page)
this.popupMoveDocument = new DocumentMovePopup(page)

View File

@ -3,19 +3,35 @@ import { CommonPage } from './common-page'
export class LeftSideMenuPage extends CommonPage {
readonly page: Page
readonly buttonChunter: Locator
readonly buttonContacts: Locator
readonly buttonTracker: Locator
readonly buttonNotification: Locator
readonly buttonDocuments: Locator
constructor (page: Page) {
super()
super(page)
this.page = page
this.buttonChunter = page.locator('button[id$="ApplicationLabelChunter"]')
this.buttonContacts = page.locator('button[id$="Contacts"]')
this.buttonTracker = page.locator('button[id$="TrackerApplication"]')
this.buttonNotification = page.locator('button[id$="Inbox"]')
this.buttonDocuments = page.locator('button[id$="DocumentApplication"]')
}
buttonChunter = (): Locator => this.page.locator('button[id$="ApplicationLabelChunter"]')
buttonContacts = (): Locator => this.page.locator('button[id$="Contacts"]')
buttonTracker = (): Locator => this.page.locator('button[id$="TrackerApplication"]')
buttonNotification = (): Locator => this.page.locator('button[id$="Inbox"]')
buttonDocuments = (): Locator => this.page.locator('button[id$="DocumentApplication"]')
async clickChunter (): Promise<void> {
await this.buttonChunter().click()
}
async clickContacts (): Promise<void> {
await this.buttonContacts().click()
}
async clickTracker (): Promise<void> {
await this.buttonTracker().click()
}
async clickNotification (): Promise<void> {
await this.buttonNotification().click()
}
async clickDocuments (): Promise<void> {
await this.buttonDocuments().click()
}
}

View File

@ -3,27 +3,28 @@ import { PlatformURI } from '../utils'
export class LoginPage {
readonly page: Page
readonly inputEmail: Locator
readonly inputPassword: Locator
readonly buttonLogin: Locator
readonly linkSignUp: Locator
constructor (page: Page) {
this.page = page
this.inputEmail = page.locator('input[name=email]')
this.inputPassword = page.locator('input[name=current-password]')
this.buttonLogin = page.locator('button', { hasText: 'Log In' })
this.linkSignUp = page.locator('a.title', { hasText: 'Sign Up' })
}
inputEmail = (): Locator => this.page.locator('input[name=email]')
inputPassword = (): Locator => this.page.locator('input[name=current-password]')
buttonLogin = (): Locator => this.page.locator('button', { hasText: 'Log In' })
linkSignUp = (): Locator => this.page.locator('a.title', { hasText: 'Sign Up' })
async goto (): Promise<void> {
await (await this.page.goto(`${PlatformURI}/login/login`))?.finished()
}
async clickSignUp (): Promise<void> {
await this.linkSignUp().click()
}
async login (email: string, password: string): Promise<void> {
await this.inputEmail.fill(email)
await this.inputPassword.fill(password)
expect(await this.buttonLogin.isEnabled()).toBe(true)
await this.buttonLogin.click()
await this.inputEmail().fill(email)
await this.inputPassword().fill(password)
expect(await this.buttonLogin().isEnabled()).toBe(true)
await this.buttonLogin().click()
}
}

View File

@ -1,4 +1,4 @@
import { expect, type Page } from '@playwright/test'
import { expect, type Page, Locator } from '@playwright/test'
export class NotificationPage {
readonly page: Page
@ -7,15 +7,16 @@ export class NotificationPage {
this.page = page
}
// TODO: rewrite functions according to new inbox
notificationLocator = (name: string): Locator =>
this.page.locator('div[class*="inbox-activity"] span', { hasText: name })
async checkNotificationIssue (name: string, assignee: string): Promise<void> {
const notification = this.page.locator('div[class*="inbox-activity"] span', { hasText: name })
const notification = this.notificationLocator(name)
await expect(notification.locator('xpath=../../..').locator('a span.ap-label')).toHaveText(assignee)
}
async checkNotificationCollaborators (name: string, text: string): Promise<void> {
const notification = this.page.locator('div[class*="inbox-activity"] span', { hasText: name })
const notification = this.notificationLocator(name)
await expect(notification.locator('xpath=../../..').locator('div[class*="title"]')).toHaveText(text)
}
}

View File

@ -97,18 +97,18 @@ export class PlanningPage extends CalendarPage {
if (data.duedate != null) {
await (popup ? this.buttonPopupCreateDueDate().click() : this.buttonPanelCreateDueDate().click())
if (data.duedate === 'today') {
await this.buttonDatePopupToday.click()
await this.clickButtonDatePopupToday()
} else {
await this.selectMenuItem(this.page, data.duedate)
}
}
if (data.priority != null) {
await (popup ? this.buttonPopupCreatePriority().click() : this.buttonPanelCreatePriority().click())
await this.selectListItem(this.page, data.priority)
await this.selectListItem(data.priority)
}
if (data.visible != null) {
await (popup ? this.buttonPopupCreateVisible().click() : this.buttonPanelCreateVisible().click())
await this.selectPopupItem(this.page, data.visible)
await this.selectPopupItem(data.visible)
}
if (data.labels != null && data.createLabel != null) {
await (popup ? this.buttonPopupCreateAddLabel().click() : this.buttonPanelCreateAddLabel().click())
@ -218,7 +218,7 @@ export class PlanningPage extends CalendarPage {
}
if (data.labels != null) {
await this.buttonPanelLabelFirst().click()
await this.checkPopupItem(this.page, data.labels)
await this.checkPopupItem(data.labels)
await this.buttonPanelLabelFirst().click({ force: true })
}
if (data.slots != null) {

View File

@ -46,6 +46,6 @@ export class VacancyDetailsPage extends CommonRecruitingPage {
async addDueDateToday (): Promise<void> {
await this.buttonInputDueDate().click()
await this.buttonDatePopupToday.click()
await this.clickButtonDatePopupToday()
}
}

View File

@ -3,28 +3,31 @@ import { CommonPage } from './common-page'
export class SelectWorkspacePage extends CommonPage {
readonly page: Page
readonly buttonWorkspace: Locator
readonly buttonCreateWorkspace: Locator
readonly buttonWorkspaceName: Locator
readonly buttonCreateNewWorkspace: Locator
constructor (page: Page) {
super()
super(page)
this.page = page
this.buttonWorkspace = page.locator('div[class*="workspace"]')
this.buttonCreateWorkspace = page.locator('button > span', { hasText: 'Create workspace' })
this.buttonWorkspaceName = page.locator('input')
this.buttonCreateNewWorkspace = page.locator('div.form-row button')
}
buttonWorkspace = (): Locator => this.page.locator('div[class*="workspace"]')
buttonCreateWorkspace = (): Locator => this.page.locator('button > span', { hasText: 'Create workspace' })
buttonWorkspaceName = (): Locator => this.page.locator('input')
buttonCreateNewWorkspace = (): Locator => this.page.locator('div.form-row button')
workspaceButtonByName = (workspace: string): Locator => this.buttonWorkspace().filter({ hasText: workspace })
async selectWorkspace (workspace: string): Promise<void> {
await this.buttonWorkspace.filter({ hasText: workspace }).click()
await this.workspaceButtonByName(workspace).click()
}
async enterWorkspaceName (workspaceName: string): Promise<void> {
await this.buttonWorkspaceName().fill(workspaceName)
}
async createWorkspace (workspaceName: string): Promise<void> {
await this.buttonCreateWorkspace.waitFor({ state: 'visible' })
await this.buttonWorkspaceName.fill(workspaceName)
expect(await this.buttonCreateNewWorkspace.isEnabled()).toBe(true)
await this.buttonCreateNewWorkspace.click()
await this.buttonCreateWorkspace().waitFor({ state: 'visible' })
await this.enterWorkspaceName(workspaceName)
expect(await this.buttonCreateNewWorkspace().isEnabled()).toBe(true)
await this.buttonCreateNewWorkspace().click()
}
}

View File

@ -4,22 +4,20 @@ import { SignUpData } from './common-types'
export class SignInJoinPage extends CommonPage {
readonly page: Page
readonly inputEmail: Locator
readonly inputPassword: Locator
readonly buttonJoin: Locator
constructor (page: Page) {
super()
super(page)
this.page = page
this.inputEmail = page.locator('input[name="email"]')
this.inputPassword = page.locator('//div[text()="Password"]/../input')
this.buttonJoin = page.locator('button', { hasText: 'Join' })
}
inputEmail = (): Locator => this.page.locator('input[name="email"]')
inputPassword = (): Locator => this.page.locator('//div[text()="Password"]/../input')
buttonJoin = (): Locator => this.page.locator('button', { hasText: 'Join' })
async join (data: Pick<SignUpData, 'email' | 'password'>): Promise<void> {
await this.inputEmail.fill(data.email)
await this.inputPassword.fill(data.password)
expect(await this.buttonJoin.isEnabled()).toBe(true)
await this.buttonJoin.click()
await this.inputEmail().fill(data.email)
await this.inputPassword().fill(data.password)
expect(await this.buttonJoin().isEnabled()).toBe(true)
await this.buttonJoin().click()
}
}

View File

@ -4,40 +4,58 @@ import { CommonPage } from './common-page'
export class SignUpPage extends CommonPage {
readonly page: Page
readonly inputFirstName: Locator
readonly inputLastName: Locator
readonly inputEmail: Locator
readonly inputNewPassword: Locator
readonly inputRepeatPassword: Locator
readonly buttonSignUp: Locator
readonly buttonJoin: Locator
constructor (page: Page) {
super()
super(page)
this.page = page
this.inputFirstName = page.locator('input[name="given-name"]')
this.inputLastName = page.locator('input[name="family-name"]')
this.inputEmail = page.locator('input[name="email"]')
this.inputNewPassword = page.locator('//div[text()="Password"]/../input')
this.inputRepeatPassword = page.locator('//div[text()="Repeat password"]/../input')
this.buttonSignUp = page.locator('button', { hasText: 'Sign Up' })
this.buttonJoin = page.locator('button', { hasText: 'Join' })
}
inputFirstName = (): Locator => this.page.locator('input[name="given-name"]')
inputLastName = (): Locator => this.page.locator('input[name="family-name"]')
inputEmail = (): Locator => this.page.locator('input[name="email"]')
inputNewPassword = (): Locator => this.page.locator('//div[text()="Password"]/../input')
inputRepeatPassword = (): Locator => this.page.locator('//div[text()="Repeat password"]/../input')
buttonSignUp = (): Locator => this.page.locator('button', { hasText: 'Sign Up' })
buttonJoin = (): Locator => this.page.locator('button', { hasText: 'Join' })
async enterFirstName (firstName: string): Promise<void> {
await this.inputFirstName().fill(firstName)
}
async enterLastName (lastName: string): Promise<void> {
await this.inputLastName().fill(lastName)
}
async enterEmail (email: string): Promise<void> {
await this.inputEmail().fill(email)
}
async enterPassword (password: string): Promise<void> {
await this.inputNewPassword().fill(password)
}
async enterRepeatPassword (password: string): Promise<void> {
await this.inputRepeatPassword().fill(password)
}
async clickSignUp (): Promise<void> {
await this.buttonSignUp().click()
}
async signUp (data: SignUpData, mode: 'join' | 'signup' = 'signup'): Promise<void> {
await this.inputFirstName.fill(data.firstName)
await this.inputLastName.fill(data.lastName)
await this.inputEmail.fill(data.email)
await this.inputNewPassword.fill(data.password)
await this.inputRepeatPassword.fill(data.password)
await this.enterFirstName(data.firstName)
await this.enterLastName(data.lastName)
await this.enterEmail(data.email)
await this.enterPassword(data.password)
await this.enterRepeatPassword(data.password)
switch (mode) {
case 'join':
expect(await this.buttonJoin.isEnabled()).toBe(true)
await this.buttonJoin.click()
expect(await this.buttonJoin().isEnabled()).toBe(true)
await this.buttonJoin().click()
break
case 'signup':
expect(await this.buttonSignUp.isEnabled()).toBe(true)
await this.buttonSignUp.click()
expect(await this.buttonSignUp().isEnabled()).toBe(true)
await this.buttonSignUp().click()
}
}
}

View File

@ -4,41 +4,39 @@ import { StatusBar } from './statusbar'
export class SpotlightPopup extends CommonPage {
readonly page: Page
readonly popup: Locator
readonly input: Locator
readonly statusbar: StatusBar
constructor (page: Page) {
super()
super(page)
this.page = page
this.popup = page.locator('div.popup')
this.input = this.popup.locator('input')
this.statusbar = new StatusBar(page)
}
popup = (): Locator => this.page.locator('div.popup')
input = (): Locator => this.popup().locator('input')
searchResult = (search: string): Locator => this.popup().locator('div.list-item', { hasText: search })
async open (): Promise<void> {
const visible = await this.popup.isVisible()
const visible = await this.popup().isVisible()
if (visible) {
await this.close()
}
await this.statusbar.clickButtonSearch()
await expect(this.popup).toBeVisible()
await expect(this.popup()).toBeVisible()
}
async close (): Promise<void> {
await this.page.keyboard.press('Escape')
await expect(this.popup).not.toBeVisible()
await expect(this.popup()).not.toBeVisible()
}
async fillSearchInput (search: string): Promise<void> {
await this.input.fill(search)
await expect(this.input).toHaveValue(search)
await this.input().fill(search)
await expect(this.input()).toHaveValue(search)
await this.page.waitForTimeout(500)
}
async checkSearchResult (search: string, count: number): Promise<void> {
const result = this.popup.locator('div.list-item', { hasText: search })
await expect(result).toHaveCount(count)
await expect(this.searchResult(search)).toHaveCount(count)
}
}

View File

@ -2,28 +2,25 @@ import { Locator, Page } from '@playwright/test'
export class StatusBar {
readonly page: Page
readonly statusbar: Locator
readonly buttonBack: Locator
readonly buttonForward: Locator
readonly buttonSearch: Locator
constructor (page: Page) {
this.page = page
this.statusbar = page.locator('div.antiStatusBar')
this.buttonBack = this.statusbar.locator('button[id="statusbar-back"]')
this.buttonForward = this.statusbar.locator('button[id="statusbar-forward"]')
this.buttonSearch = this.statusbar.locator('button[id="statusbar-search"]')
}
statusbar = (): Locator => this.page.locator('div.antiStatusBar')
buttonBack = (): Locator => this.statusbar().locator('button[id="statusbar-back"]')
buttonForward = (): Locator => this.statusbar().locator('button[id="statusbar-forward"]')
buttonSearch = (): Locator => this.statusbar().locator('button[id="statusbar-search"]')
async clickButtonBack (): Promise<void> {
await this.buttonBack.click()
await this.buttonBack().click()
}
async clickButtonForward (): Promise<void> {
await this.buttonForward.click()
await this.buttonForward().click()
}
async clickButtonSearch (): Promise<void> {
await this.buttonSearch.click()
await this.buttonSearch().click()
}
}

View File

@ -179,7 +179,7 @@ export class CommonTrackerPage extends CalendarPage {
async addMentions (mention: string): Promise<void> {
await this.inputComment().fill(`@${mention}`)
await this.selectMention(this.page, mention)
await this.selectMention(mention)
await this.buttonSendComment().click()
}

View File

@ -67,7 +67,7 @@ export class TemplateDetailsPage extends CommonTrackerPage {
if (data.duedate != null) {
if (data.duedate === 'today') {
await this.buttonDueDate().click()
await this.buttonDatePopupToday.click()
await this.buttonDatePopupToday().click()
} else {
await this.buttonDueDate().click()
await this.buttonSaveDueDate().click()

View File

@ -5,7 +5,7 @@ export class TrackerNavigationMenuPage extends CommonPage {
page: Page
constructor (page: Page) {
super()
super(page)
this.page = page
}

View File

@ -33,7 +33,7 @@ test.describe('Vacancy tests', () => {
await page.click('button:has-text("Application")')
await page.click('form[id="recruit:string:CreateApplication"] [id="vacancy.talant.selector"]')
await new CommonPage().selectAssignee(page, 'Alex')
await new CommonPage(page).selectAssignee(page, 'Alex')
await page.click('form[id="recruit:string:CreateApplication"] button:has-text("Create")')
await page.waitForSelector('form.antiCard', { state: 'detached' })

View File

@ -22,7 +22,7 @@ test.describe('Attachments tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openIssuesForProject('Default')

View File

@ -52,7 +52,7 @@ test.describe('Tracker component tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openComponentsForProject('Default')
@ -78,7 +78,7 @@ test.describe('Tracker component tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openComponentsForProject('Default')

View File

@ -32,7 +32,7 @@ test.describe('Tracker filters tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -130,7 +130,7 @@ test.describe('Tracker filters tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -232,7 +232,7 @@ test.describe('Tracker filters tests', () => {
test('Status filter', async ({ page }) => {
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.linkSidebarAll().click()
@ -252,7 +252,7 @@ test.describe('Tracker filters tests', () => {
test('Priority filter', async ({ page }) => {
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -272,7 +272,7 @@ test.describe('Tracker filters tests', () => {
test('Created by filter', async ({ page }) => {
const createdBy = 'Appleseed John'
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -293,7 +293,7 @@ test.describe('Tracker filters tests', () => {
test('Component filter', async ({ page }) => {
const defaultComponent = 'Default component'
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -316,7 +316,7 @@ test.describe('Tracker filters tests', () => {
const firstSearch = 'issue'
const secondSearch = 'done'
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -344,7 +344,7 @@ test.describe('Tracker filters tests', () => {
test('Modified by filter', async ({ page }) => {
const modifierName = 'Appleseed John'
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -373,7 +373,7 @@ test.describe('Tracker filters tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -416,7 +416,7 @@ test.describe('Tracker filters tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -461,7 +461,7 @@ test.describe('Tracker filters tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()

View File

@ -28,7 +28,7 @@ test.describe('Tracker duplicate issue tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openIssuesForProject('Default')

View File

@ -17,7 +17,7 @@ test.describe('Tracker issue tests', () => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
})
test('Create an issue with all parameters and attachments', async ({ page }) => {

View File

@ -22,7 +22,7 @@ test.describe('Mentions issue tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -44,7 +44,7 @@ test.describe('Mentions issue tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -72,7 +72,7 @@ test.describe('Mentions issue tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()

View File

@ -24,7 +24,7 @@ test.describe('Tracker milestone tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openMilestonesForProject('Default')
@ -47,7 +47,7 @@ test.describe('Tracker milestone tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openMilestonesForProject('Default')
@ -75,7 +75,7 @@ test.describe('Tracker milestone tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openMilestonesForProject('Default')

View File

@ -21,7 +21,7 @@ test.describe('Tracker public link issues tests', () => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
await prepareNewIssueWithOpenStep(page, publicLinkIssue)
const issuesDetailsPage = new IssuesDetailsPage(page)
@ -72,7 +72,7 @@ test.describe('Tracker public link issues tests', () => {
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
await prepareNewIssueWithOpenStep(page, publicLinkIssue)
const issuesDetailsPage = new IssuesDetailsPage(page)

View File

@ -34,7 +34,7 @@ test.describe('Tracker related issue tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()

View File

@ -25,7 +25,7 @@ test.describe('Relations', () => {
description: 'Second. Mark as blocked by'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
const firstIssueId = await prepareNewIssueStep(page, firstIssue)
@ -71,7 +71,7 @@ test.describe('Relations', () => {
description: 'Second. Mark as blocked by'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
const firstIssueId = await prepareNewIssueStep(page, firstIssue)
@ -119,7 +119,7 @@ test.describe('Relations', () => {
description: 'Second. Reference another issue'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
const firstIssueId = await prepareNewIssueStep(page, firstIssue)
@ -165,7 +165,7 @@ test.describe('Relations', () => {
description: 'Second. Remove relation be editing issue details'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
await prepareNewIssueStep(page, firstIssue)

View File

@ -75,7 +75,7 @@ test.describe('Tracker sub-issues tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -112,7 +112,7 @@ test.describe('Tracker sub-issues tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()
@ -152,7 +152,7 @@ test.describe('Tracker sub-issues tests', () => {
const templateName = 'New Issue'
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll().click()

View File

@ -29,7 +29,7 @@ test.describe('Tracker template tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openTemplateForProject('Default')
@ -62,7 +62,7 @@ test.describe('Tracker template tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openTemplateForProject('Default')
@ -117,7 +117,7 @@ test.describe('Tracker template tests', () => {
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openTemplateForProject('Default')

View File

@ -23,7 +23,7 @@ test.describe('Workspace tests', () => {
const loginPage = new LoginPage(page)
await loginPage.goto()
await loginPage.linkSignUp.click()
await loginPage.clickSignUp()
const signUpPage = new SignUpPage(page)
await signUpPage.signUp(newUser)
@ -32,7 +32,7 @@ test.describe('Workspace tests', () => {
await selectWorkspacePage.createWorkspace(newWorkspaceName)
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
})
test('Create a new issue in the workspace with a custom name', async ({ page }) => {
@ -60,7 +60,7 @@ test.describe('Workspace tests', () => {
const loginPage = new LoginPage(page)
await loginPage.goto()
await loginPage.linkSignUp.click()
await loginPage.clickSignUp()
const signUpPage = new SignUpPage(page)
await signUpPage.signUp(newUser)
@ -69,7 +69,7 @@ test.describe('Workspace tests', () => {
await selectWorkspacePage.createWorkspace(newWorkspaceName)
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openIssuesForProject('Default')
@ -99,25 +99,24 @@ test.describe('Workspace tests', () => {
const loginPage = new LoginPage(page)
await loginPage.goto()
await loginPage.linkSignUp.click()
await loginPage.clickSignUp()
const signUpPage = new SignUpPage(page)
await signUpPage.checkInfo(page, 'Required field First name')
await signUpPage.inputFirstName.fill(newUser.firstName)
await signUpPage.enterFirstName(newUser.firstName)
await signUpPage.checkInfo(page, 'Required field Last name')
await signUpPage.inputLastName.fill(newUser.lastName)
await signUpPage.enterLastName(newUser.lastName)
await signUpPage.checkInfo(page, 'Required field Email')
await signUpPage.inputEmail.fill(newUser.email)
await signUpPage.enterEmail(newUser.email)
await signUpPage.checkInfo(page, 'Required field Password')
await signUpPage.inputNewPassword.fill(newUser.password)
await signUpPage.enterPassword(newUser.password)
await signUpPage.checkInfo(page, "Repeat password don't match Password")
await signUpPage.inputRepeatPassword.fill(newUser.password)
await signUpPage.enterRepeatPassword(newUser.password)
await signUpPage.checkInfoSectionNotExist(page)
await signUpPage.buttonSignUp.click()
await signUpPage.clickSignUp()
const selectWorkspacePage = new SelectWorkspacePage(page)
await selectWorkspacePage.checkInfo(page, 'Required field Workspace name')
await selectWorkspacePage.buttonWorkspaceName.fill(newWorkspaceName)
await selectWorkspacePage.enterWorkspaceName(newWorkspaceName)
await selectWorkspacePage.checkInfoSectionNotExist(page)
})
@ -132,7 +131,7 @@ test.describe('Workspace tests', () => {
const loginPage = new LoginPage(page)
await loginPage.goto()
await loginPage.linkSignUp.click()
await loginPage.clickSignUp()
const signUpPage = new SignUpPage(page)
await signUpPage.signUp(newUser)
@ -141,7 +140,7 @@ test.describe('Workspace tests', () => {
await selectWorkspacePage.createWorkspace(newWorkspaceName)
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
// Generate invite link
@ -167,7 +166,7 @@ test.describe('Workspace tests', () => {
await signUpPage2.signUp(newUser2, 'join')
const leftSideMenuPage2 = new LeftSideMenuPage(page2)
await leftSideMenuPage2.buttonTracker.click()
await leftSideMenuPage2.clickTracker()
})
test('Create a workspace with join link - existing account', async ({ page, browser }) => {
@ -181,7 +180,7 @@ test.describe('Workspace tests', () => {
const loginPage = new LoginPage(page)
await loginPage.goto()
await loginPage.linkSignUp.click()
await loginPage.clickSignUp()
const signUpPage = new SignUpPage(page)
await signUpPage.signUp(newUser)
@ -190,7 +189,7 @@ test.describe('Workspace tests', () => {
await selectWorkspacePage.createWorkspace(newWorkspaceName)
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
// Generate invite link
@ -204,7 +203,7 @@ test.describe('Workspace tests', () => {
const loginPage2 = new LoginPage(page2)
await loginPage2.goto()
await loginPage2.linkSignUp.click()
await loginPage2.clickSignUp()
const newUser2: SignUpData = {
firstName: `FirstName2-${generateId()}`,
@ -224,7 +223,7 @@ test.describe('Workspace tests', () => {
await joinPage.join(newUser2)
const leftSideMenuPage2 = new LeftSideMenuPage(page2)
await leftSideMenuPage2.buttonTracker.click()
await leftSideMenuPage2.clickTracker()
})
test('Create workspace with LastToken in the localStorage', async ({ page, browser }) => {
@ -236,7 +235,7 @@ test.describe('Workspace tests', () => {
await selectWorkspacePage.selectWorkspace(DefaultWorkspace)
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
await leftSideMenuPage.clickTracker()
const lastToken = await page.evaluate(() => localStorage.getItem('login:metadata:LastToken') ?? '')
expect(lastToken).not.toEqual('')
@ -255,7 +254,7 @@ test.describe('Workspace tests', () => {
await selectWorkspacePageSecond.createWorkspace(newWorkspaceName)
const leftSideMenuPageSecond = new LeftSideMenuPage(pageSecond)
await leftSideMenuPageSecond.buttonTracker.click()
await leftSideMenuPageSecond.clickTracker()
})
})
})