TESTS-17: feat(tests): done Delete a Company test (#4252)

This commit is contained in:
Alex Velichko 2023-12-25 07:00:00 +03:00 committed by GitHub
parent b8464be5bf
commit c67ea2f366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View File

@ -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)
}
}

View File

@ -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' })
}

View File

@ -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)
})
})