Skip to content

Commit a30f0ed

Browse files
Merge pull request #30 from owncloud/setup-e2e-test-CI
setup E2E test in drone CI
2 parents 1679052 + 0fe72c3 commit a30f0ed

File tree

4 files changed

+171
-2
lines changed

4 files changed

+171
-2
lines changed

.drone.star

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
OC_CI_NODEJS = "owncloudci/nodejs:18"
22
OC_CI_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
33
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:5.0"
4+
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
5+
OCIS_IMAGE = "owncloud/ocis:5.0.0-rc.6"
6+
7+
dir = {
8+
"webConfig": "/drone/src/tests/drone/web.config.json",
9+
}
410

511
def main(ctx):
6-
return checkStarlark() + unitTestPipeline(ctx)
12+
return checkStarlark() + unitTestPipeline(ctx) + e2eTests()
713

814
def checkStarlark():
915
return [{
@@ -89,3 +95,102 @@ def installPnpm():
8995
"pnpm install",
9096
],
9197
}]
98+
99+
def serveExtension():
100+
return [
101+
{
102+
"name": "generate-certs",
103+
"image": OC_CI_NODEJS,
104+
"commands": [
105+
"mkdir -p dev/docker/traefik/certificates",
106+
"cd dev/docker/traefik/certificates",
107+
"openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -nodes -days 365 -subj '/CN=extension'",
108+
],
109+
},
110+
{
111+
"name": "extension",
112+
"image": OC_CI_NODEJS,
113+
"detach": True,
114+
"commands": [
115+
"pnpm build:w",
116+
],
117+
},
118+
]
119+
120+
def installBrowsers():
121+
return [{
122+
"name": "install-browsers",
123+
"image": OC_CI_NODEJS,
124+
"environment": {
125+
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
126+
},
127+
"commands": [
128+
"pnpm exec playwright install --with-deps chromium",
129+
],
130+
}]
131+
132+
def e2eTests():
133+
environment = {
134+
"HEADLESS": "true",
135+
"retry": "1",
136+
"BASE_URL_OCIS": "https://ocis:9200",
137+
}
138+
139+
return [{
140+
"kind": "pipeline",
141+
"type": "docker",
142+
"name": "e2e-tests",
143+
"depends_on": ["check-starlark", "unit-tests"],
144+
"steps": installPnpm() +
145+
installBrowsers() +
146+
serveExtension() +
147+
ocisService() +
148+
[
149+
{
150+
"name": "e2e-tests",
151+
"image": OC_CI_NODEJS,
152+
"environment": environment,
153+
"commands": [
154+
"pnpm run test:e2e tests/e2e/features/*.feature",
155+
],
156+
},
157+
],
158+
"trigger": {
159+
"ref": [
160+
"refs/heads/main",
161+
"refs/pull/**",
162+
],
163+
},
164+
}]
165+
166+
def ocisService():
167+
environment = {
168+
"IDM_ADMIN_PASSWORD": "admin",
169+
"OCIS_INSECURE": True,
170+
"OCIS_LOG_LEVEL": "error",
171+
"OCIS_URL": "https://ocis:9200",
172+
"PROXY_ENABLE_BASIC_AUTH": True,
173+
"WEB_UI_CONFIG_FILE": "%s" % dir["webConfig"],
174+
}
175+
176+
return [
177+
{
178+
"type": "docker",
179+
"name": "ocis",
180+
"image": OCIS_IMAGE,
181+
"detach": True,
182+
"environment": environment,
183+
"commands": [
184+
"cd /usr/bin",
185+
"ocis init",
186+
"ocis server",
187+
],
188+
},
189+
{
190+
"name": "wait-for-ocis-server",
191+
"image": OC_CI_WAIT_FOR,
192+
"commands": [
193+
"wait-for -it ocis:9200 -t 300",
194+
],
195+
},
196+
]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ tests/acceptance/report/cucumber_report.html
6868
/dev/docker/ocis-ca
6969
/dev/docker/traefik/certificates
7070
docker-compose.override.yml
71+
72+
.playwright

src/components/VipMetadataOverlay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div id="dicom-viewer-vip-metadata" class="oc-position-absolute" >
33
<div class="oc-pr-s oc-font-semibold">
4-
<span>{{ patientName || patientNameNotDefined }}, </span>
4+
<span>{{ patientName || patientNameNotDefined }}</span>,
55
<span>*{{ patientBirthdate || birthdateNotDefined }}</span>
66
</div>
77
<div class="oc-pr-s oc-font-semibold">

tests/drone/web.config.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"server": "https://ocis:9200",
3+
"theme": "https://ocis:9200/themes/owncloud/theme.json",
4+
"openIdConnect": {
5+
"metadata_url": "https://ocis:9200/.well-known/openid-configuration",
6+
"authority": "https://ocis:9200",
7+
"client_id": "web",
8+
"response_type": "code",
9+
"scope": "openid profile email"
10+
},
11+
"options": {
12+
"topCenterNotifications": true,
13+
"disablePreviews": true,
14+
"displayResourcesLazy": false,
15+
"sidebar": {
16+
"shares": {
17+
"showAllOnLoad": true
18+
}
19+
},
20+
"previewFileMimeTypes": [
21+
"image/gif",
22+
"image/png",
23+
"image/jpeg",
24+
"text/plain",
25+
"image/tiff",
26+
"image/bmp",
27+
"image/x-ms-bmp"
28+
],
29+
"contextHelpersReadMore": true
30+
},
31+
"apps": [
32+
"files",
33+
"text-editor",
34+
"pdf-viewer",
35+
"search",
36+
"external",
37+
"admin-settings",
38+
"ocm",
39+
"webfinger"
40+
],
41+
"external_apps": [
42+
{
43+
"id": "preview",
44+
"path": "web-app-preview",
45+
"config": {
46+
"mimeTypes": ["image/tiff", "image/bmp", "image/x-ms-bmp"]
47+
}
48+
},
49+
{
50+
"id": "dicom-viewer",
51+
"path": "https://extension:9999/js/web-app-dicom-viewer.js",
52+
"config": {
53+
"mimeTypes": [
54+
"application/dicom",
55+
"application/octet-stream",
56+
"application/dicom+xml",
57+
"application/json"
58+
]
59+
}
60+
}
61+
]
62+
}

0 commit comments

Comments
 (0)