|
10 | 10 | * See the License for the specific language governing permissions and |
11 | 11 | * limitations under the License. |
12 | 12 | */ |
13 | | -import test, { expect, Page, Request } from '@playwright/test'; |
| 13 | +import test, { expect } from '@playwright/test'; |
14 | 14 | import { TableClass } from '../../../support/entity/TableClass'; |
15 | 15 | import { TagClass } from '../../../support/tag/TagClass'; |
16 | 16 | import { createNewPage } from '../../../utils/common'; |
17 | | -import { goToDataQualityDashboard } from '../../../utils/dataQuality'; |
| 17 | +import { |
| 18 | + captureReports, |
| 19 | + goToDataQualityDashboard, |
| 20 | +} from '../../../utils/dataQuality'; |
18 | 21 | import { waitForAllLoadersToDisappear } from '../../../utils/entity'; |
19 | 22 |
|
20 | 23 | test.use({ |
21 | 24 | storageState: 'playwright/.auth/admin.json', |
22 | 25 | }); |
23 | 26 |
|
24 | | -const certTable = new TableClass(); |
25 | | -const cert = new TagClass({ classification: 'Certification' }); |
| 27 | +let certTable: TableClass; |
| 28 | +let cert: TagClass; |
26 | 29 |
|
27 | 30 | test.beforeAll('setup', async ({ browser }) => { |
| 31 | + certTable = new TableClass(); |
| 32 | + cert = new TagClass({ classification: 'Certification' }); |
| 33 | + |
28 | 34 | const { apiContext, afterAction } = await createNewPage(browser); |
29 | 35 |
|
30 | 36 | await cert.create(apiContext); |
@@ -60,33 +66,6 @@ test.beforeAll('setup', async ({ browser }) => { |
60 | 66 | await afterAction(); |
61 | 67 | }); |
62 | 68 |
|
63 | | -test.afterAll('cleanup', async ({ browser }) => { |
64 | | - const { apiContext, afterAction } = await createNewPage(browser); |
65 | | - |
66 | | - await certTable.delete(apiContext); |
67 | | - await cert.delete(apiContext); |
68 | | - |
69 | | - await afterAction(); |
70 | | -}); |
71 | | - |
72 | | -function captureReports( |
73 | | - page: Page |
74 | | -): { url: string; q: string; index: string }[] { |
75 | | - const captured: { url: string; q: string; index: string }[] = []; |
76 | | - page.on('request', (req: Request) => { |
77 | | - const url = req.url(); |
78 | | - if (url.includes('/dataQualityReport')) { |
79 | | - const u = new URL(url); |
80 | | - captured.push({ |
81 | | - url, |
82 | | - q: u.searchParams.get('q') ?? '', |
83 | | - index: u.searchParams.get('index') ?? '', |
84 | | - }); |
85 | | - } |
86 | | - }); |
87 | | - return captured; |
88 | | -} |
89 | | - |
90 | 69 | test('Certification filter is rendered between Tier and Tag in the filter row', async ({ |
91 | 70 | page, |
92 | 71 | }) => { |
|
0 commit comments