forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestionnaires.spec.js
More file actions
37 lines (28 loc) · 1.22 KB
/
questionnaires.spec.js
File metadata and controls
37 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { test, expect } = require('@playwright/test')
const viewports = require('../../helpers/viewports')
// ====================================================================
// NOMCOM - QUESTIONNAIRES
// ====================================================================
test.describe('expertise', () => {
test.beforeEach(async ({ page }) => {
await page.setViewportSize({
width: viewports.desktop[0],
height: viewports.desktop[1]
})
await page.goto('/nomcom/2021/questionnaires/')
})
test('position tabs should display the appropriate panel on click', async ({ page }) => {
const tabsLocator = page.locator('.nomcom-questnr-positions-tabs > li > button')
const tabsCount = await tabsLocator.count()
expect(tabsCount).toBeGreaterThan(0)
for (let idx = 0; idx < tabsCount; idx++) {
await tabsLocator.nth(idx).click()
await expect(tabsLocator.nth(idx)).toHaveClass(/active/)
const targetId = await tabsLocator.nth(idx).getAttribute('data-bs-target')
const paneLocator = page.locator(targetId)
await expect(paneLocator).toBeVisible()
await expect(paneLocator).toHaveClass(/tab-pane/)
await expect(paneLocator).toHaveClass(/active/)
}
})
})