Skip to content

Commit

Permalink
BACKLOG-21359: Add disable module helper (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
gflores-jahia authored Dec 8, 2023
1 parent a965dbd commit 88448fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fixtures/graphql/jcr/mutation/disableModule.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mutation disableModule($moduleName: String!, $pathOrId: String!) {
jcr {
mutateNode(pathOrId: $pathOrId) {
mutateProperty(name: "j:installedModules") {
removeValue(value: $moduleName)
}
}
}
}
7 changes: 7 additions & 0 deletions src/utils/SiteHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export const enableModule = (moduleName: string, siteKey: string): void => {
});
};

export const disableModule = (moduleName: string, siteKey: string): void => {
cy.apollo({
mutationFile: 'graphql/jcr/mutation/disableModule.graphql',
variables: {moduleName, pathOrId: `/sites/${siteKey}`}
});
};

export const editSite = (siteKey: string, config: {serverName: string} = {serverName: 'localhost'}): void => {
cy.executeGroovy('groovy/admin/editSite.groovy', {
SITEKEY: siteKey,
Expand Down

0 comments on commit 88448fc

Please sign in to comment.