Skip to content

Commit 5ea5cb3

Browse files
CQ-4356927 UI Tests in WKND project fails
1 parent 50a5240 commit 5ea5cb3

File tree

3 files changed

+28
-5
lines changed
  • dispatcher/src
  • ui.tests/test-module/cypress/support

3 files changed

+28
-5
lines changed

dispatcher/src/conf.d/available_vhosts/wknd.vhost

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ Include conf.d/variables/custom.vars
135135
<IfModule mod_rewrite.c>
136136
RewriteEngine on
137137
Include conf.d/rewrites/rewrite.rules
138+
139+
# Rewrite index page internally, pass through (PT)
140+
RewriteRule "^(/?)$" "/index.html" [PT]
141+
138142
</IfModule>
139143
ErrorDocument 404 ${404_PAGE}
140144
ErrorDocument 500 ${500_PAGE}

dispatcher/src/conf.dispatcher.d/available_farms/wknd.farm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@
9090
# Marketing parameters can normally be ignored on most websites as they are tracked
9191
# through different means.
9292
/ignoreUrlParams {
93-
# All parameters can be passed to the AEM publisher
94-
/0001 { /glob "*" /type "deny" }
93+
# All parameters can be passed to the AEM publisher
94+
/0001 { /glob "*" /type "deny" }
9595

96-
# Ignore common marketing parameters by including the marketing_query_parameters.any file
97-
$include "../cache/marketing_query_parameters.any"
98-
}
96+
# Ignore common marketing parameters by including the marketing_query_parameters.any file
97+
$include "../cache/marketing_query_parameters.any"
98+
}
9999

100100
# Cache response headers next to a cached file. On the first request to
101101
# an uncached resource, all headers matching one of the values found here

ui.tests/test-module/cypress/support/aem.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ Cypress.Commands.add('AEMDeletePage', function (path, ignoreVerification = false
142142
cy.get('coral-dialog[aria-hidden="false"] coral-checkbox[name="archive"] input').uncheck()
143143
// confirm the delete dialog
144144
cy.get('coral-dialog[aria-hidden="false"] ._coral-Button--warning').click()
145+
146+
// wait until page is deleted
147+
cy.waitUntil(() => cy.AEMPathNotExists(Cypress.env('AEM_PUBLISH_URL'), path + '.html'), {
148+
errorMsg: `page ${path} should not exist`,
149+
timeout: 15000,
150+
interval: 1000
151+
});
145152
})
146153

147154
// AEMDeleteTestPages will find pages in the current path that match the pattern and delete them.
@@ -188,6 +195,18 @@ Cypress.Commands.add('AEMPathExists', function (baseUrl, path) {
188195
})
189196
})
190197

198+
Cypress.Commands.add('AEMPathNotExists', function (baseUrl, path) {
199+
const url = new URL(path, baseUrl)
200+
201+
return cy.request({
202+
url: url.href,
203+
failOnStatusCode: false
204+
})
205+
.then(response => {
206+
return (response.status === 404)
207+
})
208+
})
209+
191210
Cypress.Commands.add('AEMDeleteAsset', function (assetPath) {
192211
const tokenUrl = new URL('/libs/granite/csrf/token.json', Cypress.env('AEM_AUTHOR_URL'))
193212
let csrfToken

0 commit comments

Comments
 (0)