graphdb-workbench-tests 3.4.0-TR1 → 3.4.0-TR2
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/e2e-legacy/explore/visual-graph/node-info-panel.spec.js +58 -0
- package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +32 -25
- package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +90 -36
- package/fixtures/graph/graph-configurations.json +59 -0
- package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +6 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/visual-graph-steps.js +4 -0
- package/steps/yasgui/yasr-steps.js +42 -2
- package/stubs/graph-config-stubs.js +17 -0
- package/support/commands.js +1 -0
- package/support/url-commands.js +13 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {VisualGraphSteps} from '../../../steps/visual-graph-steps.js';
|
|
2
|
+
import {ApplicationSteps} from '../../../steps/application-steps.js';
|
|
3
|
+
|
|
4
|
+
const DATA_SNIPPET =
|
|
5
|
+
'PREFIX ex: <http://example.org/>\n' +
|
|
6
|
+
'PREFIX sysont: <http://www.ontotext.com/proton/protonsys#>\n' +
|
|
7
|
+
'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n' +
|
|
8
|
+
'ex:MyNode a ex:Thing ;\n' +
|
|
9
|
+
'rdfs:label "My Node" ;\n' +
|
|
10
|
+
'ex:description """# My Node\n\nThis is a **Markdown** literal.\n\n- item 1\n- item 2"""^^sysont:Markdown .';
|
|
11
|
+
|
|
12
|
+
describe('Node info panel', () => {
|
|
13
|
+
let repositoryId;
|
|
14
|
+
let graphConfigName;
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
cy.clearLocalStorage('ls.graphs-viz');
|
|
18
|
+
repositoryId = 'node-info-panel-' + Date.now();
|
|
19
|
+
graphConfigName = 'graph-config-' + Date.now();
|
|
20
|
+
cy.createRepository({id: repositoryId});
|
|
21
|
+
cy.presetRepository(repositoryId);
|
|
22
|
+
cy.importRDFTextSnippet(repositoryId, DATA_SNIPPET);
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
cy.clearLocalStorage('ls.graphs-viz');
|
|
27
|
+
cy.deleteGraphConfig(graphConfigName);
|
|
28
|
+
cy.deleteRepository(repositoryId);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should render markdown content for literals with markdown datatype', () => {
|
|
32
|
+
cy.enableAutocomplete(repositoryId);
|
|
33
|
+
// Given I have opened the graphs visualizations page
|
|
34
|
+
VisualGraphSteps.visit();
|
|
35
|
+
// And I have created a graph config with query results
|
|
36
|
+
VisualGraphSteps.getCreateCustomGraphLink().click();
|
|
37
|
+
cy.url().should('include', '/config/save');
|
|
38
|
+
VisualGraphSteps.typeGraphConfigName(graphConfigName);
|
|
39
|
+
VisualGraphSteps.selectStartMode('node');
|
|
40
|
+
VisualGraphSteps.selectStartNode('MyNode', 0);
|
|
41
|
+
VisualGraphSteps.saveConfig();
|
|
42
|
+
ApplicationSteps.getSuccessNotifications().should('be.visible');
|
|
43
|
+
VisualGraphSteps.getGraphConfig(graphConfigName).should('be.visible');
|
|
44
|
+
// When I open the graph config
|
|
45
|
+
VisualGraphSteps.openGraphConfig(graphConfigName);
|
|
46
|
+
// Then I expect the graph visualization of the saved config to be opened
|
|
47
|
+
cy.url().should('contain', Cypress.config('baseUrl') + '/graphs-visualizations?config=');
|
|
48
|
+
VisualGraphSteps.getGraphVisualizationPane().should('be.visible');
|
|
49
|
+
// When I click on the node with markdown content
|
|
50
|
+
VisualGraphSteps.getCircleOfNodeByNodeId('http://example.org/MyNode').click();
|
|
51
|
+
// Then node info panel should be opened
|
|
52
|
+
VisualGraphSteps.getSidePanelContent().should('be.visible');
|
|
53
|
+
// And the markdown typed literal should be rendered
|
|
54
|
+
VisualGraphSteps.getPropertyByIndex(1).should('contain', 'This is a Markdown literal')
|
|
55
|
+
.and('contain', 'item 1')
|
|
56
|
+
.and('contain', 'item 2');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -33,109 +33,116 @@ describe('ttyg configure agent guide', () => {
|
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
it('should create and configure TTYG agent with actions', () => {
|
|
36
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 1/
|
|
36
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 1/30');
|
|
37
37
|
GuideDialogSteps.assertDialogWithContentIsVisible('The following steps show how to use the Talk to Your Graph view to create an agent.');
|
|
38
38
|
GuideDialogSteps.clickOnNextButton();
|
|
39
39
|
|
|
40
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 2/
|
|
40
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 2/30');
|
|
41
41
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Lab menu.');
|
|
42
42
|
MainMenuSteps.clickOnMenuLab();
|
|
43
43
|
|
|
44
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 3/
|
|
44
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 3/30');
|
|
45
45
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the Talk to Your Graph menu.');
|
|
46
46
|
MainMenuSteps.clickOnTTYGSubmenu();
|
|
47
47
|
|
|
48
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 5/
|
|
48
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 5/30');
|
|
49
49
|
GuideDialogSteps.assertDialogWithContentIsVisible('An agent is a helpful assistant that can answer your queries. You need to configure an agent in order to ask anything of Talk to Your Graph.');
|
|
50
50
|
GuideDialogSteps.clickOnNextButton();
|
|
51
51
|
|
|
52
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 7/
|
|
52
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 7/30');
|
|
53
53
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the create agent button to create a new agent.');
|
|
54
54
|
TTYGViewSteps.clickCreateAgentButton();
|
|
55
55
|
|
|
56
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 9/
|
|
56
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 9/30');
|
|
57
57
|
GuideDialogSteps.assertDialogWithContentIsVisible('Type a name for the agent. You will refer to it later.');
|
|
58
58
|
TtygAgentSettingsModalSteps.typeAgentName('MyAgent');
|
|
59
59
|
GuideDialogSteps.clickOnNextButton();
|
|
60
60
|
|
|
61
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 10/
|
|
61
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 10/30');
|
|
62
62
|
GuideDialogSteps.assertDialogWithContentIsVisible('Here you can type the name of the OpenAI model to be used.');
|
|
63
63
|
TtygAgentSettingsModalSteps.clearLLMModel();
|
|
64
64
|
TtygAgentSettingsModalSteps.typeLLMModel('gpt-3.5-turbo');
|
|
65
65
|
GuideDialogSteps.clickOnNextButton();
|
|
66
66
|
|
|
67
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 11/
|
|
67
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 11/30');
|
|
68
68
|
GuideDialogSteps.assertDialogWithContentIsVisible('Sets the sampling temperature of the agent. Lower values result in more consistent, repetitive responses generated by the agent and higher values result in a wider variety of responses');
|
|
69
69
|
TtygAgentSettingsModalSteps.setTemperature(0.8);
|
|
70
70
|
GuideDialogSteps.clickOnNextButton();
|
|
71
71
|
|
|
72
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 12/
|
|
72
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 12/30');
|
|
73
73
|
GuideDialogSteps.assertDialogWithContentIsVisible('Sets the nucleus sampling of the agent');
|
|
74
74
|
TtygAgentSettingsModalSteps.setTopP(0.9);
|
|
75
75
|
GuideDialogSteps.clickOnNextButton();
|
|
76
76
|
|
|
77
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 13/
|
|
77
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 13/30');
|
|
78
78
|
GuideDialogSteps.assertDialogWithContentIsVisible('Enabling SPARQL search allows the agent to answers questions by performing a SPARQL query.');
|
|
79
79
|
GuideDialogSteps.clickOnNextButton();
|
|
80
80
|
|
|
81
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 14/
|
|
81
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 14/30');
|
|
82
82
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the toggle to enable SPARQL search query method.');
|
|
83
83
|
TtygAgentSettingsModalSteps.enableSparqlExtractionMethod();
|
|
84
84
|
|
|
85
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 15/
|
|
85
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 15/30');
|
|
86
86
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the toggle to enable providing an ontology in a named graph.');
|
|
87
87
|
TtygAgentSettingsModalSteps.selectSparqlMethodOntologyGraph();
|
|
88
88
|
|
|
89
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 16/
|
|
89
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 16/30');
|
|
90
90
|
GuideDialogSteps.assertDialogWithContentIsVisible('Type http://example.org/some/test/ontology as the named graph which contains the ontology.');
|
|
91
91
|
TtygAgentSettingsModalSteps.clearSparqlMethodOntologyGraphField();
|
|
92
92
|
TtygAgentSettingsModalSteps.typeSparqlMethodOntologyGraphField('http://example.org/some/test/ontology');
|
|
93
93
|
GuideDialogSteps.clickOnNextButton();
|
|
94
94
|
|
|
95
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 17/
|
|
95
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('SPARQL search query method — 17/30');
|
|
96
96
|
GuideDialogSteps.assertDialogWithContentIsVisible('Check to automatically add missing namespaces.');
|
|
97
97
|
TtygAgentSettingsModalSteps.toggleAddMissingNamespacesCheckbox();
|
|
98
98
|
|
|
99
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('FTS search query method — 18/
|
|
99
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('FTS search query method — 18/30');
|
|
100
100
|
GuideDialogSteps.assertDialogWithContentIsVisible('Enabling FTS search allows the agent to answer questions by using full-text search in literals and IRIs.');
|
|
101
101
|
GuideDialogSteps.clickOnNextButton();
|
|
102
102
|
|
|
103
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('FTS search query method — 19/
|
|
103
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('FTS search query method — 19/30');
|
|
104
104
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the toggle to enable FTS search query method.');
|
|
105
105
|
TtygAgentSettingsModalSteps.enableFtsExtractionMethod();
|
|
106
106
|
|
|
107
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('FTS search query method — 20/
|
|
107
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('FTS search query method — 20/30');
|
|
108
108
|
GuideDialogSteps.assertDialogWithContentIsVisible('Type 100 as the maximum number of triples to retrieve per call.');
|
|
109
109
|
TtygAgentSettingsModalSteps.setFtsSearchMaxTriples(100);
|
|
110
110
|
GuideDialogSteps.clickOnNextButton();
|
|
111
111
|
|
|
112
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Similarity search query method — 21/
|
|
112
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Similarity search query method — 21/30');
|
|
113
113
|
GuideDialogSteps.assertDialogWithContentIsVisible('Enabling Similarity search allows the agent to answer questions by using Similarity search.');
|
|
114
114
|
GuideDialogSteps.clickOnNextButton();
|
|
115
115
|
|
|
116
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Similarity search query method — 22/
|
|
116
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Similarity search query method — 22/30');
|
|
117
117
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the toggle to enable Similarity search query method.');
|
|
118
118
|
TtygAgentSettingsModalSteps.enableSimilaritySearchMethodPanel();
|
|
119
119
|
|
|
120
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Similarity search query method — 23/
|
|
120
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Similarity search query method — 23/30');
|
|
121
121
|
GuideDialogSteps.assertDialogWithContentIsVisible('Select the index to use for Similarity search.');
|
|
122
122
|
TtygAgentSettingsModalSteps.selectSimilarityIndex(0);
|
|
123
123
|
GuideDialogSteps.clickOnNextButton();
|
|
124
124
|
|
|
125
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 24/
|
|
125
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 24/30');
|
|
126
126
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the toggle to enable Full-text search in labels for IRI discovery');
|
|
127
127
|
TtygAgentSettingsModalSteps.checkIriDiscoverySearchCheckbox();
|
|
128
128
|
|
|
129
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 25/
|
|
129
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 25/30');
|
|
130
130
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click on the toggle to enable Autocomplete for IRI discovery.');
|
|
131
131
|
TtygAgentSettingsModalSteps.checkAutocompleteSearchCheckbox();
|
|
132
132
|
|
|
133
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 26/
|
|
133
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 26/30');
|
|
134
134
|
GuideDialogSteps.assertDialogWithContentIsVisible('Set the Max number of results (IRIs) per call to 15');
|
|
135
135
|
TtygAgentSettingsModalSteps.setAutocompleteMaxResults(15);
|
|
136
136
|
GuideDialogSteps.clickOnNextButton();
|
|
137
137
|
|
|
138
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('
|
|
138
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Talk to Your Graph — 27/30');
|
|
139
|
+
GuideDialogSteps.assertDialogWithContentIsVisible('Set Context Size to 4096 so the model can use the ontology and conversation history to answer correctly');
|
|
140
|
+
TtygAgentSettingsModalSteps.getContextSizeField().focus();
|
|
141
|
+
TtygAgentSettingsModalSteps.clearContextSize();
|
|
142
|
+
TtygAgentSettingsModalSteps.enterContextSize(4096);
|
|
143
|
+
GuideDialogSteps.clickOnNextButton();
|
|
144
|
+
|
|
145
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 28/30');
|
|
139
146
|
GuideDialogSteps.assertDialogWithContentIsVisible('Enter the following in the input:');
|
|
140
147
|
TtygAgentSettingsModalSteps.clearUserInstructions();
|
|
141
148
|
TtygAgentSettingsModalSteps.getCodeToCopy().then(code => {
|
|
@@ -143,7 +150,7 @@ describe('ttyg configure agent guide', () => {
|
|
|
143
150
|
GuideDialogSteps.clickOnNextButton();
|
|
144
151
|
});
|
|
145
152
|
|
|
146
|
-
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent —
|
|
153
|
+
GuideDialogSteps.assertDialogWithTitleIsVisible('Create an agent — 29/30');
|
|
147
154
|
GuideDialogSteps.assertDialogWithContentIsVisible('Click to save the agent settings');
|
|
148
155
|
TtygAgentSettingsModalSteps.saveAgent();
|
|
149
156
|
});
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {SparqlEditorSteps} from
|
|
2
|
-
import {YasqeSteps} from
|
|
3
|
-
import {YasrSteps} from
|
|
4
|
-
import {QueryStubs} from
|
|
1
|
+
import {SparqlEditorSteps} from '../../../../steps/sparql-editor-steps';
|
|
2
|
+
import {YasqeSteps} from '../../../../steps/yasgui/yasqe-steps';
|
|
3
|
+
import {YasrSteps} from '../../../../steps/yasgui/yasr-steps';
|
|
4
|
+
import {QueryStubs} from '../../../../stubs/yasgui/query-stubs';
|
|
5
|
+
import {GraphConfigStubs} from '../../../../stubs/graph-config-stubs.js';
|
|
6
|
+
import {BrowserStubs} from '../../../../stubs/browser-stubs.js';
|
|
5
7
|
|
|
6
|
-
describe('
|
|
8
|
+
describe('"Visualize" split button', () => {
|
|
7
9
|
let repositoryId;
|
|
8
10
|
|
|
9
11
|
beforeEach(() => {
|
|
10
|
-
repositoryId = '
|
|
12
|
+
repositoryId = 'yasr-vizualize-split-button' + Date.now();
|
|
11
13
|
QueryStubs.stubQueryCountResponse();
|
|
12
14
|
cy.createRepository({id: repositoryId});
|
|
13
15
|
cy.presetRepository(repositoryId);
|
|
14
|
-
// Given I visit a page with
|
|
16
|
+
// Given I visit a page with 'ontotex-yasgu-web-component' in it.
|
|
15
17
|
SparqlEditorSteps.visitSparqlEditorPage();
|
|
16
18
|
});
|
|
17
19
|
|
|
@@ -19,34 +21,86 @@ describe('Visual graph button when user execute a CONSTRUCT query', () => {
|
|
|
19
21
|
cy.deleteRepository(repositoryId);
|
|
20
22
|
});
|
|
21
23
|
|
|
22
|
-
it('
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
it('should display "Visualize" split button when user execute a CONSTRUCT query', () => {
|
|
25
|
+
// WHEN: I visit a page with 'ontotext-yasgui-web-component' on it, and execute select query.
|
|
26
|
+
executeSelectQuery();
|
|
27
|
+
// THEN: I expect the 'Visualize' button to not be visible.
|
|
28
|
+
YasrSteps.getVisualizeMainButton().should('not.be.visible');
|
|
29
|
+
|
|
30
|
+
// WHEN: I execute a CONSTRUCT query.
|
|
31
|
+
executeConstructQuery();
|
|
32
|
+
// THEN: I expect the 'Visualize' button to be visible.
|
|
33
|
+
YasrSteps.getVisualizeMainButton().should('be.visible');
|
|
34
|
+
|
|
35
|
+
// WHEN: I execute SELECT query again.
|
|
36
|
+
executeSelectQuery();
|
|
37
|
+
// THEN: I expect the 'Visualize' button to not be visible.
|
|
38
|
+
YasrSteps.getVisualizeMainButton().should('not.be.visible');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should inform user that there no created graph configurations', () => {
|
|
42
|
+
// GIVEN: There are no graph configurations.
|
|
43
|
+
GraphConfigStubs.stubGetEmptyGraphConfigs();
|
|
44
|
+
// AND: I visit a page with 'ontotext-yasgui-web-component' on it, and the 'Visualize' button is visible.
|
|
45
|
+
executeConstructQuery();
|
|
46
|
+
|
|
47
|
+
// WHEN: I open the dropdown.
|
|
48
|
+
YasrSteps.toggleGraphConfigDropdown();
|
|
49
|
+
// THEN: I expect to see message that informs that there are no graph configurations.
|
|
50
|
+
YasrSteps.getNoConfigurationsMessage().should('contain.text', 'No advanced graph configuration.');
|
|
51
|
+
|
|
52
|
+
// WHEN: I click on create link.
|
|
53
|
+
BrowserStubs.stubWindowOpen();
|
|
54
|
+
YasrSteps.clickCreateGraphConfigLink();
|
|
55
|
+
// THEN: I expect to be navigated to graph configurations page.
|
|
56
|
+
cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', 'graphs-visualizations', '_blank', 'noopener,noreferrer');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should open graphs-visualizations view when click on main button', () => {
|
|
60
|
+
// GIVEN: I visit a page with 'ontotext-yasgui-web-component' on it, and the 'Visualize' button is visible.
|
|
61
|
+
executeConstructQuery();
|
|
62
|
+
|
|
63
|
+
// WHEN: I click on main button
|
|
64
|
+
YasrSteps.clickOnVisualizeMainButton();
|
|
65
|
+
// THEN: I expect to be navigated to graphs-visualizations view.
|
|
66
|
+
cy.url().should('include', 'graphs-visualizations');
|
|
67
|
+
cy.getQueryParam('query').should('include', 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX onto: <http://www.ontotext.com/>CONSTRUCT {?source rdf:type ?destination .} WHERE {?bag rdf:type ?source .?flight rdf:type ?destination}');
|
|
68
|
+
cy.getQueryParam('config').should('not.exist');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should open graphs-visualizations view when select a graph configuration', () => {
|
|
72
|
+
// GIVEN: I visit a page with 'ontotext-yasgui-web-component' on it, and the 'Visualize' button is visible.
|
|
73
|
+
executeConstructQuery();
|
|
74
|
+
GraphConfigStubs.stubGetGraphConfigs();
|
|
75
|
+
|
|
76
|
+
// WHEN: I open the dropdown.
|
|
77
|
+
YasrSteps.toggleGraphConfigDropdown();
|
|
78
|
+
// THEN: I expect to see only 'search' graph configurations.
|
|
79
|
+
YasrSteps.getGraphConfigs().should('have.length', 2);
|
|
80
|
+
|
|
81
|
+
// WHEN: I select a graph configuration
|
|
82
|
+
YasrSteps.selectGraphConfig();
|
|
83
|
+
// THEN: I expect to be navigated to graphs-visualizations view.
|
|
84
|
+
cy.url().should('include', 'graphs-visualizations');
|
|
85
|
+
cy.getQueryParam('query').should('include', 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX onto: <http://www.ontotext.com/>CONSTRUCT {?source rdf:type ?destination .} WHERE {?bag rdf:type ?source .?flight rdf:type ?destination}');
|
|
86
|
+
cy.getQueryParam('config').should('eq', 'de99fd5de7f94ef98f1875dff55fc1c9');
|
|
51
87
|
});
|
|
52
88
|
});
|
|
89
|
+
|
|
90
|
+
const executeSelectQuery = () => {
|
|
91
|
+
YasqeSteps.pasteQuery('select * where {?s ?p ?o.}');
|
|
92
|
+
YasqeSteps.executeQuery();
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const executeConstructQuery = () => {
|
|
96
|
+
YasqeSteps.pasteQuery(
|
|
97
|
+
'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' +
|
|
98
|
+
'PREFIX onto: <http://www.ontotext.com/>' +
|
|
99
|
+
'CONSTRUCT {' +
|
|
100
|
+
'?source rdf:type ?destination .' +
|
|
101
|
+
'} WHERE {' +
|
|
102
|
+
'?bag rdf:type ?source .' +
|
|
103
|
+
'?flight rdf:type ?destination' +
|
|
104
|
+
'}');
|
|
105
|
+
YasqeSteps.executeQuery();
|
|
106
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "de99fd5de7f94ef98f1875dff55fc1c9",
|
|
4
|
+
"name": "Graph Config 1",
|
|
5
|
+
"startMode": "search",
|
|
6
|
+
"owner": "admin",
|
|
7
|
+
"startQueryIncludeInferred": true,
|
|
8
|
+
"startQuerySameAs": true,
|
|
9
|
+
"startGraphQuery": "# CONSTRUCT or DESCRIBE query. The results will be rendered visually as a graph of triples.\nCONSTRUCT WHERE {\n\t?s ?p ?o\n} LIMIT 10",
|
|
10
|
+
"startIRI": null,
|
|
11
|
+
"startIRILabel": null,
|
|
12
|
+
"expandQuery": null,
|
|
13
|
+
"resourceQuery": null,
|
|
14
|
+
"predicateLabelQuery": null,
|
|
15
|
+
"resourcePropertiesQuery": null,
|
|
16
|
+
"shared": false,
|
|
17
|
+
"description": null,
|
|
18
|
+
"hint": null,
|
|
19
|
+
"repositoryId": "A_test"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "94cab6579df445c68c454b2156013811",
|
|
23
|
+
"name": "Graph Config 1",
|
|
24
|
+
"startMode": "search",
|
|
25
|
+
"owner": "admin",
|
|
26
|
+
"startQueryIncludeInferred": true,
|
|
27
|
+
"startQuerySameAs": true,
|
|
28
|
+
"startGraphQuery": "# CONSTRUCT or DESCRIBE query. The results will be rendered visually as a graph of triples.\nCONSTRUCT WHERE {\n\t?s ?p ?o\n} LIMIT 10",
|
|
29
|
+
"startIRI": null,
|
|
30
|
+
"startIRILabel": null,
|
|
31
|
+
"expandQuery": null,
|
|
32
|
+
"resourceQuery": null,
|
|
33
|
+
"predicateLabelQuery": null,
|
|
34
|
+
"resourcePropertiesQuery": null,
|
|
35
|
+
"shared": false,
|
|
36
|
+
"description": null,
|
|
37
|
+
"hint": null,
|
|
38
|
+
"repositoryId": null
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "94cab6579df445c68c454b2156013661",
|
|
42
|
+
"name": "Graph Config 1",
|
|
43
|
+
"startMode": "query",
|
|
44
|
+
"owner": "admin",
|
|
45
|
+
"startQueryIncludeInferred": true,
|
|
46
|
+
"startQuerySameAs": true,
|
|
47
|
+
"startGraphQuery": "# CONSTRUCT or DESCRIBE query. The results will be rendered visually as a graph of triples.\nCONSTRUCT WHERE {\n\t?s ?p ?o\n} LIMIT 10",
|
|
48
|
+
"startIRI": null,
|
|
49
|
+
"startIRILabel": null,
|
|
50
|
+
"expandQuery": null,
|
|
51
|
+
"resourceQuery": null,
|
|
52
|
+
"predicateLabelQuery": null,
|
|
53
|
+
"resourcePropertiesQuery": null,
|
|
54
|
+
"shared": false,
|
|
55
|
+
"description": null,
|
|
56
|
+
"hint": null,
|
|
57
|
+
"repositoryId": null
|
|
58
|
+
}
|
|
59
|
+
]
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "3.4.0-
|
|
3
|
+
"version": "3.4.0-TR2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "3.4.0-
|
|
9
|
+
"version": "3.4.0-TR2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
package/package.json
CHANGED
|
@@ -196,6 +196,10 @@ export class VisualGraphSteps extends BaseSteps {
|
|
|
196
196
|
return cy.get('.rdf-side-panel-content');
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
static getPropertyByIndex(index) {
|
|
200
|
+
return this.getSidePanelContent().find('.rdf-list .datasource').eq(index);
|
|
201
|
+
}
|
|
202
|
+
|
|
199
203
|
static closeSidePanel() {
|
|
200
204
|
this.getSidePanelCloseButton().click();
|
|
201
205
|
}
|
|
@@ -109,8 +109,48 @@ export class YasrSteps extends BaseSteps {
|
|
|
109
109
|
return YasrSteps.getYasr().find('.yasr-toolbar');
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
static
|
|
113
|
-
return YasrSteps.getYasrToolbar().find('.explore-visual-graph
|
|
112
|
+
static getGraphExploreSplitButton() {
|
|
113
|
+
return YasrSteps.getYasrToolbar().find('.explore-visual-graph');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static getVisualizeMainButton() {
|
|
117
|
+
return YasrSteps.getGraphExploreSplitButton().find('.explore-visual-graph-button');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static clickOnVisualizeMainButton() {
|
|
121
|
+
YasrSteps.getVisualizeMainButton().click();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static getDropdownToggleButton() {
|
|
125
|
+
return YasrSteps.getGraphExploreSplitButton().find('.onto-dropdown-button');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
static toggleGraphConfigDropdown() {
|
|
129
|
+
YasrSteps.getDropdownToggleButton().click();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static getGraphConfigs() {
|
|
133
|
+
return YasrSteps.getGraphExploreSplitButton().find('.onto-dropdown-menu-item');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static getGraphConfig(index = 0) {
|
|
137
|
+
return YasrSteps.getGraphConfigs().eq(index);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static selectGraphConfig(index = 0) {
|
|
141
|
+
YasrSteps.getGraphConfig(index).click();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static getCreateGraphConfigLink() {
|
|
145
|
+
return YasrSteps.getGraphExploreSplitButton().find('.graph-create-link');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
static clickCreateGraphConfigLink() {
|
|
149
|
+
YasrSteps.getCreateGraphConfigLink().click();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
static getNoConfigurationsMessage() {
|
|
153
|
+
return YasrSteps.getGraphExploreSplitButton().find('.no-configurations-message');
|
|
114
154
|
}
|
|
115
155
|
|
|
116
156
|
static getNoDataElement() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {Stubs} from './stubs.js';
|
|
2
|
+
|
|
3
|
+
export class GraphConfigStubs extends Stubs {
|
|
4
|
+
static stubGetEmptyGraphConfigs() {
|
|
5
|
+
cy.intercept('GET', '/rest/explore-graph/config', {
|
|
6
|
+
statusCode: 200,
|
|
7
|
+
body: [],
|
|
8
|
+
}).as('getEmptyGraphConfigs');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static stubGetGraphConfigs(fixture = '/graph/graph-configurations.json') {
|
|
12
|
+
GraphConfigStubs.stubQueryResponse(
|
|
13
|
+
'/rest/explore-graph/config',
|
|
14
|
+
fixture,
|
|
15
|
+
'getGraphConfigs');
|
|
16
|
+
}
|
|
17
|
+
}
|
package/support/commands.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Cypress command to retrieve the value of a query parameter from the current page URL.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} key - The name of the query parameter to retrieve.
|
|
5
|
+
* @returns {Cypress.Chainable<string | null>} A chainable that resolves to the value of the query parameter,
|
|
6
|
+
* or null if the parameter is not present.
|
|
7
|
+
*/
|
|
8
|
+
Cypress.Commands.add('getQueryParam', (key) => {
|
|
9
|
+
return cy.location('search').then((search) => {
|
|
10
|
+
const params = new URLSearchParams(search);
|
|
11
|
+
return params.get(key);
|
|
12
|
+
});
|
|
13
|
+
});
|