mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
29 lines
793 B
TypeScript
29 lines
793 B
TypeScript
import { test as base, chromium, type BrowserContext, type Page } from '@playwright/test'
|
|
import path from 'path'
|
|
|
|
const EXTENSION_PATH = path.resolve(__dirname, '..', 'dist')
|
|
|
|
export const test = base.extend<{
|
|
context: BrowserContext
|
|
extensionPage: Page
|
|
}>({
|
|
// eslint-disable-next-line no-empty-pattern
|
|
context: async ({}, use) => {
|
|
const context = await chromium.launchPersistentContext('', {
|
|
headless: false,
|
|
args: [
|
|
`--no-sandbox`,
|
|
`--disable-extensions-except=${EXTENSION_PATH}`,
|
|
`--load-extension=${EXTENSION_PATH}`,
|
|
],
|
|
})
|
|
await use(context)
|
|
await context.close()
|
|
},
|
|
extensionPage: async ({ context }, use) => {
|
|
const page = await context.newPage()
|
|
await use(page)
|
|
},
|
|
})
|
|
|
|
export const expect = test.expect
|