Skip to content

Commit ab3bd5f

Browse files
authored
Merge pull request #2482 from nextcloud/refactor/use-getContainer
test(playwright): use getContainer from @nextcloud/cypress/docker
2 parents f2e9736 + ed188d9 commit ab3bd5f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

playwright/support/setup.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { test as setup } from '@playwright/test'
7-
import { configureNextcloud, docker } from '@nextcloud/cypress/docker'
7+
import { configureNextcloud, getContainer } from '@nextcloud/cypress/docker'
88

99
/**
1010
* We use this to ensure Nextcloud is configured correctly before running our tests
@@ -13,7 +13,5 @@ import { configureNextcloud, docker } from '@nextcloud/cypress/docker'
1313
* as that only checks for the URL to be accessible which happens already before everything is configured.
1414
*/
1515
setup('Configure Nextcloud', async () => {
16-
const containerName = 'nextcloud-cypress-tests_forms'
17-
const container = docker.getContainer(containerName)
18-
await configureNextcloud(['forms', 'viewer'], undefined, container)
16+
await configureNextcloud(['forms', 'viewer'], undefined, getContainer())
1917
})

playwright/support/utils/session.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import { docker } from '@nextcloud/cypress/docker'
6+
import { getContainer } from '@nextcloud/cypress/docker'
77
import { expect, type APIRequestContext } from '@playwright/test'
88

99
/**
@@ -22,8 +22,7 @@ export async function runShell(
2222
env?: Record<string, string | number>
2323
},
2424
) {
25-
const containerName = 'nextcloud-cypress-tests_forms'
26-
const container = docker.getContainer(containerName)
25+
const container = getContainer()
2726

2827
const exec = await container.exec({
2928
Cmd: ['sh', '-c', command],

0 commit comments

Comments
 (0)