diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a677bb7ba..6243bd9de 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: jahia_image: ["jahia/jahia-ee:8", "jahia/jahia-ee-dev:8-SNAPSHOT"] - timeout-minutes: 45 + timeout-minutes: 120 steps: - uses: jahia/jahia-modules-action/helper@v2 - uses: KengoTODA/actions-setup-docker-compose@main diff --git a/.github/workflows/on-code-change.yml b/.github/workflows/on-code-change.yml index 97b725adf..84f9b393a 100644 --- a/.github/workflows/on-code-change.yml +++ b/.github/workflows/on-code-change.yml @@ -28,6 +28,7 @@ jobs: with: node_version: 14 auditci_level: critical + max_warning: 58 build: name: Build Module @@ -45,7 +46,6 @@ jobs: nexus_username: ${{ secrets.NEXUS_USERNAME }} nexus_password: ${{ secrets.NEXUS_PASSWORD }} module_id: jcontent - tests_module_type: "npm" sonar-analysis: name: Sonar Analysis @@ -83,6 +83,7 @@ jobs: should_use_build_artifacts: true should_skip_testrail: true github_artifact_name: jcontent-standalone-artifacts-${{ github.run_number }} + bastion_ssh_private_key: ${{ secrets.BASTION_SSH_PRIVATE_KEY_JAHIACI }} jahia_license: ${{ secrets.JAHIA_LICENSE_8X_FULL }} docker_username: ${{ secrets.DOCKERHUB_USERNAME }} docker_password: ${{ secrets.DOCKERHUB_PASSWORD }} @@ -98,6 +99,7 @@ jobs: incident_google_client_email: ${{ secrets.INCIDENT_GOOGLE_CLIENT_EMAIL }} incident_google_api_key_base64: ${{ secrets.INCIDENT_GOOGLE_PRIVATE_KEY_BASE64 }} zencrepes_secret: ${{ secrets.ZENCREPES_WEBHOOK_SECRET }} + timeout_minutes: 90 - name: Test Report uses: dorny/test-reporter@v1 if: success() || failure() diff --git a/.github/workflows/on-merge.yml b/.github/workflows/on-merge.yml index f626bb47d..012854519 100644 --- a/.github/workflows/on-merge.yml +++ b/.github/workflows/on-merge.yml @@ -38,14 +38,13 @@ jobs: nexus_username: ${{ secrets.NEXUS_USERNAME }} nexus_password: ${{ secrets.NEXUS_PASSWORD }} module_id: jcontent - tests_module_type: "npm" - + sbom: name: SBOM processing needs: build runs-on: ubuntu-latest container: - image: cyclonedx/cyclonedx-cli:0.24.2 + image: cyclonedx/cyclonedx-cli:0.24.2 steps: - uses: jahia/jahia-modules-action/sbom-processing@v2 with: @@ -57,7 +56,7 @@ jobs: name: Integration Tests (Standalone) needs: build runs-on: self-hosted - timeout-minutes: 60 + timeout-minutes: 120 steps: - uses: jahia/jahia-modules-action/helper@v2 - uses: KengoTODA/actions-setup-docker-compose@main @@ -116,4 +115,3 @@ jobs: with: nexus_username: ${{ secrets.NEXUS_USERNAME }} nexus_password: ${{ secrets.NEXUS_PASSWORD }} - tests_module_type: "npm" diff --git a/tests/assets/provisioning.yml b/tests/assets/provisioning.yml index be271c927..01ccf67b7 100644 --- a/tests/assets/provisioning.yml +++ b/tests/assets/provisioning.yml @@ -1,7 +1,8 @@ - addMavenRepository: 'https://store.jahia.com/nexus/content/repositories/jahia-public-app-store@id=JahiaStore' - addMavenRepository: 'https://devtools.jahia.com/nexus/content/groups/public/@snapshots@noreleases@id=JahiaPublicSnapshots' - -- uninstallBundle: "org.jahia.modules/content-editor/4.6.0.SNAPSHOT" +- addMavenRepository: 'https://devtools.jahia.com/nexus/content/groups/internal@id=jahia-internal@snapshots' + username: ${env:NEXUS_USERNAME} + password: ${env:NEXUS_PASSWORD} - installBundle: - 'mvn:org.jahia.modules/press/3.1.0' @@ -37,3 +38,6 @@ site: "digitall" - executeScript: "script-01-create-categories.groovy" + +- uninstallBundle: + - "org.jahia.modules/content-editor" diff --git a/tests/cypress/e2e/contentEditor/addMixinChoicelistInitializers.cy.ts b/tests/cypress/e2e/contentEditor/addMixinChoicelistInitializers.cy.ts index 4b4511887..3a11b0887 100644 --- a/tests/cypress/e2e/contentEditor/addMixinChoicelistInitializers.cy.ts +++ b/tests/cypress/e2e/contentEditor/addMixinChoicelistInitializers.cy.ts @@ -41,65 +41,61 @@ describe('Add Mixin by using choice list initializers (Image Reference)', () => cy.get('#contenteditor-dialog-title') .should('be.visible') .and('contain', 'Create Image (from the Document Manager)'); + cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').click(); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType') - .click() .find('li[role="option"][data-value="internal"]') .click(); - cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]') - .scrollIntoView() - .should('be.visible'); + + const selector = '[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]'; + cy.get(selector).scrollIntoView(); contentEditor.getLanguageSwitcher().select('Français'); - cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]') - .as('fr_internal_link') - .scrollIntoView() - .should('be.visible'); + cy.get(selector).as('fr_internal_link').scrollIntoView(); + cy.get(selector).should('be.visible'); + + cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').click(); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType') - .click() .find('li[role="option"][data-value="external"]') .click(); cy.get('@fr_internal_link').should('not.exist'); - cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:linkTitle"]') - .scrollIntoView() - .should('be.visible'); - cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:url"]').scrollIntoView().should('be.visible'); + cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:linkTitle"]').scrollIntoView(); + cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:linkTitle"]').should('be.visible'); + cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:url"]').scrollIntoView(); + cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:url"]').should('be.visible'); contentEditor.getLanguageSwitcher().select('Deutsch'); cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]').should('not.exist'); - cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:linkTitle"]') - .scrollIntoView() - .should('be.visible'); + cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:linkTitle"]').scrollIntoView(); + cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:linkTitle"]').should('be.visible'); cy.get('[data-sel-content-editor-field="jmix\\:externalLink_j\\:url"]') .as('de_external_link_url') - .scrollIntoView() - .should('be.visible'); + .scrollIntoView(); + cy.get('@de_external_link_url').should('be.visible'); + cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').click(); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType') - .click() .find('li[role="option"][data-value="none"]') .click(); cy.get('@de_external_link_url').should('not.exist'); contentEditor.getLanguageSwitcher().select('English'); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').contains('No link'); + cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').click(); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType') - .click() .find('li[role="option"][data-value="internal"]') .click(); + cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]').scrollIntoView(); cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]') - .scrollIntoView() .should('be.visible') .click(); cy.get('.moonstone-loader').should('not.exist'); // Wait to load - cy.get('.moonstone-tab-item[data-cm-view-type="pages"]') - .should('be.visible') - .click() - .should('have.class', 'moonstone-selected'); + cy.get('.moonstone-tab-item[data-cm-view-type="pages"]').should('be.visible').click(); + cy.get('.moonstone-tab-item[data-cm-view-type="pages"]').should('have.class', 'moonstone-selected'); cy.get('.moonstone-loader').should('not.exist'); // Wait to load cy.get('tr[data-cm-role="table-content-list-row"]').contains('Search Results').click(); cy.get('button[data-sel-picker-dialog-action="done"]').click(); + cy.get('[data-sel-content-editor-field="jnt\\:imageReferenceLink_jcr\\:title"]').scrollIntoView(); cy.get('[data-sel-content-editor-field="jnt\\:imageReferenceLink_jcr\\:title"]') - .scrollIntoView() .should('be.visible') .type(cypressDocumentManagerImageReferenceLinkTest); + cy.get('[data-sel-content-editor-field="jnt\\:imageReferenceLink_j\\:node"]').scrollIntoView(); cy.get('[data-sel-content-editor-field="jnt\\:imageReferenceLink_j\\:node"]') - .scrollIntoView() .should('be.visible') .click(); cy.get('[data-sel-role-card="snowbearHome.jpeg"]').should('be.visible').contains('snowbearHome.jpeg').click(); @@ -119,26 +115,25 @@ describe('Add Mixin by using choice list initializers (Image Reference)', () => cy.get('#contenteditor-dialog-title') .should('be.visible') .and('contain', 'Cypress document manager image reference'); + cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').click(); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType') - .click() .find('li[role="option"][data-value="none"]') .click(); cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]').should('not.exist'); contentEditor.getLanguageSwitcher().select('Français'); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').contains('Pas de lien'); + cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').click(); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType') - .click() .find('li[role="option"][data-value="internal"]') .click(); - cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]') - .scrollIntoView() - .should('be.visible'); + cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]').scrollIntoView(); + cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]').should('be.visible'); contentEditor.getLanguageSwitcher().select('English'); cy.get('#select-jnt\\:imageReferenceLink_j\\:linkType').contains('Internal'); cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]') .should('exist') - .scrollIntoView() - .should('be.visible'); + .scrollIntoView(); + cy.get('[data-sel-content-editor-field="jmix\\:internalLink_j\\:linknode"]').should('be.visible'); // ContentEditor.cancelAndDiscard() contentEditor.cancel(); }); diff --git a/tests/cypress/e2e/contentEditor/contentEditorForm.cy.ts b/tests/cypress/e2e/contentEditor/contentEditorForm.cy.ts index 89a2600bd..984b39048 100644 --- a/tests/cypress/e2e/contentEditor/contentEditorForm.cy.ts +++ b/tests/cypress/e2e/contentEditor/contentEditorForm.cy.ts @@ -34,7 +34,6 @@ describe('Content editor form', () => { } }` }).should(resp => { - // eslint-disable-next-line no-unused-expressions expect(resp?.data?.jcr?.mutateNode.mutateProperty.setValue).to.be.true; }); } diff --git a/tests/cypress/e2e/contentEditor/contentMultiLanguage.cy.ts b/tests/cypress/e2e/contentEditor/contentMultiLanguage.cy.ts index 89286285c..f71ff530e 100644 --- a/tests/cypress/e2e/contentEditor/contentMultiLanguage.cy.ts +++ b/tests/cypress/e2e/contentEditor/contentMultiLanguage.cy.ts @@ -65,7 +65,6 @@ describe('Create multi language content and verify that it is different in all l path: `/sites/${sitekey}/home` } }).then(response => { - // eslint-disable-next-line expect(response?.data?.jcr?.mutateNode?.mutateProperty?.setValue).to.be.true; }); @@ -78,7 +77,6 @@ describe('Create multi language content and verify that it is different in all l path: `/sites/${sitekey}/home` } }).then(response => { - // eslint-disable-next-line expect(response?.data?.jcr?.mutateNode?.mutateProperty?.setValue).to.be.true; }); diff --git a/tests/cypress/e2e/contentEditor/createContentI18N.cy.ts b/tests/cypress/e2e/contentEditor/createContentI18N.cy.ts index fc7d63679..352557d55 100644 --- a/tests/cypress/e2e/contentEditor/createContentI18N.cy.ts +++ b/tests/cypress/e2e/contentEditor/createContentI18N.cy.ts @@ -175,6 +175,7 @@ describe('Create content tests in I18N site', () => { const jcontent = JContent.visit(sitekey, 'en', 'media/file'); const fileName = 'snowbearHome.jpeg'; const fieldName = 'jnt:file_jcr:title'; + // eslint-disable-next-line cypress/unsafe-to-chain-command cy.get('div[data-cm-role="grid-content-list"]') .children('div') .selectFile(`cypress/fixtures/contentEditor/${fileName}`, { diff --git a/tests/cypress/e2e/contentEditor/editorUrl.cy.ts b/tests/cypress/e2e/contentEditor/editorUrl.cy.ts index 42f2dd3b5..4585ca576 100644 --- a/tests/cypress/e2e/contentEditor/editorUrl.cy.ts +++ b/tests/cypress/e2e/contentEditor/editorUrl.cy.ts @@ -138,9 +138,8 @@ describe('Editor url test', () => { const baseUrl = '/jahia/jcontent/digitall/en/pages/home/about'; const ceParams = `(contentEditor:!((formKey:modal_0,isFullscreen:!t,lang:en,mode:edit,site:digitall,uilang:en,uuid:'${validUuid}')))`; cy.visit(`${baseUrl}#${ceParams}`); - cy.get('[data-sel-role="tab-advanced-options"]') - .click() - .should('have.class', 'moonstone-selected'); + cy.get('[data-sel-role="tab-advanced-options"]').click(); + cy.get('[data-sel-role="tab-advanced-options"]').should('have.class', 'moonstone-selected'); cy.get('[data-sel-role="advanced-options-nav"] li') .contains('Edit roles') .click(); @@ -168,9 +167,8 @@ describe('Editor url test', () => { const baseUrl = '/jahia/jcontent/digitall/en/pages/home/about'; const ceParams = `(contentEditor:!((formKey:modal_0,isFullscreen:!t,lang:en,mode:edit,site:digitall,uilang:en,uuid:'${validUuid}')))`; cy.visit(`${baseUrl}#${ceParams}`); - cy.get('[data-sel-role="tab-advanced-options"]') - .click() - .should('have.class', 'moonstone-selected'); + cy.get('[data-sel-role="tab-advanced-options"]').click(); + cy.get('[data-sel-role="tab-advanced-options"]').should('have.class', 'moonstone-selected'); cy.get('[data-sel-role="advanced-options-nav"] li') .contains('Edit roles') .click(); diff --git a/tests/cypress/e2e/contentEditor/pickers/editoriallink.cy.ts b/tests/cypress/e2e/contentEditor/pickers/editoriallink.cy.ts index 6676079b5..5aa115455 100644 --- a/tests/cypress/e2e/contentEditor/pickers/editoriallink.cy.ts +++ b/tests/cypress/e2e/contentEditor/pickers/editoriallink.cy.ts @@ -89,7 +89,6 @@ describe('Picker - Editorial link', {testIsolation: false}, () => { .should(elems => { const texts = elems.get().map(e => e.textContent); const allTypes = texts.sort().every(content => ['Content Folder', 'Person portrait', 'Article (title and introduction)'].includes(content)); - // eslint-disable-next-line no-unused-expressions expect(allTypes).to.be.true; }); picker.cancel(); diff --git a/tests/cypress/page-object/contentEditor.ts b/tests/cypress/page-object/contentEditor.ts index 06ad889dc..7ad5f0bb1 100644 --- a/tests/cypress/page-object/contentEditor.ts +++ b/tests/cypress/page-object/contentEditor.ts @@ -58,11 +58,13 @@ export class ContentEditor extends BasePage { } addAnotherContent() { - cy.get('#createAnother').check().should('have.attr', 'aria-checked', 'true'); + cy.get('#createAnother').check(); + cy.get('#createAnother').should('have.attr', 'aria-checked', 'true'); } removeAnotherContent() { - cy.get('#createAnother').uncheck().should('have.attr', 'aria-checked', 'false'); + cy.get('#createAnother').uncheck(); + cy.get('#createAnother').should('have.attr', 'aria-checked', 'false'); } activateWorkInProgressMode(language?: string) { @@ -145,7 +147,8 @@ export class ContentEditor extends BasePage { } toggleOption(optionType: string, optionFieldName: string) { - cy.get(`span[data-sel-role-dynamic-fieldset="${optionType}"]`).scrollIntoView({offset: {left: 0, top: -100}}).find('input').click({force: true}); + cy.get(`span[data-sel-role-dynamic-fieldset="${optionType}"]`).scrollIntoView({offset: {left: 0, top: -100}}); + cy.get(`span[data-sel-role-dynamic-fieldset="${optionType}"]`).find('input').click({force: true}); cy.contains(optionFieldName, {timeout: 90000}).should('be.visible'); } diff --git a/tests/cypress/page-object/jcontent.ts b/tests/cypress/page-object/jcontent.ts index 2c64c4ac4..17a4e5941 100644 --- a/tests/cypress/page-object/jcontent.ts +++ b/tests/cypress/page-object/jcontent.ts @@ -11,7 +11,6 @@ import { getElement, Menu, SecondaryNav, - Table, TableRow } from '@jahia/cypress'; import {BasicSearch} from './basicSearch'; diff --git a/tests/cypress/page-object/pageComposer.ts b/tests/cypress/page-object/pageComposer.ts index c3eb471c7..e5af5cc6a 100644 --- a/tests/cypress/page-object/pageComposer.ts +++ b/tests/cypress/page-object/pageComposer.ts @@ -60,7 +60,8 @@ export class PageComposer extends BasePage { componentShouldBeVisible(selector: string) { cy.iframe('#page-composer-frame', this.iFrameOptions).within(() => { cy.iframe('.gwt-Frame', this.iFrameOptions).within(() => { - cy.get('.container').find(selector).should('exist').scrollIntoView().should('be.visible'); + cy.get('.container').find(selector).should('exist').scrollIntoView(); + cy.get('.container').find(selector).should('be.visible'); }); }); } @@ -70,11 +71,13 @@ export class PageComposer extends BasePage { cy.iframe('.gwt-Frame', this.iFrameOptions).within(() => { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(5000); - cy.get('.container').find(selector).trigger('mouseover').rightclick({force: true}); + cy.get('.container').find(selector).trigger('mouseover'); + cy.get('.container').find(selector).rightclick({force: true}); }); }); cy.iframe('#page-composer-frame', this.iFrameOptions).within(() => { - cy.get('.editModeContextMenu').scrollIntoView().contains('Edit').click(); + cy.get('.editModeContextMenu').scrollIntoView(); + cy.get('.editModeContextMenu').contains('Edit').click(); }); return new ContentEditor(); } @@ -84,11 +87,13 @@ export class PageComposer extends BasePage { cy.iframe('.gwt-Frame', this.iFrameOptions).within(() => { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(5000); - cy.get('.container').contains(text).trigger('mouseover').rightclick({force: true}); + cy.get('.container').contains(text).trigger('mouseover'); + cy.get('.container').contains(text).rightclick({force: true}); }); }); cy.iframe('#page-composer-frame', this.iFrameOptions).within(() => { - cy.get('.editModeContextMenu').scrollIntoView().contains('Edit').click(); + cy.get('.editModeContextMenu').scrollIntoView(); + cy.get('.editModeContextMenu').contains('Edit').click(); }); return new ContentEditor(); } @@ -147,8 +152,10 @@ export class PageComposer extends BasePage { cy.get('#nt\\:base_ce\\:systemName').should('be.visible').type(title, {force: true}); } - cy.get('#select-jmix\\:hasTemplateNode_j\\:templateName').should('be.visible') - .click() + cy.get('#select-jmix\\:hasTemplateNode_j\\:templateName') + .should('be.visible') + .click(); + cy.get('#select-jmix\\:hasTemplateNode_j\\:templateName') .find('li[role="option"][data-value="home"]') .click(); @@ -164,8 +171,10 @@ export class PageComposer extends BasePage { }); cy.get('#jnt\\:page_jcr\\:title').should('be.visible').type(title, {force: true}); - cy.get('#select-jmix\\:hasTemplateNode_j\\:templateName').should('be.visible') - .click() + cy.get('#select-jmix\\:hasTemplateNode_j\\:templateName') + .should('be.visible') + .click(); + cy.get('#select-jmix\\:hasTemplateNode_j\\:templateName') .find('li[role="option"][data-value="home"]') .click(); diff --git a/tests/cypress/page-object/pickerTable.ts b/tests/cypress/page-object/pickerTable.ts index 6ab08a2dc..57083b229 100644 --- a/tests/cypress/page-object/pickerTable.ts +++ b/tests/cypress/page-object/pickerTable.ts @@ -28,11 +28,15 @@ export class PickerTable extends Table { this.getRows().get() .then(elems => { expect(elems.length).gte(count); - const selectRow = elem => + const selectRow = elem => { + cy.wrap(elem) + .find('[data-cm-role="table-content-list-cell-selection"] input') + .click(); cy.wrap(elem) .find('[data-cm-role="table-content-list-cell-selection"] input') - .click() .should('have.attr', 'aria-checked', 'true'); + }; + for (let i = 0; i < count; i++) { selectRow(elems.eq(i)); } diff --git a/tests/maven.settings.xml b/tests/maven.settings.xml new file mode 100644 index 000000000..014b26987 --- /dev/null +++ b/tests/maven.settings.xml @@ -0,0 +1,78 @@ + + + + + jahia-internal-repository + + + + true + + central + Central Repository + https://repo1.maven.org/maven2/ + + + jahia-internal + Jahia Internal Repository + ${env.NEXUS_INTERNAL_URL} + + true + never + + + true + always + + + + + + sonar + + true + + + ${env.SONAR_URL} + ${env.SONAR_TOKEN} + + + + + + jahia-internal-repository + + + + + jahia-enterprise + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + jahia-snapshots + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + jahia-internal + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + jahia-enterprise-snapshots + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + jahia-enterprise-releases + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + staging-repository + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + \ No newline at end of file