mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
test: mock appstore response in Cypress tests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
464d12e149
commit
85271b95f6
3 changed files with 50 additions and 1 deletions
|
|
@ -178,7 +178,7 @@ SPDX-FileCopyrightText = "2020 Nextcloud GmbH and Nextcloud contributors"
|
|||
SPDX-License-Identifier = "AGPL-3.0-or-later"
|
||||
|
||||
[[annotations]]
|
||||
path = ["cypress/tsconfig.json", "dist/icons.css"]
|
||||
path = ["cypress/tsconfig.json", "cypress/fixtures/appstore/apps.json", "dist/icons.css"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "2022 Nextcloud GmbH and Nextcloud contributors"
|
||||
SPDX-License-Identifier = "AGPL-3.0-or-later"
|
||||
|
|
|
|||
|
|
@ -113,6 +113,9 @@ describe('Can install Nextcloud', { testIsolation: true, retries: 0 }, () => {
|
|||
function sharedSetup() {
|
||||
const randAdmin = 'admin-' + Math.random().toString(36).substring(2, 15)
|
||||
|
||||
// mock appstore
|
||||
cy.intercept('**/settings/apps/list', { fixture: 'appstore/apps.json' })
|
||||
|
||||
// Fill in the form
|
||||
cy.get('[data-cy-setup-form-field="adminlogin"]').type(randAdmin)
|
||||
cy.get('[data-cy-setup-form-field="adminpass"]').type(randAdmin)
|
||||
|
|
|
|||
46
cypress/fixtures/appstore/apps.json
Normal file
46
cypress/fixtures/appstore/apps.json
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"apps": [
|
||||
{
|
||||
"id": "calendar",
|
||||
"name": "Calendar",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
},
|
||||
{
|
||||
"id": "contacts",
|
||||
"name": "Contacts",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
},
|
||||
{
|
||||
"id": "mail",
|
||||
"name": "Mail",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
},
|
||||
{
|
||||
"id": "spreed",
|
||||
"name": "Talk",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
},
|
||||
{
|
||||
"id": "richdocuments",
|
||||
"name": "Richdocuments",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
},
|
||||
{
|
||||
"id": "notes",
|
||||
"name": "Notes",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
},
|
||||
{
|
||||
"id": "richdocumentscode",
|
||||
"name": "Richdocuments Code",
|
||||
"isCompatible": true,
|
||||
"canInstall": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue