graphdb-workbench-tests 3.3.3-TR1 → 3.4.0-RC1

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 (84) hide show
  1. package/cypress-flaky.config.js +2 -0
  2. package/cypress-legacy.config.js +2 -2
  3. package/cypress-security.config.js +3 -14
  4. package/e2e-flaky/import/import-server-files-operations.spec.js +1 -1
  5. package/e2e-flaky/import/import-user-data-batch-operations.spec.js +1 -1
  6. package/e2e-flaky/setup/sparql-template-create.js +3 -18
  7. package/e2e-flaky/sparql-editor/actions/execute-update-query.spec.js +2 -12
  8. package/e2e-flaky/sparql-editor/actions/share-query.spec.js +1 -7
  9. package/e2e-flaky/sparql-editor/yasr/table-plugin.spec.js +1 -6
  10. package/e2e-legacy/cluster/cluster-states.spec.js +3 -3
  11. package/e2e-legacy/explore/visual-graph/node-info-panel.spec.js +58 -0
  12. package/e2e-legacy/explore/visual-graph/visual-graph-links-limit.spec.js +167 -0
  13. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +57 -85
  14. package/e2e-legacy/graphql/graphql-in-remote-location.spec.js +49 -0
  15. package/e2e-legacy/guides/execute-sparql-query/execute-sparql-query-guide.spec.js +92 -0
  16. package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +63 -0
  17. package/e2e-legacy/guides/import-rdf-file/import-rdf-file.spec.js +105 -0
  18. package/e2e-legacy/guides/navigation/navigation-guide.spec.js +64 -0
  19. package/e2e-legacy/guides/rdf-rank/rdf-rank-guide.spec.js +42 -0
  20. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +168 -0
  21. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +34 -26
  22. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +2 -2
  23. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +372 -0
  24. package/e2e-legacy/guides/welcome/welcome-guide.spec.js +36 -0
  25. package/e2e-legacy/help/guides/guides-autostart.spec.js +36 -3
  26. package/e2e-legacy/help/guides/guides-confirm-cancel-dialog.js +83 -0
  27. package/e2e-legacy/help/guides/movies-interactive-guide.spec.js +47 -49
  28. package/e2e-legacy/repository/attach-remote-location.spec.js +47 -12
  29. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +1 -0
  30. package/e2e-legacy/resource/resource.spec.js +34 -19
  31. package/e2e-legacy/setup/aclmanagement/acl-management-with-selected repository.spec.js +44 -0
  32. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +3 -0
  33. package/e2e-legacy/setup/connectors-lucene.spec.js +24 -8
  34. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +9 -9
  35. package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +4 -4
  36. package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +3 -3
  37. package/e2e-legacy/sparql-editor/actions/show-saved-queries.spec.js +1 -6
  38. package/e2e-legacy/sparql-editor/yasgui-tabs.spec.js +2 -12
  39. package/e2e-legacy/sparql-editor/yasr/pagination.spec.js +5 -18
  40. package/e2e-legacy/sparql-editor/yasr/table-plugin.spec.js +1 -6
  41. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +90 -41
  42. package/e2e-legacy/sparql-editor/yasr/yasr.spec.js +80 -0
  43. package/e2e-legacy/ttyg/chat-list.spec.js +2 -12
  44. package/e2e-legacy/ttyg/create-agent.spec.js +8 -48
  45. package/e2e-legacy/ttyg/edit-agent.spec.js +2 -12
  46. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +73 -61
  47. package/fixtures/graph/graph-configurations.json +59 -0
  48. package/fixtures/guides/confirm-cancel-dialog/confirm-cancel-dialog-guide.json +15 -0
  49. package/fixtures/guides/execute-sparql-query/execute-sparql-query-guide.json +54 -0
  50. package/fixtures/guides/import-rdf-file/confirm-duplicate-rdf-file-guide.json +30 -0
  51. package/fixtures/guides/import-rdf-file/import-rdf-file-guide.json +21 -0
  52. package/fixtures/guides/navigation/navigation-guide.json +60 -0
  53. package/fixtures/guides/rdf-rank/rdf-rank-guide.json +18 -0
  54. package/fixtures/guides/table-graph-explore/table-graph-explore-guide.json +51 -0
  55. package/fixtures/guides/table-graph-explore/table-graph-explore-without-substeps-guide.json +25 -0
  56. package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +6 -1
  57. package/fixtures/guides/visual-graph/visual-graph-config-guide.json +39 -0
  58. package/fixtures/guides/visual-graph/visual-graph-guide.json +85 -0
  59. package/fixtures/guides/welcome/welcome-guide.json +18 -0
  60. package/npm-shrinkwrap.json +335 -282
  61. package/package.json +1 -1
  62. package/steps/graphql/create-graphql-endpoint-steps.js +8 -0
  63. package/steps/graphql/graphql-endpoint-management-steps.js +8 -0
  64. package/steps/graphql/graphql-playground-steps.js +8 -0
  65. package/steps/guides/guide-dialog-steps.js +60 -2
  66. package/steps/guides/movies-guide-steps.js +2 -1
  67. package/steps/main-menu-steps.js +1 -0
  68. package/steps/repositories/attach-repository-steps.js +16 -0
  69. package/steps/repository-steps.js +24 -0
  70. package/steps/resource/resource-steps.js +0 -8
  71. package/steps/setup/acl-management-steps.js +16 -0
  72. package/steps/sparql-editor-steps.js +18 -4
  73. package/steps/sparql-steps.js +13 -1
  74. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +1 -1
  75. package/steps/visual-graph-split-button-steps.js +45 -0
  76. package/steps/visual-graph-steps.js +84 -2
  77. package/steps/yasgui/yasqe-steps.js +29 -4
  78. package/steps/yasgui/yasr-steps.js +34 -6
  79. package/stubs/cluster/remote-location-stubs.js +4 -0
  80. package/stubs/graph-config-stubs.js +17 -0
  81. package/stubs/guides/guides-stubs.js +41 -1
  82. package/support/commands.js +1 -0
  83. package/support/repository-commands.js +22 -3
  84. package/support/url-commands.js +13 -0
@@ -9,6 +9,8 @@ export default defineConfig({
9
9
  video: true,
10
10
  defaultCommandTimeout: 25000,
11
11
  numTestsKeptInMemory: 10,
12
+ viewportWidth: 1600,
13
+ viewportHeight: 1200,
12
14
  e2e: {
13
15
  retries: {
14
16
  runMode: 2,
@@ -17,8 +17,8 @@ export default defineConfig({
17
17
  video: true,
18
18
  defaultCommandTimeout: 25000,
19
19
  numTestsKeptInMemory: 10,
20
- viewportWidth: 1280,
21
- viewportHeight: 720,
20
+ viewportWidth: 1600,
21
+ viewportHeight: 1200,
22
22
  e2e: {
23
23
  retries: {
24
24
  runMode: 2,
@@ -1,14 +1,6 @@
1
1
  import { defineConfig } from 'cypress';
2
2
  import setupPlugins from './plugins/index.js';
3
3
 
4
- const isCoverage = process.env.COVERAGE === 'true';
5
-
6
- const loadCodeCoverage = async (on, config) => {
7
- const mod = await import('@bahmutov/cypress-code-coverage/plugin');
8
- const plugin = ('default' in mod) ? mod.default : mod;
9
- plugin(on, config);
10
- };
11
-
12
4
  export default defineConfig({
13
5
  projectId: 'v35btb',
14
6
  fixturesFolder: 'fixtures',
@@ -17,8 +9,8 @@ export default defineConfig({
17
9
  video: true,
18
10
  defaultCommandTimeout: 25000,
19
11
  numTestsKeptInMemory: 10,
20
- viewportWidth: 1280,
21
- viewportHeight: 720,
12
+ viewportWidth: 1600,
13
+ viewportHeight: 1200,
22
14
  e2e: {
23
15
  retries: {
24
16
  runMode: 2,
@@ -28,14 +20,11 @@ export default defineConfig({
28
20
  // You may want to clean this up later by importing these.
29
21
  async setupNodeEvents(on, config) {
30
22
  setupPlugins(on, config);
31
- if (isCoverage) {
32
- await loadCodeCoverage(on, config);
33
- }
34
23
  return config;
35
24
  },
36
25
  baseUrl: 'http://localhost:9000',
37
26
  specPattern: 'e2e-security/**/*.{js,jsx,ts,tsx}',
38
- supportFile: 'support/e2e.js',
27
+ supportFile: 'support/e2e-security.js',
39
28
  reporter: "cypress-multi-reporters",
40
29
  reporterOptions: {
41
30
  configFile: 'cypress-reporter-config.json'
@@ -1,7 +1,7 @@
1
1
  import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
2
2
  import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
3
3
 
4
- describe('Import server files - Operations', {retries: {runMode: 2}}, () => {
4
+ describe('Import server files - Operations', () => {
5
5
 
6
6
  let repositoryId;
7
7
 
@@ -14,7 +14,7 @@ const jsonld = JSON.stringify({
14
14
  "ab:email": "richard491@hotmail.com"
15
15
  });
16
16
 
17
- describe('Import user data: Batch operations', {retries: {runMode: 2}}, () => {
17
+ describe('Import user data: Batch operations', () => {
18
18
 
19
19
  let repositoryId;
20
20
  const testFiles = [
@@ -26,12 +26,7 @@ describe('SPARQL create template', () => {
26
26
  cy.deleteRepository(secondRepositoryId);
27
27
  });
28
28
 
29
- it('should has error message described that query is invalid', {
30
- retries: {
31
- runMode: 1,
32
- openMode: 0
33
- }
34
- }, () => {
29
+ it('should has error message described that query is invalid', () => {
35
30
  // When I visit 'Sparql create template' view,
36
31
  // and fill valid template id.
37
32
  SparqlCreateUpdateSteps.typeTemplateId('http://test');
@@ -48,12 +43,7 @@ describe('SPARQL create template', () => {
48
43
  /**
49
44
  * TODO: Fix me. Broken due to migration (Repository selector changed)
50
45
  */
51
- it.skip('should display confirm dialog I am updating a sparql template and change the repository', {
52
- retries: {
53
- runMode: 1,
54
- openMode: 0
55
- }
56
- }, () => {
46
+ it.skip('should display confirm dialog I am updating a sparql template and change the repository', () => {
57
47
  // When I visit 'Sparql create template' view,
58
48
  // create a SPARQL template
59
49
  const templateId = 'http://' + Date.now();
@@ -119,12 +109,7 @@ describe('SPARQL create template', () => {
119
109
  /**
120
110
  * TODO: Fix me. Broken due to migration (Changes in main menu)
121
111
  */
122
- it.skip('should confirm me before navigate when query is changed', {
123
- retries: {
124
- runMode: 1,
125
- openMode: 0
126
- }
127
- }, () => {
112
+ it.skip('should confirm me before navigate when query is changed', () => {
128
113
  // When I visit 'Sparql create template' view,
129
114
  // and change the query in ontotext-yasgui editor.
130
115
  // When I fill non update query (select for example).
@@ -22,12 +22,7 @@ describe('Execute of update query', () => {
22
22
  cy.deleteRepository(repositoryId);
23
23
  });
24
24
 
25
- it('should display properly result message info when insert 2 statements', {
26
- retries: {
27
- runMode: 1,
28
- openMode: 0
29
- }
30
- }, () => {
25
+ it('should display properly result message info when insert 2 statements', () => {
31
26
  // When I execute insert query which adds 2 results
32
27
  YasqeSteps.pasteQuery(
33
28
  'PREFIX : <http://bedrock/> ' +
@@ -56,12 +51,7 @@ describe('Execute of update query', () => {
56
51
  TablePluginSteps.getQueryResultInfo().contains('The number of statements did not change.');
57
52
  });
58
53
 
59
- it('should display result message info which describes that two statements are removed', {
60
- retries: {
61
- runMode: 1,
62
- openMode: 0
63
- }
64
- }, () => {
54
+ it('should display result message info which describes that two statements are removed', () => {
65
55
  // When I visit a page with "ontotext-yasgui-web-component" in it,
66
56
  // and selected repository has some inserted statements.
67
57
  YasqeSteps.pasteQuery(
@@ -47,13 +47,7 @@ describe('Share query', () => {
47
47
  ApplicationSteps.getSuccessNotifications().should('be.visible');
48
48
  });
49
49
 
50
- it('Should be able to open a share link in a new editor tab',
51
- {
52
- retries: {
53
- runMode: 1,
54
- openMode: 0
55
- }
56
- }, () => {
50
+ it('Should be able to open a share link in a new editor tab',() => {
57
51
  // Given I have opened the sparql editor
58
52
  YasguiSteps.getTabs().should('have.length', 1);
59
53
  // When I get the shareable link for current query
@@ -35,12 +35,7 @@ describe.skip('Yasr Table plugin', () => {
35
35
  YasrSteps.getCopyResourceLink(28, 2).should('be.visible');
36
36
  });
37
37
 
38
- it('Should be able to copy a link', {
39
- retries: {
40
- runMode: 1,
41
- openMode: 0
42
- }
43
- }, () => {
38
+ it('Should be able to copy a link', () => {
44
39
  // When I execute a query which returns results of type is uri.
45
40
  QueryStubs.stubDefaultQueryResponse();
46
41
  YasqeSteps.executeQuery();
@@ -104,14 +104,14 @@ describe('Cluster states', () => {
104
104
  ClusterViewSteps.getLink('pc-desktop-7300-pc-desktop-7302').should('have.css', 'stroke-dasharray', '10px, 10px')
105
105
  .and('have.css', 'marker-mid', 'url("#arrowhead_big")')
106
106
  .invoke('attr', 'stroke')
107
- .should('eq', 'var(--gw-secondary-base)');
107
+ .should('eq', 'var(--gw-foreground-on-surface-primary)');
108
108
  // And I expect an out of sync link between the leader and the out of sync node (the one receiving the snapshot)
109
109
  ClusterViewSteps.getLink('pc-desktop-7301-pc-desktop-7300').should('have.css', 'stroke-dasharray', '10px, 10px')
110
110
  .invoke('attr', 'stroke')
111
- .should('eq', 'var(--gw-neutral-base)');
111
+ .should('eq', 'var(--gw-neutral-light)');
112
112
  // And I expect to have an in sync link between the leader and the node sending the snapshot
113
113
  ClusterViewSteps.getLink('pc-desktop-7301-pc-desktop-7302').should('have.css', 'stroke-dasharray', 'none')
114
114
  .invoke('attr', 'stroke')
115
- .should('eq', 'var(--gw-secondary-base)');
115
+ .should('eq', 'var(--gw-foreground-on-surface-primary)');
116
116
  });
117
117
  });
@@ -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
+ });
@@ -0,0 +1,167 @@
1
+ import {VisualGraphSteps} from '../../../steps/visual-graph-steps';
2
+ import {MainMenuSteps} from '../../../steps/main-menu-steps.js';
3
+ import {LicenseStubs} from '../../../stubs/license-stubs';
4
+ import {ApplicationSteps} from '../../../steps/application-steps';
5
+ import HomeSteps from '../../../steps/home-steps.js';
6
+ import {BaseSteps} from "../../../steps/base-steps.js";
7
+ import SparqlSteps from "../../../steps/sparql-steps.js";
8
+ import {VisualGraphSplitButtonSteps} from '../../../steps/visual-graph-split-button-steps.js';
9
+
10
+ const FILE_TO_IMPORT = 'wine.rdf';
11
+ const VALID_RESOURCE = 'USRegion';
12
+ const DEFAULT_LINKS_LIMIT = 100;
13
+
14
+ describe('Visual graph linksLimit URL parameter', () => {
15
+
16
+ let repositoryId;
17
+
18
+ beforeEach(() => {
19
+ cy.clearLocalStorage('ls.graphs-viz');
20
+ repositoryId = 'graphRepo-' + Date.now();
21
+ cy.createRepository({id: repositoryId});
22
+ cy.presetRepository(repositoryId);
23
+ cy.importServerFile(repositoryId, FILE_TO_IMPORT);
24
+ cy.enableAutocomplete(repositoryId);
25
+
26
+ LicenseStubs.spyGetLicense();
27
+ });
28
+
29
+ afterEach(() => {
30
+ cy.clearLocalStorage('ls.graphs-viz');
31
+ cy.deleteRepository(repositoryId);
32
+ });
33
+
34
+ it('Should include linksLimit as a URL parameter and respect its value', () => {
35
+ // Given I am on the home page, and I don't have a linkLimit in the URL
36
+ HomeSteps.visit();
37
+ BaseSteps.getUrl().should('not.include', 'linksLimit');
38
+
39
+ // When, I visit the visual graph via the main menu and open a resource
40
+ MainMenuSteps.clickOnVisualGraph();
41
+ VisualGraphSteps.verifyPageLoaded();
42
+ VisualGraphSteps.searchForResourceAndOpen(VALID_RESOURCE, VALID_RESOURCE);
43
+
44
+ // Then, I expect to see the visual graph with the default linksLimit
45
+ BaseSteps.getUrl().should('include', `linksLimit=${DEFAULT_LINKS_LIMIT}`);
46
+ // And the limit shown warning should not exist, since it is currently 100 (default) and we have less than that
47
+ VisualGraphSteps.getShownLimitMessage().should('not.exist');
48
+
49
+ // When, I update the link limit from the input field
50
+ VisualGraphSteps.updateLinksLimitField(5);
51
+ // Then I limit shown warning to exist,since we have more than 5 links
52
+ VisualGraphSteps.getShownLimitMessage().should('exist');
53
+ // And I expect the URL to include the updated linksLimit in the URL
54
+ BaseSteps.getUrl().should('include', 'linksLimit=5');
55
+ // And, I expect to see the visual graph with the updated linksLimit
56
+ VisualGraphSteps.getNodes().should('have.length', 6); // 5 links plus the main node
57
+
58
+ // When, I change the linksLimit URL param directly to 10 and navigate to the updated URL
59
+ BaseSteps.getUrl().then((url) => {
60
+ const newUrl = new URL(url);
61
+ newUrl.searchParams.set('linksLimit', '10');
62
+ BaseSteps.visit(newUrl.toString().replace(Cypress.config('baseUrl'), ''));
63
+ });
64
+ // Then, I expect to see the visual graph with the updated linksLimit
65
+ VisualGraphSteps.getNodes().should('have.length', 11) // 10 links plus the main node;
66
+ // And, I expect the menu to be updated with the new linksLimit
67
+ VisualGraphSteps.getLinksNumberField().should('have.value', '10');
68
+ });
69
+
70
+ it('Should show an error toast and ignore linksLimit when the URL param value is invalid', () => {
71
+ // Given, I visit the visual graph with an invalid linksLimit URL param (outside the 1-1000 range)
72
+ BaseSteps.visit(`/graphs-visualizations?uri=http:%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23${VALID_RESOURCE}&linksLimit=9999`);
73
+
74
+ // Then, I expect to see an error notification about the invalid links limit
75
+ ApplicationSteps.getErrorNotifications()
76
+ .should('be.visible')
77
+ .and('contain', 'Invalid links limit');
78
+ // And I expect to see the visual graph with the default linksLimit
79
+ BaseSteps.getUrl().should('include', 'linksLimit=100');
80
+ VisualGraphSteps.getLinksNumberField().should('have.value', String(DEFAULT_LINKS_LIMIT));
81
+
82
+ // When, I try to set the limit to an invalid value via the form
83
+ VisualGraphSteps.updateLinksLimitField(1001);
84
+
85
+ // Then, I should see a warning message that the link limit is invalid
86
+ VisualGraphSteps.getInvalidLinksMessage().should('be.visible').and('contain', 'Enter a number up to 1000');
87
+ });
88
+
89
+ describe('When the user has a custom graph config', () => {
90
+ const configName = 'linkLimitConfig';
91
+
92
+ it('should change link limit, when starting point is query', () => {
93
+ // Given, I visit the visual graph and create a config with query starting point
94
+ VisualGraphSteps.visit();
95
+ VisualGraphSteps.createCustomGraph();
96
+ VisualGraphSteps.typeGraphConfigName(configName);
97
+ VisualGraphSteps.selectStartMode('query');
98
+ VisualGraphSteps.selectPredefinedQuerySample(0);
99
+ VisualGraphSteps.saveConfig();
100
+ VisualGraphSteps.openGraphConfig(configName);
101
+
102
+ // Then, I expect to see 10 nodes before changing the limit
103
+ BaseSteps.getUrl().should('include', 'linksLimit=100');
104
+ VisualGraphSteps.getNodes().should('have.length', 10); // 10 nodes total, since we don't have a root node
105
+
106
+ // And the limit shown warning should not exist, since it is currently 100 (default) and we have a set ot 10 nodes
107
+ VisualGraphSteps.getShownLimitMessage().should('not.exist');
108
+
109
+ // When, I update the link limit from the input field
110
+ VisualGraphSteps.updateLinksLimitField(5);
111
+
112
+ // Then I limit shown warning to exist, since we have more than 5 links available
113
+ VisualGraphSteps.getShownLimitMessage().should('exist');
114
+
115
+ // Then I expect the URL to include the updated linksLimit in the URL
116
+ BaseSteps.getUrl().should('include', 'linksLimit=5');
117
+ // And, I expect to see the visual graph with the updated linksLimit
118
+ VisualGraphSteps.getNodes().should('have.length', 5); // 5 nodes total, since we don't have a root node
119
+ });
120
+
121
+ afterEach(() => {
122
+ cy.deleteGraphConfig(configName)
123
+ });
124
+ });
125
+
126
+ describe('When the user has opened a graph with construct query', () => {
127
+ it('should change link limit, when is graph is opened in queryResultsMode', () => {
128
+ // Given, I open a graph in queryResultsMode (after construct query in the SPARQL editor)
129
+ // And enter a construct query, so I can visualize the results in a graph
130
+ SparqlSteps.visit();
131
+ SparqlSteps.typeQuery(`CONSTRUCT WHERE {?s ?p ?o} LIMIT 10`);
132
+ SparqlSteps.executeQuery();
133
+ VisualGraphSplitButtonSteps.clickOnVisualizeMainButton();
134
+
135
+ // Then, I expect to see 10 nodes before changing the limit
136
+ BaseSteps.getUrl().should('include', 'linksLimit=100');
137
+ VisualGraphSteps.getNodes().should('have.length', 10); // 10 nodes total, since we don't have a root node
138
+
139
+ // And the limit shown warning should not exist, since it is currently 100 (default) and we have a set ot 10 nodes
140
+ VisualGraphSteps.getShownLimitMessage().should('not.exist');
141
+
142
+ // When, I update the link limit from the input field
143
+ VisualGraphSteps.updateLinksLimitField(5);
144
+
145
+ // Then I expect the URL to include the updated linksLimit in the URL
146
+ BaseSteps.getUrl().should('include', 'linksLimit=5');
147
+ // And, I expect to see the visual graph with the updated linksLimit
148
+ VisualGraphSteps.getNodes().should('have.length', 5); // 5 nodes total, since we don't have a root node
149
+
150
+ // And, the limit shown warning should appear as we are showing the limit
151
+ VisualGraphSteps.getShownLimitMessage().should('exist');
152
+
153
+ // When, I set the limit to the number of nodes from the query
154
+ VisualGraphSteps.updateLinksLimitField(10);
155
+
156
+ // Then I expect limit shown warning to exist
157
+ VisualGraphSteps.getShownLimitMessage().should('exist');
158
+
159
+ // When I set it to 1 more than the number of nodes from the query
160
+ VisualGraphSteps.updateLinksLimitField(11);
161
+ // Then I expect the limit shown warning to not exist
162
+ VisualGraphSteps.getShownLimitMessage().should('not.exist');
163
+ });
164
+ });
165
+ });
166
+
167
+