Skip to content

Commit e609434

Browse files
authored
DMF-6379: add function to get modules version (#97)
* DMF-6379: add function to get modules version * DMF-6379: utility function to get version of a dedicated module
1 parent 395e600 commit e609434

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
query getStartedModulesVersion {
2+
dashboard {
3+
modules {
4+
id
5+
version
6+
}
7+
}
8+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jahia/cypress",
3-
"version": "3.32.0",
3+
"version": "3.33.0",
44
"scripts": {
55
"build": "tsc",
66
"lint": "eslint src -c .eslintrc.json --ext .ts"

src/utils/JahiaPlatformHelper.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,18 @@ export const getJahiaVersion = (): Cypress.Chainable => {
66
return result?.data?.admin.jahia.version;
77
});
88
};
9+
10+
export const getStartedModulesVersion = (): Cypress.Chainable => {
11+
return cy.apollo({
12+
fetchPolicy: 'no-cache',
13+
queryFile: 'graphql/jcr/query/getStartedModulesVersion.graphql'
14+
}).then(result => {
15+
return result?.data?.dashboard.modules;
16+
});
17+
};
18+
19+
export const getStartedModuleVersion = (moduleId: string): Cypress.Chainable => {
20+
return getStartedModulesVersion().then(modules => {
21+
return modules.find(module => module.id === moduleId)?.version;
22+
});
23+
};

0 commit comments

Comments
 (0)