|
|
|
|
@ -1,3 +1,10 @@
|
|
|
|
|
/**
|
|
|
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { basename } from 'path'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the header navigation bar
|
|
|
|
|
*/
|
|
|
|
|
@ -44,8 +51,12 @@ export function installTestApp() {
|
|
|
|
|
cy.runOccCommand('-V').then((output) => {
|
|
|
|
|
const version = output.stdout.match(/(\d\d+)\.\d+\.\d+/)?.[1]
|
|
|
|
|
cy.wrap(version).should('not.be.undefined')
|
|
|
|
|
cy.exec(`docker cp '${testAppPath}' nextcloud-cypress-tests-server:/var/www/html/apps`, { log: true })
|
|
|
|
|
cy.exec(`docker exec nextcloud-cypress-tests-server sed -i -e 's|-version="[0-9]\\+|-version="${version}|g' apps/testapp/appinfo/info.xml`)
|
|
|
|
|
getContainerName()
|
|
|
|
|
.then(containerName => {
|
|
|
|
|
cy.exec(`docker cp '${testAppPath}' ${containerName}:/var/www/html/apps`, { log: true })
|
|
|
|
|
cy.exec(`docker exec --workdir /var/www/html ${containerName} chown -R www-data:www-data /var/www/html/apps/testapp`)
|
|
|
|
|
})
|
|
|
|
|
cy.runCommand(`sed -i -e 's|-version=\\"[0-9]\\+|-version=\\"${version}|g' apps/testapp/appinfo/info.xml`)
|
|
|
|
|
cy.runOccCommand('app:enable --force testapp')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
@ -55,5 +66,15 @@ export function installTestApp() {
|
|
|
|
|
*/
|
|
|
|
|
export function uninstallTestApp() {
|
|
|
|
|
cy.runOccCommand('app:remove testapp', { failOnNonZeroExit: false })
|
|
|
|
|
cy.exec('docker exec nextcloud-cypress-tests-server rm -fr apps/testapp/appinfo/info.xml')
|
|
|
|
|
cy.runCommand('rm -fr apps/testapp/appinfo/info.xml')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function getContainerName(): Cypress.Chainable<string> {
|
|
|
|
|
return cy.exec('pwd')
|
|
|
|
|
.then(({ stdout }) => {
|
|
|
|
|
return cy.wrap(`nextcloud-cypress-tests_${basename(stdout).replace(' ', '')}`)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|