@jahia/cypress 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.graphqlconfig +16 -0
- package/dist/page-object/baseComponent.d.ts +2 -0
- package/dist/page-object/baseComponent.js +14 -0
- package/dist/page-object/moonstone/menu.js +5 -1
- package/dist/support/fixture.js +6 -2
- package/fixtures/graphql/jcr/addNode.graphql +16 -0
- package/fixtures/graphql/jcr/deleteNode.graphql +5 -0
- package/fixtures/graphql/jcr/mutateNode.graphql +13 -0
- package/fixtures/groovy/admin/createSite.groovy +14 -0
- package/fixtures/groovy/admin/deleteSite.groovy +6 -0
- package/package.json +1 -1
- package/schema.graphql +2874 -0
- package/src/page-object/baseComponent.ts +5 -0
- package/src/page-object/moonstone/menu.ts +5 -1
- package/src/support/fixture.ts +5 -2
- package/fixtures/test.json +0 -0
|
@@ -3,6 +3,7 @@ import Chainable = Cypress.Chainable;
|
|
|
3
3
|
export type ComponentType<Component> = { new(p: Chainable<JQuery>, assertion?: (s: JQuery) => void): Component, defaultSelector: string };
|
|
4
4
|
|
|
5
5
|
export class BaseComponent {
|
|
6
|
+
static defaultSelector = ''
|
|
6
7
|
static count = 0
|
|
7
8
|
|
|
8
9
|
element: Chainable<JQuery>
|
|
@@ -22,4 +23,8 @@ export class BaseComponent {
|
|
|
22
23
|
|
|
23
24
|
return cy.get('@component' + this.id, {log: false})
|
|
24
25
|
}
|
|
26
|
+
|
|
27
|
+
should(arg, ...others) {
|
|
28
|
+
return cy.get('@component' + this.id, {log: false}).should(arg, ...others)
|
|
29
|
+
}
|
|
25
30
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import {BaseComponent} from "../baseComponent"
|
|
2
2
|
|
|
3
3
|
export class Menu extends BaseComponent {
|
|
4
|
-
static defaultSelector = '.moonstone-menu'
|
|
4
|
+
static defaultSelector = '.moonstone-menu:visible'
|
|
5
5
|
|
|
6
6
|
select(item: string): Menu {
|
|
7
|
+
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
8
|
+
cy.wait(500)
|
|
7
9
|
this.get().find(`.moonstone-menuItem`).should("contain", item).contains(item).trigger('click')
|
|
8
10
|
return this
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
selectByRole(item: string): Menu {
|
|
14
|
+
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
15
|
+
cy.wait(500)
|
|
12
16
|
this.get().find(`.moonstone-menuItem[data-sel-role="${item}"]`).trigger('click')
|
|
13
17
|
return this
|
|
14
18
|
}
|
package/src/support/fixture.ts
CHANGED
|
@@ -6,7 +6,6 @@ export const fixture = function(originalCommand: ((...args: any[]) => any), fixt
|
|
|
6
6
|
return originalCommand(fixture, ...args).then(f => {
|
|
7
7
|
return f
|
|
8
8
|
}).catch((err) => {
|
|
9
|
-
console.log(err)
|
|
10
9
|
return null;
|
|
11
10
|
});
|
|
12
11
|
}).then(file => {
|
|
@@ -16,7 +15,11 @@ export const fixture = function(originalCommand: ((...args: any[]) => any), fixt
|
|
|
16
15
|
encoding = args[0]
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
try {
|
|
19
|
+
cy.readFile('./node_modules/@jahia/cypress/fixtures/' + fixture, encoding, {log: false, timeout: 0})
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.log(e)
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
24
|
})
|
|
22
25
|
};
|
package/fixtures/test.json
DELETED
|
File without changes
|