test: mock appstore response in Cypress tests

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/55435/head
Ferdinand Thiessen 3 months ago committed by backportbot[bot]
parent 51a9df8e83
commit bdb7389e63
  1. 2
      REUSE.toml
  2. 3
      cypress/e2e/core/setup.ts
  3. 46
      cypress/fixtures/appstore/apps.json

@ -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)

@ -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…
Cancel
Save