|
29 | 29 | DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0 |
30 | 30 | # Tell Cypress to run e2e tests using the same UI URL |
31 | 31 | CYPRESS_BASE_URL: http://127.0.0.1:4000 |
| 32 | + # Disable the cookie consent banner in e2e tests to avoid errors because of elements hidden by it |
| 33 | + DSPACE_INFO_ENABLECOOKIECONSENTPOPUP: false |
32 | 34 | # When Chrome version is specified, we pin to a specific version of Chrome |
33 | 35 | # Comment this out to use the latest release |
34 | 36 | #CHROME_VERSION: "90.0.4430.212-1" |
@@ -184,12 +186,115 @@ jobs: |
184 | 186 | # Get homepage and verify that the <meta name="title"> tag includes "DSpace". |
185 | 187 | # If it does, then SSR is working, as this tag is created by our MetadataService. |
186 | 188 | # This step also prints entire HTML of homepage for easier debugging if grep fails. |
187 | | - - name: Verify SSR (server-side rendering) |
| 189 | + - name: Verify SSR (server-side rendering) on Homepage |
188 | 190 | run: | |
189 | 191 | result=$(wget -O- -q http://127.0.0.1:4000/home) |
190 | 192 | echo "$result" |
191 | 193 | echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace |
192 | 194 |
|
| 195 | + # Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name). |
| 196 | + # If it does, then SSR is working. |
| 197 | + - name: Verify SSR on a Community page |
| 198 | + run: | |
| 199 | + result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4) |
| 200 | + echo "$result" |
| 201 | + echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Publications |
| 202 | +
|
| 203 | + # Get a specific collection in our test data and verify that the "<h1>" tag includes "Articles" (the collection name). |
| 204 | + # If it does, then SSR is working. |
| 205 | + - name: Verify SSR on a Collection page |
| 206 | + run: | |
| 207 | + result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200) |
| 208 | + echo "$result" |
| 209 | + echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Articles |
| 210 | +
|
| 211 | + # Get a specific publication in our test data and verify that the <meta name="title"> tag includes |
| 212 | + # the title of this publication. If it does, then SSR is working. |
| 213 | + - name: Verify SSR on a Publication page |
| 214 | + run: | |
| 215 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/publication/6160810f-1e53-40db-81ef-f6621a727398) |
| 216 | + echo "$result" |
| 217 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "An Economic Model of Mortality Salience" |
| 218 | +
|
| 219 | + # Get a specific person in our test data and verify that the <meta name="title"> tag includes |
| 220 | + # the name of the person. If it does, then SSR is working. |
| 221 | + - name: Verify SSR on a Person page |
| 222 | + run: | |
| 223 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/person/b1b2c768-bda1-448a-a073-fc541e8b24d9) |
| 224 | + echo "$result" |
| 225 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Simmons, Cameron" |
| 226 | +
|
| 227 | + # Get a specific project in our test data and verify that the <meta name="title"> tag includes |
| 228 | + # the name of the project. If it does, then SSR is working. |
| 229 | + - name: Verify SSR on a Project page |
| 230 | + run: | |
| 231 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/project/46ccb608-a74c-4bf6-bc7a-e29cc7defea9) |
| 232 | + echo "$result" |
| 233 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "University Research Fellowship" |
| 234 | +
|
| 235 | + # Get a specific orgunit in our test data and verify that the <meta name="title"> tag includes |
| 236 | + # the name of the orgunit. If it does, then SSR is working. |
| 237 | + - name: Verify SSR on an OrgUnit page |
| 238 | + run: | |
| 239 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/orgunit/9851674d-bd9a-467b-8d84-068deb568ccf) |
| 240 | + echo "$result" |
| 241 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Law and Development" |
| 242 | +
|
| 243 | + # Get a specific journal in our test data and verify that the <meta name="title"> tag includes |
| 244 | + # the name of the journal. If it does, then SSR is working. |
| 245 | + - name: Verify SSR on a Journal page |
| 246 | + run: | |
| 247 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/journal/d4af6c3e-53d0-4757-81eb-566f3b45d63a) |
| 248 | + echo "$result" |
| 249 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental & Architectural Phenomenology" |
| 250 | +
|
| 251 | + # Get a specific journal volume in our test data and verify that the <meta name="title"> tag includes |
| 252 | + # the name of the volume. If it does, then SSR is working. |
| 253 | + - name: Verify SSR on a Journal Volume page |
| 254 | + run: | |
| 255 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/journalvolume/07c6249f-4bf7-494d-9ce3-6ffdb2aed538) |
| 256 | + echo "$result" |
| 257 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental & Architectural Phenomenology Volume 28 (2017)" |
| 258 | +
|
| 259 | + # Get a specific journal issue in our test data and verify that the <meta name="title"> tag includes |
| 260 | + # the name of the issue. If it does, then SSR is working. |
| 261 | + - name: Verify SSR on a Journal Issue page |
| 262 | + run: | |
| 263 | + result=$(wget -O- -q http://127.0.0.1:4000/entities/journalissue/44c29473-5de2-48fa-b005-e5029aa1a50b) |
| 264 | + echo "$result" |
| 265 | + echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental & Architectural Phenomenology Vol. 28, No. 1" |
| 266 | +
|
| 267 | + # Verify 301 Handle redirect behavior |
| 268 | + # Note: /handle/123456789/260 is the same test Publication used by our e2e tests |
| 269 | + - name: Verify 301 redirect from '/handle' URLs |
| 270 | + run: | |
| 271 | + result=$(wget --server-response --quiet http://127.0.0.1:4000/handle/123456789/260 2>&1 | head -1 | awk '{print $2}') |
| 272 | + echo "$result" |
| 273 | + [[ "$result" -eq "301" ]] |
| 274 | +
|
| 275 | + # Verify 403 error code behavior |
| 276 | + - name: Verify 403 error code from '/403' |
| 277 | + run: | |
| 278 | + result=$(wget --server-response --quiet http://127.0.0.1:4000/403 2>&1 | head -1 | awk '{print $2}') |
| 279 | + echo "$result" |
| 280 | + [[ "$result" -eq "403" ]] |
| 281 | +
|
| 282 | + # Verify 404 error code behavior |
| 283 | + - name: Verify 404 error code from '/404' and on invalid pages |
| 284 | + run: | |
| 285 | + result=$(wget --server-response --quiet http://127.0.0.1:4000/404 2>&1 | head -1 | awk '{print $2}') |
| 286 | + echo "$result" |
| 287 | + result2=$(wget --server-response --quiet http://127.0.0.1:4000/invalidurl 2>&1 | head -1 | awk '{print $2}') |
| 288 | + echo "$result2" |
| 289 | + [[ "$result" -eq "404" && "$result2" -eq "404" ]] |
| 290 | +
|
| 291 | + # Verify 500 error code behavior |
| 292 | + - name: Verify 500 error code from '/500' |
| 293 | + run: | |
| 294 | + result=$(wget --server-response --quiet http://127.0.0.1:4000/500 2>&1 | head -1 | awk '{print $2}') |
| 295 | + echo "$result" |
| 296 | + [[ "$result" -eq "500" ]] |
| 297 | +
|
193 | 298 | - name: Stop running app |
194 | 299 | run: kill -9 $(lsof -t -i:4000) |
195 | 300 |
|
|
0 commit comments