Skip to content

Commit

Permalink
Merge pull request #731 from nextcloud-libraries/test/docker-commands
Browse files Browse the repository at this point in the history
test cy.runCommand and cy.runOccCommand
  • Loading branch information
max-nextcloud authored Jan 8, 2025
2 parents 96ddd91 + fed018f commit 4827fbb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cypress/e2e/docker.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

describe('Run command', function() {

it('yields the output as stdout', function() {
cy.runCommand('ls')
.its('stdout')
.should('contain', 'data')
})

it('hands on the env', function() {
cy.runCommand('env', { env: { DATA: 'Hello' } })
.its('stdout')
.should('contain', 'DATA')
.should('contain', 'Hello')
})

})
14 changes: 14 additions & 0 deletions cypress/e2e/occ.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

describe('Run occ command', function() {
it('yields the output as stdout', function() {
cy.runOccCommand('app:list')
.its('stdout')
.should('contain', 'Enabled:')
.should('contain', 'files:')
.should('contain', 'settings:')
})
})

0 comments on commit 4827fbb

Please sign in to comment.