Skip to content

Commit 85271b9

Browse files
committed
test: mock appstore response in Cypress tests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 464d12e commit 85271b9

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ SPDX-FileCopyrightText = "2020 Nextcloud GmbH and Nextcloud contributors"
178178
SPDX-License-Identifier = "AGPL-3.0-or-later"
179179

180180
[[annotations]]
181-
path = ["cypress/tsconfig.json", "dist/icons.css"]
181+
path = ["cypress/tsconfig.json", "cypress/fixtures/appstore/apps.json", "dist/icons.css"]
182182
precedence = "aggregate"
183183
SPDX-FileCopyrightText = "2022 Nextcloud GmbH and Nextcloud contributors"
184184
SPDX-License-Identifier = "AGPL-3.0-or-later"

cypress/e2e/core/setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ describe('Can install Nextcloud', { testIsolation: true, retries: 0 }, () => {
113113
function sharedSetup() {
114114
const randAdmin = 'admin-' + Math.random().toString(36).substring(2, 15)
115115

116+
// mock appstore
117+
cy.intercept('**/settings/apps/list', { fixture: 'appstore/apps.json' })
118+
116119
// Fill in the form
117120
cy.get('[data-cy-setup-form-field="adminlogin"]').type(randAdmin)
118121
cy.get('[data-cy-setup-form-field="adminpass"]').type(randAdmin)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"apps": [
3+
{
4+
"id": "calendar",
5+
"name": "Calendar",
6+
"isCompatible": true,
7+
"canInstall": true
8+
},
9+
{
10+
"id": "contacts",
11+
"name": "Contacts",
12+
"isCompatible": true,
13+
"canInstall": true
14+
},
15+
{
16+
"id": "mail",
17+
"name": "Mail",
18+
"isCompatible": true,
19+
"canInstall": true
20+
},
21+
{
22+
"id": "spreed",
23+
"name": "Talk",
24+
"isCompatible": true,
25+
"canInstall": true
26+
},
27+
{
28+
"id": "richdocuments",
29+
"name": "Richdocuments",
30+
"isCompatible": true,
31+
"canInstall": true
32+
},
33+
{
34+
"id": "notes",
35+
"name": "Notes",
36+
"isCompatible": true,
37+
"canInstall": true
38+
},
39+
{
40+
"id": "richdocumentscode",
41+
"name": "Richdocuments Code",
42+
"isCompatible": true,
43+
"canInstall": true
44+
}
45+
]
46+
}

0 commit comments

Comments
 (0)