|
| 1 | +import { test, expect } from '@playwright/test'; |
| 2 | +import { LoginPage } from '../../../../Page objects/Login.page'; |
| 3 | +import { WorkflowCasesPage } from '../WorkflowCases.page'; |
| 4 | + |
| 5 | +let page; |
| 6 | + |
| 7 | +test.describe('Workflow cases - Filtration', () => { |
| 8 | + test.beforeAll(async ({ browser }) => { |
| 9 | + page = await browser.newPage(); |
| 10 | + const loginPage = new LoginPage(page); |
| 11 | + await loginPage.open('/auth'); |
| 12 | + await loginPage.login(); |
| 13 | + const workflowCasesPage = new WorkflowCasesPage(page); |
| 14 | + await workflowCasesPage.goToWorkflowCasesPage(); |
| 15 | + }); |
| 16 | + |
| 17 | + test.afterAll(async () => { |
| 18 | + await page.close(); |
| 19 | + }); |
| 20 | + |
| 21 | + test('should be able to filtration of all workflow cases', async () => { |
| 22 | + const workflowCasesPage = new WorkflowCasesPage(page); |
| 23 | + await workflowCasesPage.searchInput().fill('9971c397-61a9-4b6d-aa68-38bf30123360'); |
| 24 | + await page.waitForTimeout(2000); |
| 25 | + await page.locator('#spinner-animation').waitFor({ state: 'hidden', timeout: 90000 }).catch(() => {}); |
| 26 | + const findWorkflowCase = await workflowCasesPage.getFirstWorkflowCase(); |
| 27 | + expect(findWorkflowCase.id).toBe(3); |
| 28 | + expect(findWorkflowCase.dateOfIncident).toBe('26.06.2021'); |
| 29 | + expect(findWorkflowCase.incidentType).toBe('9971c397-61a9-4b6d-aa68-38bf30123360'); |
| 30 | + expect(findWorkflowCase.incidentPlace).toBe('d23fa495-e8d0-4545-840d-62446f16fe99'); |
| 31 | + expect(findWorkflowCase.description).toBe('b4068568-4bc5-405a-a92f-7d4a3080fc6b'); |
| 32 | + expect(findWorkflowCase.deadline).toBe('01.07.2021'); |
| 33 | + expect(findWorkflowCase.actionPlan).toBe('591f85e9-bd96-4ed2-9041-ce6d335e79fb'); |
| 34 | + expect(findWorkflowCase.toBeSolvedBy).toBe('--'); |
| 35 | + expect(findWorkflowCase.status).toBe('Igangværende'); |
| 36 | + }); |
| 37 | +}); |
0 commit comments