graphdb-workbench-tests 3.4.0-dynamic-guides-test → 3.5.0-reactodia-poc

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.
Files changed (71) hide show
  1. package/e2e-legacy/cluster/cluster-states.spec.js +3 -3
  2. package/e2e-legacy/explore/visual-graph/node-info-panel.spec.js +58 -0
  3. package/e2e-legacy/explore/visual-graph/visual-graph-links-limit.spec.js +167 -0
  4. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +55 -78
  5. package/e2e-legacy/graphql/graphql-in-remote-location.spec.js +49 -0
  6. package/e2e-legacy/guides/navigation/navigation-guide.spec.js +64 -0
  7. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +2 -1
  8. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +34 -26
  9. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +1 -0
  10. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +330 -124
  11. package/e2e-legacy/help/guides/guides-autostart.spec.js +36 -3
  12. package/e2e-legacy/help/guides/guides-confirm-cancel-dialog.js +83 -0
  13. package/e2e-legacy/home/cookie-policy/cookie-policy.spec.js +182 -0
  14. package/e2e-legacy/home/create-repository.spec.js +6 -0
  15. package/e2e-legacy/repository/attach-remote-location.spec.js +47 -12
  16. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +1 -1
  17. package/e2e-legacy/resource/resource.spec.js +33 -13
  18. package/e2e-legacy/setup/aclmanagement/acl-management-with-selected repository.spec.js +44 -0
  19. package/e2e-legacy/sparql-editor/actions/execute-query.spec.js +2 -0
  20. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +8 -8
  21. package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +4 -4
  22. package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +3 -3
  23. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +90 -36
  24. package/e2e-legacy/sparql-editor/yasr/yasr.spec.js +80 -0
  25. package/e2e-legacy/ttyg/chat-panel.spec.js +9 -0
  26. package/e2e-legacy/ttyg/clone-agent.spec.js +22 -0
  27. package/e2e-legacy/ttyg/edit-agent.spec.js +17 -0
  28. package/e2e-security/setup/home/cookie-policy.spec.js +232 -6
  29. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +72 -59
  30. package/fixtures/graph/graph-configurations.json +59 -0
  31. package/fixtures/guides/confirm-cancel-dialog/confirm-cancel-dialog-guide.json +15 -0
  32. package/fixtures/guides/navigation/navigation-guide.json +60 -0
  33. package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +6 -1
  34. package/fixtures/guides/visual-graph/visual-graph-config-guide.json +39 -0
  35. package/fixtures/ttyg/chats/explain-response-1.json +2 -48
  36. package/npm-shrinkwrap.json +32 -33
  37. package/package.json +1 -1
  38. package/steps/cookie-policy/cookie-consent-banner-steps.js +21 -0
  39. package/steps/cookie-policy/cookie-policy-modal.steps.js +56 -0
  40. package/steps/graphql/create-graphql-endpoint-steps.js +8 -0
  41. package/steps/graphql/graphql-endpoint-management-steps.js +8 -0
  42. package/steps/graphql/graphql-playground-steps.js +8 -0
  43. package/steps/guides/guide-dialog-steps.js +56 -2
  44. package/steps/guides/movies-guide-steps.js +2 -1
  45. package/steps/header-steps.js +13 -0
  46. package/steps/home-steps.js +4 -27
  47. package/steps/login-steps.js +1 -0
  48. package/steps/main-menu-steps.js +1 -0
  49. package/steps/repositories/attach-repository-steps.js +16 -0
  50. package/steps/repository-steps.js +24 -0
  51. package/steps/resource/resource-steps.js +0 -8
  52. package/steps/setup/acl-management-steps.js +12 -0
  53. package/steps/setup/settings-steps.js +1 -1
  54. package/steps/shared-modal-dialog-steps.js +45 -0
  55. package/steps/sparql-editor-steps.js +18 -4
  56. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +1 -1
  57. package/steps/visual-graph-split-button-steps.js +45 -0
  58. package/steps/visual-graph-steps.js +69 -3
  59. package/steps/yasgui/yasr-steps.js +30 -6
  60. package/stubs/cluster/remote-location-stubs.js +4 -0
  61. package/stubs/graph-config-stubs.js +17 -0
  62. package/stubs/guides/guides-stubs.js +8 -0
  63. package/stubs/repositories/repositories-stubs.js +22 -0
  64. package/stubs/security-stubs.js +4 -0
  65. package/stubs/sparql-stubs.js +10 -0
  66. package/support/commands.js +1 -0
  67. package/support/e2e-security.js +1 -1
  68. package/support/repository-commands.js +22 -3
  69. package/support/settings-commands.js +18 -2
  70. package/support/url-commands.js +13 -0
  71. package/e2e-legacy/home/cookie-policy.spec.js +0 -108
@@ -58,7 +58,7 @@ describe('Expand results over owl:sameAs', () => {
58
58
  YasguiSteps.getYasgui().should('be.visible');
59
59
 
60
60
  // Then I expect that "sameAs" element to be enabled by default
61
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
61
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-on');
62
62
  // and the tooltip of element describes that "sameAs" element is enabled.
63
63
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
64
64
 
@@ -66,7 +66,7 @@ describe('Expand results over owl:sameAs', () => {
66
66
  YasguiSteps.openANewTab();
67
67
 
68
68
  // Then I expect that "sameAs" element to be enabled in the new tab.
69
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
69
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-on');
70
70
  // and the tooltip of element describes that "sameAs" element is enabled.
71
71
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
72
72
  });
@@ -79,7 +79,7 @@ describe('Expand results over owl:sameAs', () => {
79
79
  YasguiSteps.getYasgui().should('be.visible');
80
80
 
81
81
  // Then I expect that "sameAs" element to be disabled by default
82
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
82
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
83
83
  // and the tooltip of element describes that "sameAs" element is disabled.
84
84
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
85
85
 
@@ -87,7 +87,7 @@ describe('Expand results over owl:sameAs', () => {
87
87
  YasguiSteps.openANewTab();
88
88
 
89
89
  // Then I expect that "sameAs" element to be disabled in the new tab.
90
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
90
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
91
91
  // and the tooltip of element describes that "sameAs" element is disabled.
92
92
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
93
93
  });
@@ -102,13 +102,13 @@ describe('Expand results over owl:sameAs', () => {
102
102
  // Then I expect that "sameAs" element to be disabled by default
103
103
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
104
104
  // and the tooltip of element describes that "infer" is required.
105
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
105
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
106
106
 
107
107
  // When I open a new Tab.
108
108
  YasguiSteps.openANewTab();
109
109
 
110
110
  // Then I expect that "sameAs" element to be disabled in the new tab,
111
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
111
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
112
112
  // and the tooltip of element describes that "infer" is required.
113
113
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
114
114
  });
@@ -121,7 +121,7 @@ describe('Expand results over owl:sameAs', () => {
121
121
  YasguiSteps.getYasgui().should('be.visible');
122
122
 
123
123
  // Then I expect that "sameAs" element to be disabled by default,
124
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
124
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
125
125
  // and the tooltip of element describes that "infer" is required.
126
126
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
127
127
 
@@ -129,7 +129,7 @@ describe('Expand results over owl:sameAs', () => {
129
129
  YasguiSteps.openANewTab();
130
130
 
131
131
  // Then I expect that "sameAs" element to be disabled in the new tab,
132
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
132
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
133
133
  // and the tooltip of element describes that "infer" is required.
134
134
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
135
135
  });
@@ -64,7 +64,7 @@ describe('Include inferred statements', () => {
64
64
  YasguiSteps.getYasgui().should('be.visible');
65
65
 
66
66
  // Then I expect that "infer" element to be enabled by default,
67
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
67
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
68
68
  // and the tooltip of element describes that "infer" functionality is enabled.
69
69
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
70
70
 
@@ -72,7 +72,7 @@ describe('Include inferred statements', () => {
72
72
  YasguiSteps.openANewTab();
73
73
 
74
74
  // Then I expect that inferred element to be enabled in the new tab,
75
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
75
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
76
76
  // and the tooltip of element describes that "infer" element is enabled.
77
77
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
78
78
  });
@@ -85,7 +85,7 @@ describe('Include inferred statements', () => {
85
85
  YasguiSteps.getYasgui().should('be.visible');
86
86
 
87
87
  // Then I expect that "infer" element to be disabled by default,
88
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-off');
88
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
89
89
  // and the tooltip of element describes that "infer" element is disabled.
90
90
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
91
91
 
@@ -93,7 +93,7 @@ describe('Include inferred statements', () => {
93
93
  YasguiSteps.openANewTab();
94
94
 
95
95
  // Then I expect that inferred element to be disabled in the new tab,
96
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-off');
96
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
97
97
  // and the tooltip of element describes that "infer" element is disabled.
98
98
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
99
99
  });
@@ -37,13 +37,13 @@ describe('Expand results over owl:sameAs', () => {
37
37
 
38
38
  // Then I expect inferred button to be on.
39
39
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
40
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
40
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
41
41
 
42
42
  // When I click on inferred button
43
- YasqeSteps.getActionButton(3).click({force: true});
43
+ YasqeSteps.getActionButton(4).click({force: true});
44
44
 
45
45
  // Then I expect inferred button to not be toggled.
46
46
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
47
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
47
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
48
48
  });
49
49
  });
@@ -1,17 +1,19 @@
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";
1
+ import {SparqlEditorSteps} from '../../../../steps/sparql-editor-steps';
2
+ import {YasqeSteps} from '../../../../steps/yasgui/yasqe-steps';
3
+ import {QueryStubs} from '../../../../stubs/yasgui/query-stubs';
4
+ import {GraphConfigStubs} from '../../../../stubs/graph-config-stubs.js';
5
+ import {BrowserStubs} from '../../../../stubs/browser-stubs.js';
6
+ import {VisualGraphSplitButtonSteps} from '../../../../steps/visual-graph-split-button-steps.js';
5
7
 
6
- describe('Visual graph button when user execute a CONSTRUCT query', () => {
8
+ describe('"Visualize" split button', () => {
7
9
  let repositoryId;
8
10
 
9
11
  beforeEach(() => {
10
- repositoryId = 'sparql-editor-' + Date.now();
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 "ontotex-yasgu-web-component" in it.
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('Should display a "Visual" graph button configured by user', () => {
23
- // When I visit a page with "ontotext-yasgui-web-component" on it,
24
- // and select a CONSTRUCT query.
25
- YasqeSteps.executeQuery();
26
-
27
- // Then I expect "Visual" button to not be visible.
28
- YasrSteps.getVisualButton().should('not.be.visible');
29
-
30
- // When I execute a CONSTRUCT query.
31
- YasqeSteps.pasteQuery(
32
- 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' +
33
- 'PREFIX onto: <http://www.ontotext.com/>' +
34
- 'CONSTRUCT {' +
35
- '?source rdf:type ?destination .' +
36
- '} WHERE {' +
37
- '?bag rdf:type ?source .' +
38
- '?flight rdf:type ?destination' +
39
- '}');
40
- YasqeSteps.executeQuery();
41
-
42
- // Then I expect "Visual" button to be visible.
43
- YasrSteps.getVisualButton().should('be.visible');
44
-
45
- // When I execute SELECT query again.
46
- YasqeSteps.pasteQuery('select * where {?s ?p ?o.}');
47
- YasqeSteps.executeQuery();
48
-
49
- // Then I expect "Visual" button to not be visible.
50
- YasrSteps.getVisualButton().should('not.be.visible');
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
+ VisualGraphSplitButtonSteps.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
+ VisualGraphSplitButtonSteps.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
+ VisualGraphSplitButtonSteps.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
+ VisualGraphSplitButtonSteps.toggleGraphConfigDropdown();
49
+ // THEN: I expect to see message that informs that there are no graph configurations.
50
+ VisualGraphSplitButtonSteps.getNoConfigurationsMessage().should('contain.text', 'No advanced graph configuration.');
51
+
52
+ // WHEN: I click on create link.
53
+ BrowserStubs.stubWindowOpen();
54
+ VisualGraphSplitButtonSteps.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
+ VisualGraphSplitButtonSteps.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
+ VisualGraphSplitButtonSteps.toggleGraphConfigDropdown();
78
+ // THEN: I expect to see all graph configurations.
79
+ VisualGraphSplitButtonSteps.getGraphConfigs().should('have.length', 3);
80
+
81
+ // WHEN: I select a graph configuration
82
+ VisualGraphSplitButtonSteps.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,80 @@
1
+ import {SparqlEditorSteps} from '../../../steps/sparql-editor-steps.js';
2
+ import {YasrSteps} from '../../../steps/yasgui/yasr-steps.js';
3
+ import {YasqeSteps} from '../../../steps/yasgui/yasqe-steps.js';
4
+
5
+ describe('YASR', () => {
6
+ let repositoryId;
7
+ let secondRepositoryId;
8
+
9
+ beforeEach(() => {
10
+ repositoryId = 'yasr-' + Date.now();
11
+ cy.createRepository({id: repositoryId});
12
+ cy.presetRepository(repositoryId);
13
+ });
14
+
15
+ afterEach(() => {
16
+ cy.deleteRepository(repositoryId);
17
+ cy.deleteRepository(secondRepositoryId);
18
+ });
19
+
20
+ it('should load YASR in fullscreen with plugin config from URL', () => {
21
+ // WHEN: I visit SPARQL Query & Update page with url parameters: embedded and pluginName
22
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId, 'pivotTable', true));
23
+ // THEN: YASR is in fullscreen mode because the workbench is embedded.
24
+ YasrSteps.getYasr().should('have.class', 'yasr-fullscreen');
25
+ // AND: I expect the raw response plugin to be visible
26
+ YasrSteps.getPivotTablePlugin().should('be.visible');
27
+
28
+ // WHEN: I press the ESC key.
29
+ YasrSteps.typeEscapeKey();
30
+ // THEN: I see YASR results in fullscreen mode because Escape is disabled in this mode.
31
+ YasrSteps.getYasr().should('have.class', 'yasr-fullscreen');
32
+
33
+ // WHEN: I visit SPARQL Query & Update page with without embedded url parameter.
34
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId, 'googleChart'));
35
+ // THEN: I expect yasr to be in non-fullscreen mode
36
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
37
+ // AND: I expect Google Chart plugin to be visible
38
+ YasrSteps.getGoogleChartPlugin().should('be.visible');
39
+
40
+ // WHEN: I visit SPARQL Query & Update page with without embedded and pluginName url parameters.
41
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId));
42
+ // THEN: I expect yasr to be in non-fullscreen mode
43
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
44
+ // AND: I expect Google Chart plugin to be visible, because it was the last used plugin.
45
+ YasrSteps.getGoogleChartPlugin().should('be.visible');
46
+
47
+ // WHEN: I visit SPARQL Query & Update page with without embedded and pluginName url parameters.
48
+ // AND: There are no persisted yasr data.
49
+ cy.clearLocalStorage('yagui__graphdb-workbench-sparql-editor');
50
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId));
51
+ // THEN: I expect yasr to be in non-fullscreen mode
52
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
53
+ // AND: I expect the default plugin to be visible
54
+ YasrSteps.getExtendedTablePlugin().should('be.visible');
55
+ });
56
+
57
+ it('should trigger YASR fullscreen mode', () => {
58
+ // GIVEN: I open a page that contains "ontotext-yasgui-web-component".
59
+ SparqlEditorSteps.visitSparqlEditorPage();
60
+
61
+ // WHEN: I execute a query.
62
+ YasqeSteps.executeQuery();
63
+ // THEN: I should see YASR results in non-fullscreen mode.
64
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
65
+
66
+ // WHEN: I toggle to fullscreen mode.
67
+ YasrSteps.toggleFullscreen();
68
+ // THEN: I should see YASR results in fullscreen mode.
69
+ YasrSteps.getYasr().should('have.class', 'yasr-fullscreen');
70
+
71
+ // WHEN: I press the ESC key.
72
+ YasrSteps.typeEscapeKey();
73
+ // THEN: I should see YASR results in non-fullscreen mode, because escape is enabled when workbench is not embedded.
74
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
75
+ });
76
+ });
77
+
78
+ const getUrl = (repositoryId, pluginName, embedded = false) => {
79
+ return `repositoryId=${repositoryId}${pluginName ? ('&pluginName=' + pluginName) : ''}${embedded ? '&embedded' : ''}&query=SELECT * { ?s ?p ?o }&execute=true`;
80
+ }
@@ -3,6 +3,8 @@ import {TTYGStubs} from "../../stubs/ttyg/ttyg-stubs";
3
3
  import {TTYGViewSteps} from "../../steps/ttyg/ttyg-view-steps";
4
4
  import {ChatPanelSteps} from "../../steps/ttyg/chat-panel-steps";
5
5
  import {ApplicationSteps} from "../../steps/application-steps";
6
+ import {TtygAgentSettingsModalSteps} from '../../steps/ttyg/ttyg-agent-settings-modal.steps.js';
7
+ import {SparqlStubs} from '../../stubs/sparql-stubs.js';
6
8
 
7
9
  describe('Ttyg ChatPanel', () => {
8
10
 
@@ -147,6 +149,13 @@ describe('Ttyg ChatPanel', () => {
147
149
  TTYGViewSteps.clickOnExplainResponse(0);
148
150
  // Then I expect the hint message to not exist (it should only exist for the last 'Explain' response).
149
151
  TTYGViewSteps.getHowDeliverAnswerButton().should('not.exist');
152
+ // When I click on the open in sparql editor button for the explain response
153
+ SparqlStubs.spyAddKnownPrefixes();
154
+ TtygAgentSettingsModalSteps.clickOpenQueryInSparqlEditor(0);
155
+ // Then I expect a request for appending prefixes to be sent with the correct query.
156
+ cy.wait('@addKnownPrefixes').its('request.body').then((body) => {
157
+ expect(body).to.contain('SELECT ?name ?height WHERE {\n ?character voc:height ?height;\n rdfs:label ?name.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}');
158
+ });
150
159
 
151
160
  // Then when I click on explain response button on the second answer
152
161
  TTYGStubs.stubExplainResponse('/ttyg/chats/explain-response-2.json');
@@ -17,6 +17,7 @@ describe('TTYG clone an agent', () => {
17
17
  TTYGStubs.stubAgentListGet();
18
18
  TTYGStubs.stubChatsListGet();
19
19
  TTYGStubs.stubChatGet();
20
+ RepositoriesStubs.stubRepositoryModel(repositoryId);
20
21
  // Given I have opened the ttyg page
21
22
  TTYGViewSteps.visit();
22
23
  cy.wait('@get-all-repositories');
@@ -45,6 +46,7 @@ describe('TTYG clone an agent', () => {
45
46
  TTYGStubs.stubAgentCreate();
46
47
  TtygAgentSettingsModalSteps.saveAgent();
47
48
  cy.wait('@create-agent').then((interception) => {
49
+ // eslint-disable-next-line no-undef
48
50
  assert.deepEqual(interception.request.body, {
49
51
  "id": "asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",
50
52
  "name": "agent-11",
@@ -72,4 +74,24 @@ describe('TTYG clone an agent', () => {
72
74
  });
73
75
  });
74
76
  });
77
+
78
+ it('should not be able to clone an agent if an extraction method is selected but the precondition has failed', () => {
79
+ TTYGStubs.stubAgentListGet();
80
+ TTYGStubs.stubChatsListGet();
81
+ TTYGStubs.stubChatGet();
82
+ RepositoriesStubs.stubFtsSearchDisabled(repositoryId);
83
+
84
+ // GIVEN: I have opened the TTYG page
85
+ TTYGViewSteps.visit();
86
+ cy.wait('@get-all-repositories');
87
+ cy.wait('@get-agent-list');
88
+ cy.wait('@get-chat');
89
+
90
+ // WHEN: I try to clone an agent that has the FTS extraction method enabled, but FTS is disabled in the repository
91
+ TTYGViewSteps.expandAgentsSidebar();
92
+ TTYGViewSteps.triggerCloneAgentActionMenu(0);
93
+
94
+ // THEN: The Save Agent button should be disabled
95
+ TtygAgentSettingsModalSteps.getSaveAgentButton().should('be.disabled');
96
+ });
75
97
  });
@@ -12,6 +12,7 @@ describe('TTYG edit an agent', () => {
12
12
  beforeEach(() => {
13
13
  RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
14
14
  RepositoriesStubs.stubBaseEndpoints(repositoryId);
15
+ RepositoriesStubs.stubRepositoryModel(repositoryId);
15
16
  cy.presetRepository(repositoryId);
16
17
  TTYGStubs.stubAgentDefaultsGet();
17
18
  });
@@ -44,6 +45,22 @@ describe('TTYG edit an agent', () => {
44
45
  ToasterSteps.verifySuccess('The agent \'agent-1\' was saved successfully.');
45
46
  });
46
47
 
48
+ it('should not be able to edit an agent if an extraction method is selected but the precondition has failed', () => {
49
+ TTYGStubs.stubChatsListGet();
50
+ TTYGStubs.stubAgentListGet();
51
+ TTYGStubs.stubChatGet();
52
+ RepositoriesStubs.stubFtsSearchDisabled(repositoryId);
53
+ // GIVEN: I have opened the TTYG page
54
+ TTYGViewSteps.visit();
55
+ cy.wait('@get-chat-list');
56
+ cy.wait('@get-agent-list');
57
+ cy.wait('@get-chat');
58
+ // WHEN: I try to edit an agent that has the FTS extraction method enabled, but FTS is disabled in the repository
59
+ TTYGViewSteps.openAgentSettingsModalForAgent(0);
60
+
61
+ // THEN: The Save Agent button should be disabled
62
+ TtygAgentSettingsModalSteps.getSaveAgentButton().should('be.disabled');
63
+ });
47
64
 
48
65
  it('should be able to edit Autocomplete extraction method option', () => {
49
66
  TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-autocomplete-query.json');