platform/qms-tests/sanity/tests/model/documents/document-approvals-page.ts
Alexey Zinoviev 8163a30b77
EZQMS-1109: Add signature details for reviews/approvals (#6111)
* ezqms-1109: add signature details for reviews/approvals
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
2024-07-23 11:09:54 +07:00

27 lines
785 B
TypeScript

import { type Page, expect } from '@playwright/test'
import { DocumentCommonPage } from './document-common-page'
export class DocumentApprovalsPage extends DocumentCommonPage {
readonly page: Page
constructor (page: Page) {
super(page)
this.page = page
}
async checkRejectApproval (approvalName: string, message: string): Promise<void> {
await expect(
this.page
.locator('div.reject-message', { hasText: message })
.locator('xpath=..')
.locator('div.approver span.ap-label')
).toHaveText(approvalName)
}
async checkSuccessApproval (approvalName: string): Promise<void> {
await expect(this.page.locator('svg[fill*="accepted"]').locator('xpath=../..').locator('span.ap-label')).toHaveText(
approvalName
)
}
}