mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
TESTS-17: feat(tests): done Delete a Company test (#4252)
This commit is contained in:
parent
b8464be5bf
commit
c67ea2f366
@ -40,4 +40,8 @@ export class CompaniesPage extends CommonRecruitingPage {
|
||||
async openCompanyByName (companyName: string): Promise<void> {
|
||||
await this.page.locator('tr a', { hasText: companyName }).click()
|
||||
}
|
||||
|
||||
async checkCompanyNotExist (companyName: string): Promise<void> {
|
||||
await expect(this.page.locator('tr a', { hasText: companyName })).toHaveCount(0)
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
readonly buttonDueDate: Locator
|
||||
readonly buttonSaveDueDate: Locator
|
||||
readonly textComment: Locator
|
||||
readonly buttonMoreActions: Locator
|
||||
readonly buttonDelete: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
@ -32,7 +31,6 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
this.buttonDueDate = page.locator('(//span[text()="Due date"]/../div/button)[2]')
|
||||
this.buttonSaveDueDate = page.locator('div.footer > button')
|
||||
this.textComment = page.locator('div.grid div.header')
|
||||
this.buttonMoreActions = page.locator('div.popupPanel-title > div > button:nth-child(1)')
|
||||
this.buttonDelete = page.locator('button[class*="menuItem"] > span', { hasText: 'Delete' })
|
||||
}
|
||||
|
||||
|
@ -78,4 +78,24 @@ test.describe('Companies tests', () => {
|
||||
await companyDetailsPage.editCompany(editCompany)
|
||||
await companyDetailsPage.checkCompany(editCompany)
|
||||
})
|
||||
|
||||
test('Delete a Company', async ({ page }) => {
|
||||
const deleteCompany: NewCompany = {
|
||||
name: `Delete Company-${generateId()}`
|
||||
}
|
||||
|
||||
const navigationMenuPage = new NavigationMenuPage(page)
|
||||
await navigationMenuPage.buttonCompanies.click()
|
||||
|
||||
const companiesPage = new CompaniesPage(page)
|
||||
await companiesPage.createNewCompany(deleteCompany)
|
||||
await companiesPage.openCompanyByName(deleteCompany.name)
|
||||
|
||||
const companyDetailsPage = new CompanyDetailsPage(page)
|
||||
await companyDetailsPage.checkCompany(deleteCompany)
|
||||
await companyDetailsPage.deleteEntity()
|
||||
|
||||
await navigationMenuPage.buttonCompanies.click()
|
||||
await companiesPage.checkCompanyNotExist(deleteCompany.name)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user