Skip to content

Commit

Permalink
fix: Skip assets test by default as the CDN on cmstage is inaccessible
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvac committed Aug 28, 2023
1 parent e626a75 commit 1764c37
Show file tree
Hide file tree
Showing 8 changed files with 1,067 additions and 592 deletions.
3 changes: 1 addition & 2 deletions src/main/archetype/ui.tests.cypress/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM cypress/included:12.12.0
FROM cypress/included:12.17.0

ENV APP_PATH /usr/src/app
## Install dependencies
RUN apt -qqy update \
# Generic dependencies
&& apt -qqy --no-install-recommends install \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

const { defineConfig } = require("cypress");

const reportsPath = process.env.REPORTS_PATH || 'cypress/results'
const authorURL = process.env.AEM_AUTHOR_URL || 'http://localhost:4502'
const authorName = process.env.AEM_AUTHOR_USERNAME || 'admin'
Expand All @@ -36,7 +35,9 @@ let config = {
},
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
require('cypress-terminal-report/src/installLogsPrinter')(on, {
printLogsToConsole: "always",
});
},
baseUrl: authorURL,
reporter: 'cypress-multi-reporters',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ describe('AEM Assets', () => {
cy.AEMLogin(Cypress.env('AEM_AUTHOR_USERNAME'), Cypress.env('AEM_AUTHOR_PASSWORD'))
})

it('should be possible to upload an asset', () => {
// skip by default if the CDN is not accessible. Remove the .skip to run the test
it.skip('should be possible to upload an asset', () => {
const assetsPath = '/content/dam';
const localImageName = 'image.png';
const localPath = `assets/${localImageName}`;
Expand All @@ -39,6 +40,9 @@ describe('AEM Assets', () => {
// Wait for any lazy loaded dialogs to appear
cy.wait(3000)


cy.intercept({url: '/content/dam.completeUpload.json', method: 'POST'}).as('completeupload')

// Add the file handle to the upload form
cy.get('dam-chunkfileupload.dam-ChunkFileUpload > input').first().selectFile(localPath, {force: true})

Expand All @@ -48,6 +52,9 @@ describe('AEM Assets', () => {
// Press the upload button.
cy.get('coral-dialog.is-open coral-dialog-footer [variant="primary"]').click({force: true});

// Wait for the /content/dam.completeUpload.json POST to complete before polling for the asset
cy.wait(['@completeupload'], { responseTimeout: 10000 });

// Wait until Asset exists
cy.waitUntil(() => cy.AEMPathExists(Cypress.env('AEM_AUTHOR_URL'), imagePath), {
errorMsg: `asset ${imagePath} should exist`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
*/

import './commands'
require('cypress-terminal-report/src/installLogsCollector')({
xhr: {
printHeaderData: false,
printRequestData: false,
},
debug: true
});
Empty file.
Loading

0 comments on commit 1764c37

Please sign in to comment.