Skip to content

Commit e840eda

Browse files
fix(playwright): stop test helper from managing Java/PDFtk config
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent b0e0bce commit e840eda

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

playwright/support/nc-provisioning.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ type SignatureElementResponse = {
2727
}>
2828
}
2929

30-
async function ocsRequest(
30+
async function ocsRequest<T = unknown>(
3131
request: APIRequestContext,
3232
method: 'GET' | 'POST' | 'PUT' | 'DELETE',
3333
path: string,
3434
adminUser = process.env.NEXTCLOUD_ADMIN_USER ?? 'admin',
3535
adminPassword = process.env.NEXTCLOUD_ADMIN_PASSWORD ?? 'admin',
3636
body?: Record<string, string>,
3737
jsonBody?: unknown,
38-
): Promise<OcsResponse> {
38+
): Promise<OcsResponse<T>> {
3939
const url = `./ocs/v2.php${path}`
4040
const auth = 'Basic ' + Buffer.from(`${adminUser}:${adminPassword}`).toString('base64')
4141
const headers: Record<string, string> = {
@@ -59,9 +59,9 @@ async function ocsRequest(
5959

6060
const text = await response.text()
6161
if (!text) {
62-
return { ocs: { meta: { status: 'ok', statuscode: response.status(), message: '' }, data: {} } } as OcsResponse
62+
return { ocs: { meta: { status: 'ok', statuscode: response.status(), message: '' }, data: {} as T } }
6363
}
64-
return JSON.parse(text) as OcsResponse
64+
return JSON.parse(text) as OcsResponse<T>
6565
}
6666

6767
export async function clearSignatureElements(
@@ -151,19 +151,6 @@ export async function setAppConfig(
151151
}
152152
}
153153

154-
/**
155-
* Ensures Java/PDFtk app config paths are present for Java-dependent signing stages
156-
* (for example footer stamping) regardless of selected signature engine.
157-
*/
158-
export async function ensureJavaDependenciesConfigured(
159-
request: APIRequestContext,
160-
javaPath = process.env.LIBRESIGN_JAVA_PATH ?? '/usr/bin/java',
161-
pdftkPath = process.env.LIBRESIGN_PDFTK_PATH ?? '/usr/bin/pdftk',
162-
): Promise<void> {
163-
await setAppConfig(request, 'libresign', 'java_path', javaPath)
164-
await setAppConfig(request, 'libresign', 'pdftk_path', pdftkPath)
165-
}
166-
167154
/**
168155
* Deletes an app config value.
169156
* Equivalent to: `occ config:app:delete <appId> <key>`

0 commit comments

Comments
 (0)