Skip to content
Merged
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
54 changes: 35 additions & 19 deletions cypress/tests/functional/DefaultManuscript.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,42 @@
*
*/

describe('Theme plugin tests', function() {
it('Enables and selects the theme', function() {
cy.login('admin', 'admin', 'publicknowledge');
describe("Theme plugin tests", function () {
it("Enables and selects the theme", function () {
cy.login("admin", "admin", "publicknowledge");

cy.get('ul[id="navigationPrimary"] a:contains("Settings")').click();
cy.get('ul[id="navigationPrimary"] a:contains("Website")').click();
cy.get('button[id="plugins-button"]').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-defaultmanuscriptchildthemeplugin-enabled"]').click();
cy.get('div:contains(\'The plugin "Manuscript (Default child theme)" has been enabled.\')');
// Find and enable the plugin
cy.get(
'input[id^="select-cell-defaultmanuscriptchildthemeplugin-enabled"]'
).click();
cy.get(
"div:contains('The plugin \"Manuscript (Default child theme)\" has been enabled.')"
);

// Select the new theme
cy.get('button[id="appearance-button"]').click();
cy.get('select[id="theme-themePluginPath-control"]').select('Manuscript (Default child theme)');
cy.get('div:contains("The theme has been updated.")');
});
// Appearance tab does not get updated until the reload
cy.reload();

it('Views the theme', function() {
cy.visit('');
cy.get('.pkp_site_name .is_text').should('have.css', 'text-transform', 'uppercase');
});
})
// Select the new theme
cy.get('button[id="appearance-button"]').click();
cy.get('select[id="theme-themePluginPath-control"]').select(
"Manuscript (Default child theme)"
);

cy.get('#theme button:contains("Save")').click();
cy.get('#theme [role="status"]').contains('Saved');
});

it("Views the theme", function () {
cy.visit("/");
cy.get(".pkp_site_name .is_text").should(
"have.css",
"text-transform",
"uppercase"
);
});
});