Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/actions/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: [push]
on: [push, pull_request]
name: customHeader
jobs:
customHeader:
Expand Down Expand Up @@ -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
10 changes: 6 additions & 4 deletions cypress/tests/functional/CustomHeader.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>', {delay: 0});
cy.get('textarea[id^="footerContent-"]').type('<a class="twitter-timeline" href="https://twitter.com/pkp?ref_src=twsrc%5Etfw">Tweets by pkp</a>', {delay: 0});
Expand Down
Loading