graphdb-workbench-tests 3.2.1 → 3.3.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 (112) hide show
  1. package/cypress-security.config.js +12 -5
  2. package/e2e-flaky/import/import-user-data-batch-operations.spec.js +2 -2
  3. package/e2e-legacy/explore/class-relationships/class-relationships.spec.js +2 -0
  4. package/e2e-legacy/explore/visual-graph/graphs-config.spec.js +4 -4
  5. package/e2e-legacy/explore/visual-graph/visual-graph-node-labels.spec.js +14 -2
  6. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +23 -11
  7. package/e2e-legacy/guides/autocomplete/enable-autocomplete-guide.spec.js +49 -0
  8. package/e2e-legacy/guides/class-hierarcy/class-hierarchy-guide.spec.js +89 -0
  9. package/e2e-legacy/guides/class-relations/class-relations-guide.spec.js +76 -0
  10. package/e2e-legacy/guides/connectors/connectors-guide.spec.js +152 -0
  11. package/e2e-legacy/guides/create-similarity-index/create-similarity-index-guide.spec.js +74 -0
  12. package/e2e-legacy/guides/download-guide-resource/download-guide-resource-guide.js +55 -0
  13. package/e2e-legacy/guides/repositories/create-repository-guide.spec.js +69 -0
  14. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +150 -0
  15. package/e2e-legacy/guides/ttyg/conversation/ttyg-conversation-guide.spec.js +86 -0
  16. package/e2e-legacy/home/cookie-policy.spec.js +8 -8
  17. package/e2e-legacy/home/rdf-resource-search.spec.js +12 -0
  18. package/e2e-legacy/import/import-server-files.spec.js +2 -2
  19. package/e2e-legacy/import/import-user-data-file-upload.spec.js +3 -3
  20. package/e2e-legacy/import/import-user-data.spec.js +2 -2
  21. package/e2e-legacy/repository/ontop-repository.spec.js +1 -1
  22. package/e2e-legacy/repository/repositories.spec.js +1 -1
  23. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +155 -0
  24. package/e2e-legacy/setup/autocomplete/autocomplete.spec.js +1 -1
  25. package/e2e-legacy/setup/connectors-lucene.spec.js +2 -2
  26. package/e2e-legacy/setup/jdbc/jdbc-create.spec.js +4 -4
  27. package/e2e-legacy/setup/rdf-rank/rdf-rank.spec.js +2 -4
  28. package/e2e-legacy/setup/settings/my-settings.spec.js +48 -60
  29. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +28 -12
  30. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +11 -11
  31. package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +6 -6
  32. package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +7 -7
  33. package/e2e-legacy/sparql-editor/saved-query/abort-query.spec.js +1 -1
  34. package/e2e-legacy/sparql-editor/saved-query/readonly-query.spec.js +13 -16
  35. package/e2e-legacy/sparql-editor/saved-query/share-query.spec.js +30 -1
  36. package/e2e-legacy/ttyg/agent-list.spec.js +1 -2
  37. package/e2e-legacy/ttyg/agent-select-menu.spec.js +1 -2
  38. package/e2e-legacy/ttyg/chat-list.spec.js +1 -2
  39. package/e2e-legacy/ttyg/chat-panel.spec.js +6 -3
  40. package/e2e-legacy/ttyg/clone-agent.spec.js +1 -2
  41. package/e2e-legacy/ttyg/create-agent.spec.js +2 -3
  42. package/e2e-legacy/ttyg/create-chat.spec.js +1 -2
  43. package/e2e-legacy/ttyg/delete-agent.spec.js +1 -2
  44. package/e2e-legacy/ttyg/edit-agent.spec.js +1 -2
  45. package/e2e-legacy/ttyg/ttyg-permission.spec.js +2 -6
  46. package/e2e-legacy/ttyg/ttyg-view.spec.js +1 -2
  47. package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +16 -7
  48. package/e2e-security/setup/users-and-access/graphql-user.spec.js +6 -3
  49. package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +1 -0
  50. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +3 -3
  51. package/e2e-security/setup/users-and-access/user-and-access.spec.js +8 -8
  52. package/fixtures/guides/autocomplete/enable-autocomplete-guide.json +12 -0
  53. package/fixtures/guides/class-hierarchy/class-hierarchy-guide.json +35 -0
  54. package/fixtures/guides/class-relations/class-relations-guide.json +33 -0
  55. package/fixtures/guides/connectors/connectors-guide.json +66 -0
  56. package/fixtures/guides/connectors/lucene-connector-guide.json +106 -0
  57. package/fixtures/guides/create-repository/create-repository-guide.json +25 -0
  58. package/fixtures/guides/create-similarity-index/create-similarity-index-guide.json +36 -0
  59. package/fixtures/guides/download-guide-resource/download-guide-resource-guide.json +25 -0
  60. package/fixtures/guides/download-resource.ttl +629 -0
  61. package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +69 -0
  62. package/fixtures/guides/ttyg/conversation/ttyg-conversation-guide.json +26 -0
  63. package/fixtures/similarity/get-ttyg-similarity-instances.json +10 -0
  64. package/fixtures/ttyg/agent/get-similarity-indexes-for-another-repo.json +5 -3
  65. package/fixtures/ttyg/agent/get-similarity-indexes.json +17 -8
  66. package/fixtures/ttyg/chats/explain-response-3.json +13 -0
  67. package/npm-shrinkwrap.json +439 -444
  68. package/package.json +4 -3
  69. package/steps/application-steps.js +7 -5
  70. package/steps/class-views-steps.js +19 -7
  71. package/steps/explore/similarity-index-create-steps.js +5 -3
  72. package/steps/explore/similarity-indexes-steps.js +4 -0
  73. package/steps/guides/guide-dialog-steps.js +16 -0
  74. package/steps/guides/guide-steps.js +26 -1
  75. package/steps/header-steps.js +9 -0
  76. package/steps/home-steps.js +42 -30
  77. package/steps/import/import-steps.js +1 -1
  78. package/steps/import/import-user-data-steps.js +1 -1
  79. package/steps/login-steps.js +13 -4
  80. package/steps/main-menu-steps.js +24 -4
  81. package/steps/modal-dialog-steps.js +12 -1
  82. package/steps/repository-steps.js +54 -14
  83. package/steps/resource/resource-steps.js +2 -2
  84. package/steps/setup/acl-management-steps.js +2 -2
  85. package/steps/setup/autocomplete-steps.js +6 -2
  86. package/steps/setup/connectors-steps.js +13 -0
  87. package/steps/setup/namespace-steps.js +1 -1
  88. package/steps/setup/plugins-steps.js +1 -1
  89. package/steps/setup/rdf-rank-steps.js +1 -5
  90. package/steps/setup/user-and-access-steps.js +9 -13
  91. package/steps/sparql-editor-steps.js +5 -0
  92. package/steps/toaster-steps.js +18 -6
  93. package/steps/ttyg/chat-panel-steps.js +19 -1
  94. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +42 -8
  95. package/steps/ttyg/ttyg-view-steps.js +6 -2
  96. package/steps/visual-graph-steps.js +23 -9
  97. package/steps/yasgui/yasgui-loader.js +3 -3
  98. package/steps/yasgui/yasgui-steps.js +1 -1
  99. package/stubs/guides/guides-stubs.js +55 -0
  100. package/stubs/repositories/repositories-stubs.js +151 -76
  101. package/stubs/similarity-index-stubs.js +4 -0
  102. package/stubs/yasgui/query-stubs.js +5 -1
  103. package/support/commands.js +2 -1
  104. package/support/connector-commands.js +13 -0
  105. package/support/e2e.js +3 -0
  106. package/support/repository-commands.js +9 -0
  107. package/support/settings-commands.js +16 -0
  108. package/utils/html-util.js +24 -4
  109. package/stubs/repositories-stub.js +0 -73
  110. /package/e2e-legacy/graphql/{graphql-endpoint-management-with-selected-repository.spec.jsx → graphql-endpoint-management-with-selected-repository.spec.js} +0 -0
  111. /package/e2e-legacy/help/guides/{star-wars-interactive-guide.js → star-wars-interactive-guide.spec.js} +0 -0
  112. /package/e2e-legacy/setup/sparql-template/{sparql-template-create.js → sparql-template-create.spec.js} +0 -0
@@ -0,0 +1,155 @@
1
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
2
+ import HomeSteps from '../../steps/home-steps.js';
3
+ import {RepositoryErrorsWidgetSteps} from '../../steps/widgets/repository-errors-widget-steps.js';
4
+ import {RepositorySteps} from '../../steps/repository-steps.js';
5
+ import {RepositorySelectorSteps} from '../../steps/repository-selector-steps.js';
6
+
7
+ describe('URL with Repository ID parameter', () => {
8
+ let repositoryId;
9
+ let secondRepositoryId;
10
+
11
+ describe('When repository is changed', () => {
12
+ beforeEach(() => {
13
+ repositoryId = 'repository-in-url-' + Date.now();
14
+ cy.createRepository({id: repositoryId});
15
+ secondRepositoryId = 'second-repository-in-url-' + Date.now();
16
+ cy.createRepository({id: secondRepositoryId});
17
+ cy.presetRepository(repositoryId);
18
+ })
19
+
20
+ afterEach(() => {
21
+ cy.deleteRepository(repositoryId);
22
+ cy.deleteRepository(secondRepositoryId);
23
+ });
24
+
25
+ it('should update URL', () => {
26
+ RepositorySteps.visit();
27
+ RepositorySteps.getActiveRepositoryRow().should('contain', repositoryId);
28
+ RepositorySelectorSteps.getSelectedRepository().should('contain', repositoryId);
29
+ cy.url().should('include', 'repositoryId=' + repositoryId);
30
+
31
+ RepositorySelectorSteps.selectRepository(secondRepositoryId);
32
+
33
+ RepositorySteps.getActiveRepositoryRow().should('contain', secondRepositoryId);
34
+ RepositorySelectorSteps.getSelectedRepository().should('contain', secondRepositoryId);
35
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
36
+
37
+ RepositorySteps.activateRepository(repositoryId);
38
+
39
+ RepositorySteps.getActiveRepositoryRow().should('contain', repositoryId);
40
+ RepositorySelectorSteps.getSelectedRepository().should('contain', repositoryId);
41
+ cy.url().should('include', 'repositoryId=' + repositoryId);
42
+ });
43
+ });
44
+
45
+ describe('When there is no active repository and no repository in URL', () => {
46
+ // 1. active repo no, repo in url no -> no action - just show repo selector
47
+ it('should show repository selector with no repository selected', () => {
48
+ HomeSteps.visit();
49
+ RepositoryErrorsWidgetSteps.getWidget().should('be.visible');
50
+ cy.url().should('not.include', 'repositoryId=');
51
+ HomeSteps.getSelectedRepository().should('contain', 'No accessible repositories');
52
+ // no modal dialog should be shown
53
+ ModalDialogSteps.getDialog().should('not.exist');
54
+ })
55
+ })
56
+
57
+ describe('When there is no active repository and repository in URL is present', () => {
58
+ beforeEach(() => {
59
+ repositoryId = 'repository-in-url-' + Date.now();
60
+ cy.createRepository({id: repositoryId});
61
+ })
62
+
63
+ afterEach(() => {
64
+ cy.deleteRepository(repositoryId);
65
+ });
66
+
67
+ // 2. active repo no, repo in url yes, url repo exists -> set active repo same as the url
68
+ it('should set active repository to the one in URL if it exists', () => {
69
+ HomeSteps.visitWithRepositoryInUrl(repositoryId);
70
+ RepositoryErrorsWidgetSteps.getWidget().should('not.exist');
71
+ cy.url().should('include', 'repositoryId=' + repositoryId);
72
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
73
+ });
74
+
75
+ // 3. active repo no, repo in url yes, url repo missing -> show warning, keep url
76
+ it('should show warning if repository in URL does not exist', () => {
77
+ HomeSteps.visitWithRepositoryInUrl('mising-repo');
78
+ RepositoryErrorsWidgetSteps.getWidget().should('be.visible');
79
+ HomeSteps.getSelectedRepository().should('contain', 'Choose repository');
80
+ ModalDialogSteps.getModalAlert().should('be.visible');
81
+ ModalDialogSteps.getDialogBody().should('contain', 'The repository "mising-repo" specified in the URL does not exist. Please select an existing repository.');
82
+ ModalDialogSteps.close();
83
+ cy.url().should('include', 'repositoryId=mising-repo');
84
+ });
85
+ });
86
+
87
+ describe('When there is an active repository and no repository in URL', () => {
88
+ beforeEach(() => {
89
+ repositoryId = 'repository-in-url-' + Date.now();
90
+ cy.createRepository({id: repositoryId});
91
+ cy.presetRepository(repositoryId);
92
+ })
93
+
94
+ afterEach(() => {
95
+ cy.deleteRepository(repositoryId);
96
+ cy.deleteRepository(secondRepositoryId);
97
+ });
98
+
99
+ // 4. active repo yes, repo in url no -> update url
100
+ it('should update URL to include active repository', () => {
101
+ HomeSteps.visit();
102
+ RepositoryErrorsWidgetSteps.getWidget().should('be.hidden');
103
+ cy.url().should('include', 'repositoryId=' + repositoryId);
104
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
105
+ });
106
+
107
+ // 5. active repo yes, repo in url yes, url repo exists -> show confirmation, update active repo on confirmation
108
+ it('should show confirmation and update active repository if repository in URL exists', () => {
109
+ secondRepositoryId = 'second-repository-in-url-' + Date.now();
110
+ cy.createRepository({id: secondRepositoryId});
111
+ HomeSteps.visitWithRepositoryInUrl(secondRepositoryId);
112
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
113
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
114
+ HomeSteps.getView().should('be.visible');
115
+ HomeSteps.getActiveRepositoryWidget().should('be.visible');
116
+ RepositoryErrorsWidgetSteps.getWidget().should('be.hidden');
117
+ ModalDialogSteps.getDialog().should('be.visible');
118
+ ModalDialogSteps.getDialogBody().should('contain', `Active repository will be changed to "${secondRepositoryId}". Do you want to proceed?`);
119
+ ModalDialogSteps.confirm();
120
+ ModalDialogSteps.getDialog().should('not.exist');
121
+ HomeSteps.getSelectedRepository().should('contain', secondRepositoryId);
122
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
123
+ });
124
+
125
+ // 5. active repo yes, repo in url yes, url repo exists -> show confirmation, keep active repo on reject
126
+ it('should show confirmation and keep active repository if repository in URL exists but user rejects', () => {
127
+ // active repo yes, repo in url yes, url repo exists -> show confirmation, update active repo
128
+ secondRepositoryId = 'second-repository-in-url-' + Date.now();
129
+ cy.createRepository({id: secondRepositoryId});
130
+ HomeSteps.visitWithRepositoryInUrl(secondRepositoryId);
131
+ cy.url().should('include', 'repositoryId=' + secondRepositoryId);
132
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
133
+ HomeSteps.getView().should('be.visible');
134
+ HomeSteps.getActiveRepositoryWidget().should('be.visible');
135
+ RepositoryErrorsWidgetSteps.getWidget().should('be.hidden');
136
+ ModalDialogSteps.getDialog().should('be.visible');
137
+ ModalDialogSteps.getDialogBody().should('contain', `Active repository will be changed to "${secondRepositoryId}". Do you want to proceed?`);
138
+ ModalDialogSteps.cancel();
139
+ ModalDialogSteps.getDialog().should('not.exist');
140
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
141
+ cy.url().should('include', 'repositoryId=' + repositoryId);
142
+ });
143
+
144
+ // 6. active repo yes, repo in url yes, url repo missing-> show warning, keep the active repo
145
+ it('should show warning if repository in URL does not exist and keep active repository', () => {
146
+ HomeSteps.visitWithRepositoryInUrl('mising-repo');
147
+ cy.url().should('include', 'repositoryId=mising-repo');
148
+ ModalDialogSteps.getModalAlert().should('be.visible');
149
+ ModalDialogSteps.clickOKButton();
150
+ ModalDialogSteps.getModalAlert().should('not.exist');
151
+ HomeSteps.getSelectedRepository().should('contain', repositoryId);
152
+ cy.url().should('include', 'repositoryId=' + repositoryId);
153
+ });
154
+ });
155
+ });
@@ -51,7 +51,7 @@ describe('Autocomplete ', () => {
51
51
  .and('contain', 'http://www.w3.org/2000/01/rdf-schema#label');
52
52
 
53
53
  // Enable autocomplete and verify status is OK (possible slow operation)
54
- AutocompleteSteps.getAutocompleteSwitch().click();
54
+ AutocompleteSteps.enableToggleAutocomplete();
55
55
  AutocompleteSteps.getAutocompleteHeader()
56
56
  .find('.tag-primary')
57
57
  .should('be.visible')
@@ -48,7 +48,7 @@ describe('Setup / Connectors - Lucene', () => {
48
48
  verifyConnectorExists(luceneConnectorName);
49
49
  //copy connector
50
50
  getConnectorInstance(0)
51
- .find('.icon-copy')
51
+ .find('.ri-file-copy-line')
52
52
  .should('be.visible')
53
53
  .click()
54
54
  .then(() => {
@@ -60,7 +60,7 @@ describe('Setup / Connectors - Lucene', () => {
60
60
  verifyConnectorExists(luceneConnectorName + '-copy');
61
61
  //delete connector copy
62
62
  getConnectorInstance(1)
63
- .find('.icon-trash')
63
+ .find('.ri-delete-bin-6-line')
64
64
  .should('be.visible')
65
65
  .click();
66
66
  getConfirmConnectorDeletebutton()
@@ -6,7 +6,7 @@ import {ModalDialogSteps, VerifyConfirmationDialogOptions} from "../../../steps/
6
6
  import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
7
7
  import {MainMenuSteps} from "../../../steps/main-menu-steps";
8
8
  import {RepositorySelectorSteps} from "../../../steps/repository-selector-steps";
9
- import {YasguiLoader} from "../../../steps/yasgui/yasgui-loader";
9
+ import {ApplicationSteps} from "../../../steps/application-steps.js";
10
10
 
11
11
  const FILE_TO_IMPORT = '200-row-allianz.ttl';
12
12
  const DEFAULT_QUERY = 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n' +
@@ -64,7 +64,7 @@ describe('JDBC configuration', () => {
64
64
  JdbcCreateSteps.clickOnPreviewButton();
65
65
 
66
66
  // Then I expect to see loader,
67
- YasguiLoader.verifyMessage('Preview of first 100 rows of table', 1);
67
+ ApplicationSteps.geLoader().should('contain', 'Preview of first 100 rows of table');
68
68
  // and see the generated preview.
69
69
  YasrSteps.getResults().should('be.visible');
70
70
  });
@@ -324,6 +324,6 @@ function createVerifyConfirmationDialogOptions() {
324
324
  return new VerifyConfirmationDialogOptions()
325
325
  .setChangePageFunction(() => MainMenuSteps.clickOnMenuImport())
326
326
  .setConfirmationMessage('You have unsaved changes. Are you sure that you want to exit?')
327
- .setVerifyCurrentUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/jdbc/configuration/create`))
328
- .setVerifyRedirectedUrl(() => cy.url().should('eq', `${Cypress.config('baseUrl')}/import#user`));
327
+ .setVerifyCurrentUrl(() => cy.url().should('include', `${Cypress.config('baseUrl')}/jdbc/configuration/create`))
328
+ .setVerifyRedirectedUrl(() => cy.url().should('include', '/import').and('include', '#user'));
329
329
  }
@@ -1,4 +1,5 @@
1
1
  import {RdfRankSteps} from "../../../steps/setup/rdf-rank-steps";
2
+ import {ToasterSteps} from "../../../steps/toaster-steps";
2
3
 
3
4
  describe('RDF Rank view', () => {
4
5
 
@@ -98,10 +99,7 @@ describe('RDF Rank view', () => {
98
99
  RdfRankSteps.getIncludedPredicatesFilter()
99
100
  .find('.tag-list .tag-item')
100
101
  .should('have.length', 0);
101
- RdfRankSteps.getToast()
102
- .find('.toast-error')
103
- .should('be.visible')
104
- .and('contain', 'is not a valid IRI');
102
+ ToasterSteps.verifyError('is not a valid IRI')
105
103
 
106
104
  // Enter valid one and rebuild
107
105
  RdfRankSteps.getIncludedPredicatesFilter()
@@ -1,14 +1,15 @@
1
- import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
2
- import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
3
- import {SecurityStubs} from "../../../stubs/security-stubs";
4
- import {VisualGraphSteps} from "../../../steps/visual-graph-steps";
1
+ import {SparqlEditorSteps} from '../../../steps/sparql-editor-steps';
2
+ import {YasqeSteps} from '../../../steps/yasgui/yasqe-steps';
3
+ import {SecurityStubs} from '../../../stubs/security-stubs';
4
+ import {VisualGraphSteps} from '../../../steps/visual-graph-steps';
5
+ import {ToasterSteps} from '../../../steps/toaster-steps';
5
6
 
6
7
  describe('My Settings', () => {
7
8
 
8
9
  let repositoryId;
9
- const testResultCountQuery = "select * where { \n" +
10
- "\t?s ?p ?o .\n" +
11
- "} limit 1001";
10
+ const testResultCountQuery = 'select * where { \n' +
11
+ '\t?s ?p ?o .\n' +
12
+ '} limit 1001';
12
13
  const FILE_TO_IMPORT = 'wine.rdf';
13
14
 
14
15
  beforeEach(() => {
@@ -43,11 +44,8 @@ describe('My Settings', () => {
43
44
  .should('not.be.visible');
44
45
  });
45
46
 
46
- cy.get('#defaultCount:checkbox').uncheck()
47
- .then(() => {
48
- cy.get('#defaultCount:checkbox')
49
- .should('not.be.checked');
50
- });
47
+ cy.get('#defaultCount:checkbox').uncheck();
48
+ cy.get('#defaultCount:checkbox').should('not.be.checked');
51
49
 
52
50
  // Note that saving settings takes time.
53
51
  // Make sure that visiting SPARQL view
@@ -71,27 +69,23 @@ describe('My Settings', () => {
71
69
  //return to My Settings to revert the changes
72
70
  visitSettingsView();
73
71
  // Wait for loader to disappear
74
- cy.get('.ot-loader').should('not.be.visible');
72
+ cy.get('.ot-loader-new-content').should('not.be.visible');
75
73
 
76
74
  turnOnLabelBtn('#sameas-on');
77
75
  turnOnLabelBtn('#inference-on');
78
- cy.get('#defaultCount:checkbox').check()
79
- .then(() => {
80
- cy.get('#defaultCount:checkbox')
81
- .should('be.visible')
82
- .and('be.checked');
83
- });
76
+ cy.get('#defaultCount:checkbox').check();
77
+ cy.get('#defaultCount:checkbox').should('be.visible').and('be.checked');
84
78
  });
85
79
  });
86
80
 
87
81
  it('Should test the "Show schema ON/OFF by default in visual graph" setting in My Settings', () => {
88
- const DRY_GRAPH = "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Dry";
89
82
  //Verify that schema statements are ON in My settings
90
83
  cy.get('#schema-on').find('.switch:checkbox').should('be.checked');
91
84
  cy.enableAutocomplete(repositoryId);
92
85
  //Verify that schema statements ON is reflected in Visual graph
93
86
  VisualGraphSteps.openDryWineUri();
94
- cy.get('.visual-graph-settings-btn').scrollIntoView().click();
87
+ cy.get('.visual-graph-settings-btn').scrollIntoView();
88
+ cy.get('.visual-graph-settings-btn').click();
95
89
  cy.get('.rdf-info-side-panel .filter-sidepanel').should('be.visible');
96
90
  cy.get('.include-schema-statements').should('be.visible').and('be.checked');
97
91
  saveGraphSettings()
@@ -117,37 +111,37 @@ describe('My Settings', () => {
117
111
 
118
112
  cy.get('.visual-graph-settings-btn').click();
119
113
  cy.get('.rdf-info-side-panel .filter-sidepanel').should('be.visible');
120
- cy.get('.include-schema-statements')
121
- .scrollIntoView().should('be.visible').click()
122
- .then(($el) => {
123
- cy.wrap($el).trigger('mouseleave', {force: true});
124
- cy.get('.include-schema-statements').scrollIntoView()
125
- .should('be.visible').and('not.be.checked');
126
- saveGraphSettings()
127
- .then(() => cy.get('.predicate').should('not.exist'));
128
- });
114
+ cy.get('.include-schema-statements').scrollIntoView();
115
+ cy.get('.include-schema-statements').should('be.visible').click();
116
+ cy.get('.include-schema-statements').then(($el) => {
117
+ cy.wrap($el).trigger('mouseleave', {force: true});
118
+ cy.get('.include-schema-statements').scrollIntoView();
119
+ cy.get('.include-schema-statements').should('be.visible').and('not.be.checked');
120
+ saveGraphSettings()
121
+ .then(() => cy.get('.predicate').should('not.exist'));
122
+ });
129
123
  //return to My Settings to revert the changes
130
124
  visitSettingsView();
131
125
  // Wait for loader to disappear
132
- cy.get('.ot-loader').should('not.be.visible');
126
+ cy.get('.ot-loader-new-content').should('not.be.visible');
133
127
  clickLabelBtn('#schema-on')
134
128
  .then(() => {
135
- cy.waitUntil(() =>
136
- cy.get('#schema-on')
137
- .find('input[type="checkbox"]')
138
- .scrollIntoView()
139
- .then(input => input && input.attr('checked')));
129
+ cy.waitUntil(() => {
130
+ cy.get('#schema-on')
131
+ .find('input[type="checkbox"]')
132
+ .scrollIntoView();
133
+ return cy.get('#schema-on')
134
+ .find('input[type="checkbox"]').then(input => input && input.attr('checked'));
135
+ }
136
+ );
140
137
  });
141
138
  });
142
139
 
143
140
  it('Saving administrator credentials with checked unset password should show modal window to warn user about' +
144
141
  ' unsetting the password', () => {
145
142
  // User role is administrator
146
- cy.get('#noPassword:checkbox').check()
147
- .then(() => {
148
- cy.get('#noPassword:checkbox')
149
- .should('be.checked');
150
- });
143
+ cy.get('#noPassword:checkbox').check();
144
+ cy.get('#noPassword:checkbox').should('be.checked');
151
145
  getSaveButton().click()
152
146
  .then(() => {
153
147
  cy.get('.modal-dialog').find('.lead').contains('If you unset the password and then enable security,' +
@@ -169,20 +163,17 @@ describe('My Settings', () => {
169
163
  });
170
164
 
171
165
  function getSaveButton() {
172
- return cy.get('#wb-user-submit').scrollIntoView().should('be.visible');
166
+ cy.get('#wb-user-submit').scrollIntoView();
167
+ return cy.get('#wb-user-submit').should('be.visible');
173
168
  }
174
169
 
175
170
  function verifyUserSettingsUpdated() {
176
- cy.waitUntil(() =>
177
- cy.get('#toast-container')
178
- .then(toast => toast && toast.text().includes('The user admin was updated')));
171
+ cy.waitUntil(() => ToasterSteps.verifySuccess('The user admin was updated'));
179
172
  }
180
173
 
181
174
  function saveGraphSettings() {
182
- return cy.get('.save-settings-btn')
183
- .scrollIntoView()
184
- .should('be.visible')
185
- .click();
175
+ cy.get('.save-settings-btn').scrollIntoView();
176
+ return cy.get('.save-settings-btn').should('be.visible').click();
186
177
  }
187
178
 
188
179
  function visitSettingsView() {
@@ -201,19 +192,16 @@ describe('My Settings', () => {
201
192
  }
202
193
 
203
194
  function clickLabelBtn(btnId) {
204
- return cy.get(btnId)
205
- .find('.switch.mr-0').scrollIntoView().should('be.visible').click();
195
+ cy.get(btnId).find('.switch.mr-0').scrollIntoView();
196
+ return cy.get(btnId).find('.switch.mr-0').should('be.visible').click();
206
197
  }
207
198
 
208
199
  function turnOnLabelBtn(btnId) {
209
- cy.get(btnId)
210
- .find('input[type="checkbox"]').check({force: true})
211
- .then(() => {
212
- cy.waitUntil(() =>
213
- cy.get(btnId)
214
- .find('input[type="checkbox"]')
215
- .scrollIntoView()
216
- .then(input => input && input.attr('checked')));
217
- });
200
+ cy.get(btnId).find('input[type="checkbox"]').check({force: true});
201
+
202
+ cy.waitUntil(() => {
203
+ cy.get(btnId).find('input[type="checkbox"]').scrollIntoView();
204
+ return cy.get(btnId).find('input[type="checkbox"]').then(input => input && input.attr('checked'));
205
+ });
218
206
  }
219
207
  });
@@ -1,12 +1,11 @@
1
- import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
2
- import {RepositoriesStubs} from "../../../stubs/repositories/repositories-stubs";
3
- import {RepositorySelectorSteps} from "../../../steps/repository-selector-steps";
4
- import {ModalDialogSteps} from "../../../steps/modal-dialog-steps";
5
- import {ToasterSteps} from "../../../steps/toaster-steps";
6
- import HomeSteps from "../../../steps/home-steps";
7
- import {LoginSteps} from "../../../steps/login-steps";
8
- import {MainMenuSteps} from "../../../steps/main-menu-steps";
9
-
1
+ import {UserAndAccessSteps} from '../../../steps/setup/user-and-access-steps';
2
+ import {RepositoriesStubs} from '../../../stubs/repositories/repositories-stubs';
3
+ import {RepositorySelectorSteps} from '../../../steps/repository-selector-steps';
4
+ import {ModalDialogSteps} from '../../../steps/modal-dialog-steps';
5
+ import {ToasterSteps} from '../../../steps/toaster-steps';
6
+ import HomeSteps from '../../../steps/home-steps';
7
+ import {LoginSteps} from '../../../steps/login-steps';
8
+ import {MainMenuSteps} from '../../../steps/main-menu-steps';
10
9
 
11
10
  describe('User and Access', () => {
12
11
 
@@ -16,12 +15,12 @@ describe('User and Access', () => {
16
15
  const ROLE_CUSTOM_ADMIN = "#roleAdmin";
17
16
  const DEFAULT_ADMIN_PASSWORD = "root";
18
17
 
18
+ // eslint-disable-next-line no-undef
19
19
  context('', () => {
20
20
  const user = "user";
21
21
 
22
22
  beforeEach(() => {
23
23
  UserAndAccessSteps.visit();
24
- cy.window();
25
24
  // Users table should be visible
26
25
  UserAndAccessSteps.getUsersTable().should('be.visible');
27
26
  });
@@ -30,6 +29,7 @@ describe('User and Access', () => {
30
29
  cy.loginAsAdmin().then(()=> {
31
30
  cy.deleteUser(user, true);
32
31
  cy.switchOffSecurity(true);
32
+ cy.switchOffFreeAccess(false);
33
33
  });
34
34
  });
35
35
 
@@ -142,14 +142,28 @@ describe('User and Access', () => {
142
142
  UserAndAccessSteps.getFreeAccessSwitchInput().should('be.checked');
143
143
  // And I should see a success message
144
144
  ToasterSteps.verifySuccess('Free access has been enabled.');
145
+ ToasterSteps.getToast().should('not.exist')
145
146
  UserAndAccessSteps.getUsersTable().should('be.visible');
146
147
  // When I toggle Free Access OFF
147
148
  UserAndAccessSteps.toggleFreeAccess();
148
149
  // Then I should see a success message
149
- ToasterSteps.verifySuccess('Free access has been disabled.');
150
+ ToasterSteps.getToast().should('exist');
151
+ ToasterSteps.getToasterMessage().should('contain', 'Free access has been disabled.');
150
152
  });
151
- })
152
153
 
154
+ it('should redirect to previous page after logout and then login', () => {
155
+ UserAndAccessSteps.toggleSecurity();
156
+ LoginSteps.loginWithUser("admin", DEFAULT_ADMIN_PASSWORD);
157
+ MainMenuSteps.clickOnSparqlMenu();
158
+ cy.url().should('include', '/sparql');
159
+
160
+ LoginSteps.logout();
161
+ cy.url().should('include', '/login');
162
+ LoginSteps.loginWithUser("admin", DEFAULT_ADMIN_PASSWORD);
163
+ cy.url().should('include', '/sparql');
164
+ });
165
+ })
166
+ // eslint-disable-next-line no-undef
153
167
  context('GraphQL only', () => {
154
168
  let repositoryId1;
155
169
  let repositoryId2;
@@ -395,6 +409,7 @@ describe('User and Access', () => {
395
409
  function testForUser(name, isAdmin) {
396
410
  //enable security
397
411
  UserAndAccessSteps.toggleSecurity();
412
+ LoginSteps.visitLoginPageWithReturnUrl('/users')
398
413
  //login new user
399
414
  LoginSteps.loginWithUser(name, PASSWORD);
400
415
  //verify permissions
@@ -468,6 +483,7 @@ describe('User and Access', () => {
468
483
 
469
484
  function runChecks(checks = {}) {
470
485
  Object.entries(checks).forEach(([selector, assertions]) => {
486
+ // eslint-disable-next-line cypress/no-assigning-return-values
471
487
  let chain = cy.get(selector);
472
488
 
473
489
  // assertions is an array, e.g. ["exist", ["contain.text", "Hello"], "be.visible"]
@@ -28,14 +28,14 @@ describe('Expand results over owl:sameAs', () => {
28
28
  QueryStubs.stubQueryResults(queryDescription);
29
29
  // When I open the editor
30
30
  // Then I expect that expand results should be enabled by default
31
- YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'data-tooltip', 'Expand results over owl:sameAs: ON');
31
+ YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
32
32
  YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-on');
33
33
  YasqeSteps.executeQuery();
34
34
  cy.wait('@query-1_0_1001_1').its('request.body').should('contain', 'sameAs=true');
35
35
  // When I disable the expand results action
36
36
  YasqeSteps.expandResultsOverSameAs();
37
37
  // Then I expect that the button state should be changed
38
- YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'data-tooltip', 'Expand results over owl:sameAs: OFF');
38
+ YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
39
39
  YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-off');
40
40
  // And sameAs=false parameter should be sent with the request
41
41
  YasqeSteps.executeQuery();
@@ -44,7 +44,7 @@ describe('Expand results over owl:sameAs', () => {
44
44
  // When I disable the include inferred action
45
45
  YasqeSteps.includeInferredStatements();
46
46
  // Then I expect that sameAs should be disabled too
47
- YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
47
+ YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
48
48
  YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-off');
49
49
  YasqeSteps.executeQuery();
50
50
  cy.wait('@query-1_0_1001_1').its('request.body').should('contain', 'infer=false&sameAs=false');
@@ -60,7 +60,7 @@ describe('Expand results over owl:sameAs', () => {
60
60
  // Then I expect that "sameAs" element to be enabled by default
61
61
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
62
62
  // and the tooltip of element describes that "sameAs" element is enabled.
63
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Expand results over owl:sameAs: ON');
63
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
64
64
 
65
65
  // When I open a new Tab.
66
66
  YasguiSteps.openANewTab();
@@ -68,7 +68,7 @@ describe('Expand results over owl:sameAs', () => {
68
68
  // Then I expect that "sameAs" element to be enabled in the new tab.
69
69
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
70
70
  // and the tooltip of element describes that "sameAs" element is enabled.
71
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Expand results over owl:sameAs: ON');
71
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
72
72
  });
73
73
 
74
74
  it('should not be enabled when infer is true and sameAs is false in user settings', {retries: {runMode: 2}},() => {
@@ -81,7 +81,7 @@ describe('Expand results over owl:sameAs', () => {
81
81
  // Then I expect that "sameAs" element to be disabled by default
82
82
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
83
83
  // and the tooltip of element describes that "sameAs" element is disabled.
84
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Expand results over owl:sameAs: OFF');
84
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
85
85
 
86
86
  // When I open a new Tab.
87
87
  YasguiSteps.openANewTab();
@@ -89,7 +89,7 @@ describe('Expand results over owl:sameAs', () => {
89
89
  // Then I expect that "sameAs" element to be disabled in the new tab.
90
90
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
91
91
  // and the tooltip of element describes that "sameAs" element is disabled.
92
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Expand results over owl:sameAs: OFF');
92
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
93
93
  });
94
94
 
95
95
  it('should not be enabled when infer is false and sameAs is true in user settings', () => {
@@ -100,7 +100,7 @@ describe('Expand results over owl:sameAs', () => {
100
100
  YasguiSteps.getYasgui().should('be.visible');
101
101
 
102
102
  // Then I expect that "sameAs" element to be disabled by default
103
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
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
105
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
106
106
 
@@ -110,7 +110,7 @@ describe('Expand results over owl:sameAs', () => {
110
110
  // Then I expect that "sameAs" element to be disabled in the new tab,
111
111
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
112
112
  // and the tooltip of element describes that "infer" is required.
113
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
113
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
114
114
  });
115
115
 
116
116
  it('should not be enabled when infer is false and sameAs is false in user settings', () => {
@@ -123,7 +123,7 @@ describe('Expand results over owl:sameAs', () => {
123
123
  // Then I expect that "sameAs" element to be disabled by default,
124
124
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
125
125
  // and the tooltip of element describes that "infer" is required.
126
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
126
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
127
127
 
128
128
  // When I open a new Tab.
129
129
  YasguiSteps.openANewTab();
@@ -131,6 +131,6 @@ describe('Expand results over owl:sameAs', () => {
131
131
  // Then I expect that "sameAs" element to be disabled in the new tab,
132
132
  YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
133
133
  // and the tooltip of element describes that "infer" is required.
134
- YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
134
+ YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
135
135
  });
136
136
  });