Skip to content

Commit

Permalink
Merge pull request #2482 from nextcloud/refactor/use-getContainer
Browse files Browse the repository at this point in the history
test(playwright): use getContainer from @nextcloud/cypress/docker
  • Loading branch information
Chartman123 authored Jan 7, 2025
2 parents f2e9736 + ed188d9 commit ab3bd5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions playwright/support/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { test as setup } from '@playwright/test'
import { configureNextcloud, docker } from '@nextcloud/cypress/docker'
import { configureNextcloud, getContainer } from '@nextcloud/cypress/docker'

/**
* We use this to ensure Nextcloud is configured correctly before running our tests
Expand All @@ -13,7 +13,5 @@ import { configureNextcloud, docker } from '@nextcloud/cypress/docker'
* as that only checks for the URL to be accessible which happens already before everything is configured.
*/
setup('Configure Nextcloud', async () => {
const containerName = 'nextcloud-cypress-tests_forms'
const container = docker.getContainer(containerName)
await configureNextcloud(['forms', 'viewer'], undefined, container)
await configureNextcloud(['forms', 'viewer'], undefined, getContainer())
})
5 changes: 2 additions & 3 deletions playwright/support/utils/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { docker } from '@nextcloud/cypress/docker'
import { getContainer } from '@nextcloud/cypress/docker'
import { expect, type APIRequestContext } from '@playwright/test'

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

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

0 comments on commit ab3bd5f

Please sign in to comment.