diff --git a/.eslintrc.json b/.eslintrc.json index 3d38f3bc4da..3124896fb68 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,7 +16,8 @@ "dspace-angular-html" ], "ignorePatterns": [ - "lint/test/fixture" + "lint/test/fixture", + "src/static-files" ], "overrides": [ { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe0c806829a..474142dc59e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,9 +32,6 @@ jobs: CYPRESS_BASE_URL: http://127.0.0.1:4000 # Disable the cookie consent banner in e2e tests to avoid errors because of elements hidden by it DSPACE_INFO_ENABLECOOKIECONSENTPOPUP: false - # When Chrome version is specified, we pin to a specific version of Chrome - # Comment this out to use the latest release - #CHROME_VERSION: "90.0.4430.212-1" # Bump Node heap size (OOM in CI after upgrading to Angular 15) NODE_OPTIONS: '--max-old-space-size=4096' # Project name to use when running "docker compose" prior to e2e tests @@ -63,22 +60,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - # If CHROME_VERSION env variable specified above, then pin to that version. - # Otherwise, just install latest version of Chrome. - - name: Install Chrome (for e2e tests) - run: | - if [[ -z "${CHROME_VERSION}" ]] - then - echo "Installing latest stable version" - sudo apt-get update - sudo apt-get --only-upgrade install google-chrome-stable -y - else - echo "Installing version ${CHROME_VERSION}" - wget -q "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb" - sudo dpkg -i "google-chrome-stable_${CHROME_VERSION}_amd64.deb" - fi - google-chrome --version - # https://github.com/actions/cache/blob/main/examples.md#node---npm - name: Get NPM cache directory id: npm-cache-dir @@ -145,14 +126,23 @@ jobs: docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli docker container ls + # Installs "Chrome for Testing" which is a version of Chrome stabilized for automated testing + # Cypress recommends using Chrome For Testing for reliable, reproducible runs + # https://docs.cypress.io/app/references/launching-browsers + - name: Install Chrome For Testing (for e2e tests) + uses: browser-actions/setup-chrome@v2 + # To pin to a specific version of Chrome, uncomment this parameter + #with: + # chrome-version: 154 + # Run integration tests via Cypress.io # https://github.com/cypress-io/github-action # (NOTE: to run these e2e tests locally, just use 'ng e2e') - name: Run e2e tests (integration tests) - uses: cypress-io/github-action@v7.1.9 + uses: cypress-io/github-action@v7.4.4 with: - # Run tests in Chrome, headless mode (default) - browser: chrome + # Run tests in Chrome for Testing + browser: chrome-for-testing # Start app before running tests (will be stopped automatically after tests finish) start: npm run serve:ssr # Wait for backend & frontend to be available @@ -198,14 +188,15 @@ jobs: done echo "App started successfully." - # Get homepage and verify that the tag includes "DSpace". + # Get homepage and verify that the tag includes the repository title + # ("LINDAT/CLARIAH-CZ Repository" on this CLARIN branch, "DSpace" on vanilla). # If it does, then SSR is working, as this tag is created by our MetadataService. # This step also prints entire HTML of homepage for easier debugging if grep fails. - name: Verify SSR (server-side rendering) on Homepage run: | result=$(wget -O- -q http://127.0.0.1:4000/home) echo "$result" - echo "$result" | grep -oE "]*>" | grep DSpace + echo "$result" | grep -oE "]*>" | grep -E "LINDAT|DSpace" # Get a specific community in our test data and verify that the "
'+a+"
")},enable:function(a){var c=this.parent.Utils.options.get("discoPath","")+"images/",d=this.parent.Utils.options.get("textSearch",DiscoJuice.Dict.orSearch),e=this.parent.Utils.options.get("textHelp",DiscoJuice.Dict.help),g=this.parent.Utils.options.get("textHelpMore", +DiscoJuice.Dict.helpMore),h=this.parent.Utils.options.get("subtitle",null),c='";var f=this,d=$("body");this.parent.Utils.options.get("useTarget",!1)&&(d=this.parent.Utils.options.get("target",d));/*console.log("Target is");console.log(d);*/this.parent.Utils.options.get("overlay",!0)&&(/*console.log("DiscoJuice Enable: adding overlay"),*/$('').appendTo($("body")));this.popup=$(c).appendTo(d); + var that = this; + this.popup.find("div.scroller a").each(function() { + var overthere = that; // Overthere is a reference to the UI object + $(this).click(function(event) { + event.preventDefault(); + event.stopPropagation(); + // The "rel" attribute is containing: 'entityid#subid' + // THe following code, decodes that. + var relID = unescape($(this).attr('rel')); + var entityID = relID; + var subID = undefined; + if (relID.match(/^.*#.+?$/)) { + var matched = /^(.*)#(.+?)$/.exec(relID); + entityID = matched[1]; + subID = matched[2]; + } + overthere.control.selectProvider(entityID, subID); + })});!0===this.parent.Utils.options.get("always",!1)?(this.popup.find(".discojuice_close").hide(),this.show()): +$(a).click(function(a){a.preventDefault();f.show();return!1});this.popup.find("p#dj_help").click(function(){f.setScreen("'+f.sprintf(DiscoJuice.Dict.aboutDescr,'',"")+'
'+DiscoJuice.Dict.version+": "+DiscoJuice.Version)});this.popup.find("#discojuiceextesion_listener").click(function(){f.control.discojuiceextension()}); +this.popup.find("#discojuice_page_return input").click(function(a){a.preventDefault();f.returnToProviderList()});this.popup.find(".discojuice_close").click(function(){f.hide()});this.popup.find(".discojuice_what").click(function(){f.popup.find(".discojuice_whatisthis").toggleClass("show")});this.parent.Utils.options.get("location",!1)&&navigator.geolocation&&(f=this,$("a#locateme").click(function(a){var c=f.parent.Utils.options.get("discoPath","")+"images/";f.parent.Utils.log("Locate me. Detected click event."); +a.preventDefault();a.stopPropagation();$("div.locatemebefore").hide();$("div.locatemeafter").html('
'+DiscoJuice.Dict.locating+"...