From 1d295f55874031408ac8bc0975150f402eaf98de Mon Sep 17 00:00:00 2001 From: Kaitlin Newson Date: Thu, 24 Jul 2025 15:56:58 -0300 Subject: [PATCH 1/3] Fix tests for main branch --- .github/actions/tests.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/actions/tests.sh b/.github/actions/tests.sh index 2482793..1dd05e7 100755 --- a/.github/actions/tests.sh +++ b/.github/actions/tests.sh @@ -2,8 +2,4 @@ set -e -npx cypress run --spec "cypress/tests/data/10-Installation.spec.js,cypress/tests/data/20-CreateContext.spec.js" - -npx cypress run --headless --browser chrome --config '{"specPattern":["plugins/generic/customHeader/cypress/tests/functional/*.cy.js"]}' - - +npx cypress run --config specPattern=plugins/generic/customHeader/cypress/tests/functional From 86b8260eec42a08931835f0e82ffba9760e43d8e Mon Sep 17 00:00:00 2001 From: Kaitlin Newson Date: Thu, 24 Jul 2025 15:58:52 -0300 Subject: [PATCH 2/3] Run tests on pull requests --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7589e8..71aca35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -on: [push] +on: [push, pull_request] name: customHeader jobs: customHeader: @@ -43,12 +43,12 @@ jobs: - application: ops php-version: 8.2 database: pgsql - name: customHeader steps: - uses: pkp/pkp-github-actions@v1 with: - node_version: 20 - branch: main - repository: pkp - plugin: true + node_version: 20 + branch: main + repository: pkp + plugin: true + dataset_inject: true From 0d842281716c02fdfd77bd34b96e3cad898f9032 Mon Sep 17 00:00:00 2001 From: Kaitlin Newson Date: Thu, 24 Jul 2025 17:59:34 -0300 Subject: [PATCH 3/3] Update cypress test --- cypress/tests/functional/CustomHeader.cy.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cypress/tests/functional/CustomHeader.cy.js b/cypress/tests/functional/CustomHeader.cy.js index 1538dd4..12ad888 100644 --- a/cypress/tests/functional/CustomHeader.cy.js +++ b/cypress/tests/functional/CustomHeader.cy.js @@ -11,16 +11,18 @@ describe('Custom Header plugin tests', function() { it('Creates and exercises a custom header', function() { cy.login('admin', 'admin', 'publicknowledge'); - cy.get('.app__nav a').contains('Website').click(); + cy.get('nav').contains('Settings').click(); + // Ensure submenu item click despite animation + cy.get('nav').contains('Website').click({ force: true }); cy.get('button[id="plugins-button"]').click(); // Find and enable the plugin cy.get('input[id^="select-cell-customheaderplugin-enabled"]').click(); cy.get('div:contains(\'The plugin "Custom Header Plugin" has been enabled.\')'); - cy.waitJQuery(); + cy.reload(); - cy.get('tr[id*="customheaderplugin"] a.show_extras').click(); - cy.get('a[id*="customheaderplugin-settings"]').click(); + cy.get('tr[id="component-grid-settings-plugins-settingsplugingrid-category-generic-row-customheaderplugin"] a.show_extras').click(); + cy.get('a[id^="component-grid-settings-plugins-settingsplugingrid-category-generic-row-customheaderplugin-settings-button"').click(); cy.waitJQuery(2000); // Wait for form to settle cy.get('textarea[id^="headerContent-"]').type('', {delay: 0}); cy.get('textarea[id^="footerContent-"]').type('', {delay: 0});