graphdb-workbench-tests 2.3.1 → 2.4.0-TR1

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 (88) hide show
  1. package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
  2. package/fixtures/graphql-editor/default-query-response.json +517 -0
  3. package/fixtures/locale-en.json +18 -5
  4. package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
  5. package/fixtures/queries/empty-query-response.json +11 -0
  6. package/integration/explore/graphs.overview.spec.js +4 -2
  7. package/integration/explore/similariti-index-create.spec.js +315 -0
  8. package/integration/explore/similarity-index.spec.js +88 -0
  9. package/integration/explore/similarity.spec.js +156 -47
  10. package/integration/explore/visual-graph/graphs-config.spec.js +452 -0
  11. package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +145 -348
  12. package/integration/home/language-change.spec.js +3 -3
  13. package/integration/import/import.user.data.spec.js +4 -4
  14. package/integration/resource/resource.spec.js +354 -0
  15. package/integration/setup/jdbc-create.spec.js +316 -0
  16. package/integration/setup/jdbc.spec.js +99 -178
  17. package/integration/setup/my-settings.spec.js +9 -41
  18. package/integration/setup/sparql-template-create.js +141 -0
  19. package/integration/setup/sparql-templates.spec.js +82 -146
  20. package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
  21. package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
  22. package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
  23. package/integration/sparql-editor/actions/save-query.spec.js +70 -0
  24. package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
  25. package/integration/sparql-editor/internationalization.spec.js +41 -0
  26. package/integration/sparql-editor/saved-query/abort-query.spec.js +60 -0
  27. package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
  28. package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
  29. package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
  30. package/integration/sparql-editor/sparql-editor.spec.js +20 -0
  31. package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
  32. package/integration/sparql-editor/yasr/download-as.spec.js +62 -0
  33. package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
  34. package/integration/sparql-editor/yasr/table-plugin.spec.js +191 -0
  35. package/integration/sparql-editor/yasr/toolbar/visual-button.spec.js +56 -0
  36. package/integration-flaky/setup/sparql-template-create.js +139 -0
  37. package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
  38. package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
  39. package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
  40. package/package.json +3 -2
  41. package/steps/application-steps.js +23 -0
  42. package/steps/error-steps.js +9 -0
  43. package/steps/explore/graphs-overview-steps.js +24 -0
  44. package/steps/explore/similarity-index-create-steps.js +113 -0
  45. package/steps/explore/similarity-indexes-steps.js +18 -0
  46. package/steps/import-steps.js +8 -1
  47. package/steps/language-selector-steps.js +22 -0
  48. package/steps/loader-steps.js +10 -0
  49. package/steps/lucene-connector-steps.js +43 -0
  50. package/steps/main-menu-steps.js +39 -0
  51. package/steps/modal-dialog-steps.js +113 -0
  52. package/steps/repository-selector-steps.js +26 -0
  53. package/steps/resource/resource-edit-steps.js +111 -0
  54. package/steps/resource/resource-steps.js +145 -0
  55. package/steps/setup/jdbc-create-steps.js +97 -0
  56. package/steps/setup/jdbc-steps.js +42 -0
  57. package/steps/setup/sparql-create-update-steps.js +55 -0
  58. package/steps/setup/sparql-templates-steps.js +34 -0
  59. package/steps/sparql-editor-steps.js +20 -0
  60. package/steps/visual-graph-steps.js +340 -3
  61. package/steps/yasgui/confirmation-dialog-steps.js +13 -0
  62. package/steps/yasgui/pagination-steps.js +47 -0
  63. package/steps/yasgui/plugin/error-plugin-steps.js +10 -0
  64. package/steps/yasgui/save-query-dialog.js +61 -0
  65. package/steps/yasgui/saved-queries-dialog.js +29 -0
  66. package/steps/yasgui/saved-query.js +25 -0
  67. package/steps/yasgui/share-saved-query-dialog.js +25 -0
  68. package/steps/yasgui/table-plugin-steps.js +29 -0
  69. package/steps/yasgui/yasgui-steps.js +191 -0
  70. package/steps/yasgui/yasqe-steps.js +187 -0
  71. package/steps/yasgui/yasr-steps.js +105 -0
  72. package/stubs/namespace-stubs.js +10 -0
  73. package/stubs/security-stubs.js +69 -0
  74. package/stubs/yasgui/connectors-stubs.js +12 -0
  75. package/stubs/yasgui/query-stubs.js +258 -0
  76. package/support/index.js +2 -0
  77. package/support/repository-commands.js +6 -1
  78. package/support/sparql-commands.js +1 -1
  79. package/support/visual-graph-commands.js +25 -0
  80. package/integration/sparql/main.menu.spec.js +0 -196
  81. package/integration/sparql/sparql-error-handling.spec.js +0 -74
  82. package/integration/sparql/sparql-language-change.spec.js +0 -58
  83. package/integration/sparql/sparql-result-formating.spec.js +0 -84
  84. package/integration/sparql/sparql.menu.spec.js +0 -1244
  85. package/integration-flaky/setup/sparql-templates.spec.js +0 -125
  86. package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
  87. package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
  88. package/steps/sparql-steps.js +0 -227
@@ -0,0 +1,139 @@
1
+ import {SparqlCreateUpdateSteps} from "../../steps/setup/sparql-create-update-steps";
2
+ import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
3
+ import ImportSteps from "../../steps/import-steps";
4
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
5
+ import {MainMenuSteps} from "../../steps/main-menu-steps";
6
+ import {RepositorySelectorSteps} from "../../steps/repository-selector-steps";
7
+ import {SparqlTemplatesSteps} from "../../steps/setup/sparql-templates-steps";
8
+
9
+ describe('SPARQL create template', () => {
10
+
11
+ let repositoryId;
12
+ let secondRepositoryId;
13
+
14
+ beforeEach(() => {
15
+ repositoryId = 'sparql-templates-repo' + Date.now();
16
+ cy.createRepository({id: repositoryId});
17
+ cy.presetRepository(repositoryId);
18
+ secondRepositoryId = 'sparql-templates-second-repo' + Date.now();
19
+ cy.createRepository({id: secondRepositoryId});
20
+ SparqlCreateUpdateSteps.visit();
21
+ });
22
+
23
+ afterEach(() => {
24
+ cy.deleteRepository(repositoryId);
25
+ cy.deleteRepository(secondRepositoryId);
26
+ });
27
+
28
+ it('should has error message described that query is invalid', {
29
+ retries: {
30
+ runMode: 1,
31
+ openMode: 0
32
+ }
33
+ }, () => {
34
+ // When I visit 'Sparql create template' view,
35
+ // and fill valid template id.
36
+ SparqlCreateUpdateSteps.typeTemplateId('http://test');
37
+
38
+ // When I fill invalid query (select for example).
39
+ YasqeSteps.pasteQuery('select * where {?s ?p }');
40
+ // and click on "Save" button.
41
+ SparqlCreateUpdateSteps.clickOnSaveButton();
42
+
43
+ // Then I expect to see error message.
44
+ SparqlCreateUpdateSteps.getInvalidQueryElement().contains('Invalid query');
45
+ });
46
+
47
+ it('should display confirm dialog I am updating a sparql template and change the repository', {
48
+ retries: {
49
+ runMode: 1,
50
+ openMode: 0
51
+ }
52
+ }, () => {
53
+ // When I visit 'Sparql create template' view,
54
+ // create a SPARQL template
55
+ const templateId = 'http://' + Date.now();
56
+ SparqlCreateUpdateSteps.typeTemplateId(templateId);
57
+ SparqlCreateUpdateSteps.clickOnSaveButton();
58
+ SparqlTemplatesSteps.verifyUrl();
59
+ // and open it for edit.
60
+ SparqlCreateUpdateSteps.visit(templateId);
61
+
62
+ // When I change the repository.
63
+ RepositorySelectorSteps.selectRepository(secondRepositoryId);
64
+
65
+ // Then I expect to be redirected to sparql templates view.
66
+ SparqlTemplatesSteps.verifyUrl();
67
+
68
+ // When I open a sparql template for edit,
69
+ RepositorySelectorSteps.selectRepository(repositoryId);
70
+ SparqlCreateUpdateSteps.visit(templateId);
71
+
72
+ // and edit the query,
73
+ YasqeSteps.writeInEditor('query changed');
74
+ // and try to change the selected repository.
75
+ RepositorySelectorSteps.selectRepository(secondRepositoryId);
76
+
77
+ // Then I expect to see confirm dialog.
78
+ ModalDialogSteps.getDialogHeader().contains('Confirm');
79
+ ModalDialogSteps.getDialogBody().contains('You have unsaved changes. Are you sure that you want to exit?');
80
+
81
+ // When I confirm.
82
+ ModalDialogSteps.clickOnConfirmButton();
83
+
84
+ // Then I expect to be navigated to sparql templates view.
85
+ SparqlTemplatesSteps.verifyUrl();
86
+
87
+ // When I open a sparql template for edit,
88
+ RepositorySelectorSteps.selectRepository(repositoryId);
89
+ SparqlCreateUpdateSteps.visit(templateId);
90
+ // and edit the query,
91
+ YasqeSteps.writeInEditor('query changed');
92
+ // and try to change the selected repository.
93
+ RepositorySelectorSteps.selectRepository(secondRepositoryId);
94
+
95
+ // Then I expect to see confirm dialog.
96
+ ModalDialogSteps.getDialogHeader().contains('Confirm');
97
+ ModalDialogSteps.getDialogBody().contains('You have unsaved changes. Are you sure that you want to exit?');
98
+
99
+ // When I cancel.
100
+ ModalDialogSteps.clickOnCancelButton();
101
+
102
+ // Then I expect the view and repository not changed,
103
+ SparqlCreateUpdateSteps.verifyUrl();
104
+ RepositorySelectorSteps.getSelectedRepository().contains(repositoryId);
105
+
106
+ // When I close the dialog.
107
+ RepositorySelectorSteps.selectRepository(secondRepositoryId);
108
+ ModalDialogSteps.clickOnCloseButton();
109
+
110
+ // Then I expect the view and repository not changed,
111
+ SparqlCreateUpdateSteps.verifyUrl();
112
+ RepositorySelectorSteps.getSelectedRepository().contains(repositoryId);
113
+ });
114
+
115
+ it('should confirm me before navigate when query is changed', {
116
+ retries: {
117
+ runMode: 1,
118
+ openMode: 0
119
+ }
120
+ }, () => {
121
+ // When I visit 'Sparql create template' view,
122
+ // and change the query in ontotext-yasgui editor.
123
+ // When I fill non update query (select for example).
124
+ YasqeSteps.writeInEditor('change query');
125
+
126
+ // When I try to navigate to other view
127
+ MainMenuSteps.clickOnMenu('Import');
128
+
129
+ // Then I expect to see confirm dialog inform me that there are unsaved changes.
130
+ ModalDialogSteps.getDialogHeader().contains('Confirm');
131
+ ModalDialogSteps.getDialogBody().contains('You have unsaved changes. Are you sure that you want to exit?');
132
+
133
+ // When I click on confirm button.
134
+ ModalDialogSteps.clickOnConfirmButton();
135
+
136
+ // Then I expect to be navigated to other view.
137
+ ImportSteps.verifyUserImportUrl();
138
+ });
139
+ });
@@ -0,0 +1,89 @@
1
+ import {QueryStubs} from "../../../stubs/yasgui/query-stubs";
2
+ import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
3
+ import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
4
+ import {TablePluginSteps} from "../../../steps/yasgui/table-plugin-steps";
5
+
6
+ describe('Execute of update query', () => {
7
+
8
+ let repositoryId;
9
+
10
+ beforeEach(() => {
11
+ repositoryId = 'sparql-editor-' + Date.now();
12
+ QueryStubs.stubQueryCountResponse();
13
+ cy.createRepository({id: repositoryId});
14
+ cy.presetRepository(repositoryId);
15
+ QueryStubs.stubDefaultQueryResponse(repositoryId);
16
+
17
+ SparqlEditorSteps.visitSparqlEditorPage();
18
+ YasqeSteps.getYasqe().should('be.visible');
19
+ });
20
+
21
+ afterEach(() => {
22
+ cy.deleteRepository(repositoryId);
23
+ });
24
+
25
+ it('should display properly result message info when insert 2 statements', {
26
+ retries: {
27
+ runMode: 1,
28
+ openMode: 0
29
+ }
30
+ }, () => {
31
+ // When I execute insert query which adds 2 results
32
+ YasqeSteps.pasteQuery(
33
+ 'PREFIX : <http://bedrock/> ' +
34
+ 'INSERT DATA { ' +
35
+ ':fred :hasSpouse :wilma.' +
36
+ ':fred :hasChild :pebbles.' +
37
+ '}');
38
+ YasqeSteps.executeQuery();
39
+
40
+ // Then I expect result message info to informs me that 2 statements have been added.
41
+ TablePluginSteps.getQueryResultInfo().contains('Added 2 statements.');
42
+ });
43
+
44
+ it('should display properly result message info when no one statement is added.', () => {
45
+ // When I execute insert query which don't change repository statements
46
+ YasqeSteps.pasteQuery(
47
+ 'PREFIX : <http://bedrock/> ' +
48
+ 'INSERT { ' +
49
+ ':fred :hasSpouse :wilma. ' +
50
+ '} WHERE { ' +
51
+ 'rdf:name rdf:label "not_exist_label".' +
52
+ '}');
53
+ YasqeSteps.executeQuery();
54
+
55
+ // Then I expect result message info to informs me that statements did not change.
56
+ TablePluginSteps.getQueryResultInfo().contains('The number of statements did not change.');
57
+ });
58
+
59
+ it('should display result message info which describes that two statements are removed', {
60
+ retries: {
61
+ runMode: 1,
62
+ openMode: 0
63
+ }
64
+ }, () => {
65
+ // When I visit a page with "ontotext-yasgui-web-component" in it,
66
+ // and selected repository has some inserted statements.
67
+ YasqeSteps.pasteQuery(
68
+ 'PREFIX : <http://bedrock/> ' +
69
+ 'INSERT DATA { ' +
70
+ ':fred :hasSpouse :wilma.' +
71
+ ':fred :hasChild :pebbles.' +
72
+ '}');
73
+ YasqeSteps.executeQuery();
74
+ // Wait statements to be inserted.
75
+ TablePluginSteps.getQueryResultInfo().contains('Added 2 statements.');
76
+
77
+ // When I execute delete query which removes 2 results
78
+ YasqeSteps.pasteQuery(
79
+ 'PREFIX : <http://bedrock/> ' +
80
+ 'DELETE DATA { ' +
81
+ ':fred :hasSpouse :wilma.' +
82
+ ':fred :hasChild :pebbles.' +
83
+ '}');
84
+ YasqeSteps.executeQuery();
85
+
86
+ // Then I expect result message info to informs me that 2 statements have been added.
87
+ TablePluginSteps.getQueryResultInfo().contains('Removed 2 statements.');
88
+ });
89
+ });
@@ -0,0 +1,84 @@
1
+ import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
2
+ import {YasguiSteps} from "../../../steps/yasgui/yasgui-steps";
3
+ import {ApplicationSteps} from "../../../steps/application-steps";
4
+ import {QueryStubs} from "../../../stubs/yasgui/query-stubs";
5
+ import {DEFAULT_QUERY} from "../../../steps/yasgui/saved-query";
6
+ import {ShareSavedQueryDialog} from "../../../steps/yasgui/share-saved-query-dialog";
7
+ import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
8
+
9
+ describe('Share query', () => {
10
+
11
+ let repositoryId;
12
+
13
+ beforeEach(() => {
14
+ repositoryId = 'sparql-editor-' + Date.now();
15
+ QueryStubs.stubQueryCountResponse();
16
+ cy.createRepository({id: repositoryId});
17
+ cy.presetRepository(repositoryId);
18
+ QueryStubs.stubDefaultQueryResponse(repositoryId);
19
+
20
+ SparqlEditorSteps.visitSparqlEditorPage();
21
+ YasguiSteps.getYasgui().should('be.visible');
22
+ });
23
+
24
+ afterEach(() => {
25
+ cy.deleteRepository(repositoryId);
26
+ });
27
+
28
+ it('Should be able to get shareable link for current query', () => {
29
+ // When I click on share query action
30
+ YasqeSteps.shareQuery();
31
+ // Then I expect a dialog with the shareable link to appear
32
+ ShareSavedQueryDialog.getDialog().should('be.visible');
33
+ ShareSavedQueryDialog.getDialogTitle().should('contain', 'Copy URL to clipboard');
34
+ ShareSavedQueryDialog.getShareLink().then((shareLink) => {
35
+ expect(shareLink).to.have.string(`/sparql?name=Unnamed&query=select%20*%20where%20%7B%20%20%0A%20%3Fs%20%3Fp%20%3Fo%20.%20%0A%20%7D%20limit%20100&infer=true&sameAs=true`);
36
+ });
37
+ // When I cancel operation
38
+ ShareSavedQueryDialog.closeDialog();
39
+ // Then I expect that the dialog should be closed
40
+ ShareSavedQueryDialog.getDialog().should('not.exist');
41
+ // And I click the copy button
42
+ YasqeSteps.shareQuery();
43
+ ShareSavedQueryDialog.getDialog().should('be.visible');
44
+ ShareSavedQueryDialog.copyLink();
45
+ // Then I expect that the share link is copied in the clipboard
46
+ ShareSavedQueryDialog.getDialog().should('not.exist');
47
+ ApplicationSteps.getSuccessNotifications().should('be.visible');
48
+ });
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
+ }, () => {
57
+ // Given I have opened the sparql editor
58
+ YasguiSteps.getTabs().should('have.length', 1);
59
+ // When I get the shareable link for current query
60
+ YasqeSteps.shareQuery();
61
+ ShareSavedQueryDialog.getDialog().should('be.visible');
62
+ // And I open the link
63
+ ShareSavedQueryDialog.getShareLink().then((shareLink) => {
64
+ cy.visit(shareLink);
65
+ // Then I expect that the sparql view should be opened
66
+ // And the saved query will be loaded in the editor
67
+ YasguiSteps.getTabs().should('have.length', 1);
68
+ YasguiSteps.getCurrentTab().should('contain', 'Unnamed');
69
+ YasguiSteps.getTabQuery(0).should('contain', DEFAULT_QUERY);
70
+ // TODO: And the infer should be active
71
+ // TODO: And the expand results should be active
72
+ // When I open the other tab
73
+ // TODO: the next step appears to be flaky with the element is detached error
74
+ // YasguiSteps.openTab(0);
75
+ // YasguiSteps.getCurrentTab().should('contain', 'Unnamed');
76
+ // // And I open the share link again
77
+ // cy.visit(shareLink);
78
+ // // Then I expect that the previously opened tab to be selected instead of opening a new one
79
+ // YasguiSteps.getTabs().should('have.length', 2);
80
+ // YasguiSteps.getCurrentTab().should('contain', savedQueryName);
81
+ // YasguiSteps.getTabQuery(0).should('contain', DEFAULT_QUERY);
82
+ });
83
+ });
84
+ });
@@ -0,0 +1,62 @@
1
+ import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
2
+ import {LuceneConnectorSteps} from "../../steps/lucene-connector-steps";
3
+ import {ConnectorsStubs} from "../../stubs/yasgui/connectors-stubs";
4
+ import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
5
+ import {ErrorPluginSteps} from "../../steps/yasgui/plugin/error-plugin-steps";
6
+ import {TablePluginSteps} from "../../steps/yasgui/table-plugin-steps";
7
+ import {QueryStubs} from "../../stubs/yasgui/query-stubs";
8
+
9
+ describe('Connectors - Lucene', () => {
10
+ let repositoryId;
11
+
12
+ beforeEach(() => {
13
+ repositoryId = 'sparql-editor-' + Date.now();
14
+ QueryStubs.stubQueryCountResponse();
15
+ cy.createRepository({id: repositoryId});
16
+ cy.presetRepository(repositoryId);
17
+
18
+ SparqlEditorSteps.visitSparqlEditorPage();
19
+ YasqeSteps.getEditor().should('be.visible');
20
+ });
21
+
22
+ afterEach(() => {
23
+ cy.deleteRepository(repositoryId);
24
+ });
25
+
26
+ it('should display error message if connector not supported.', () => {
27
+ // When I execute connector query which has not supported command.
28
+ ConnectorsStubs.stubLuceneHasNotSupport();
29
+ YasqeSteps.pasteQuery(LuceneConnectorSteps.getCreateConnectorQuery());
30
+ YasqeSteps.executeErrorQuery();
31
+
32
+ // Then I expect error message to be displayed.
33
+ ErrorPluginSteps.getErrorPluginBody().contains('No support for lucene-connector, lucene-connector connectors are not supported because the plugin Lucene is not active.');
34
+ });
35
+
36
+ it('should create Lucene connector.', () => {
37
+ // When I execute create lucene connector query.
38
+ YasqeSteps.pasteQuery(LuceneConnectorSteps.getCreateConnectorQuery('my_index'));
39
+ YasqeSteps.executeQueryWithoutWaiteResult();
40
+
41
+ // Then I expect Lucene connector to be created.
42
+ TablePluginSteps.getQueryResultInfo().contains('Created connector my_index');
43
+ });
44
+
45
+ it('should delete Lucene connector.', () => {
46
+ const connectorName = 'connector_to_be_deleted';
47
+ // Given a lucene connector is created.
48
+ YasqeSteps.pasteQuery(LuceneConnectorSteps.getCreateConnectorQuery(connectorName));
49
+ YasqeSteps.executeQuery();
50
+
51
+ // Then I expect Lucene connector to be created.
52
+ // This check is used to be sure that connector is created.
53
+ TablePluginSteps.getQueryResultInfo().contains(`Created connector ${connectorName}`);
54
+
55
+ // When I execute delete lucene connector query.
56
+ YasqeSteps.pasteQuery(LuceneConnectorSteps.getDeleteConnectorSteps(connectorName));
57
+ YasqeSteps.executeQuery();
58
+
59
+ // Then I expect Lucene connector to be created.
60
+ TablePluginSteps.getQueryResultInfo().contains(`Deleted connector ${connectorName}`);
61
+ });
62
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.3.1",
3
+ "version": "2.4.0-TR1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",
@@ -36,7 +36,8 @@
36
36
  "cypress-multi-reporters": "^1.6.3",
37
37
  "del": "^6.1.1",
38
38
  "minimist": "^1.2.5",
39
- "mocha-junit-reporter": "^2.2.0"
39
+ "mocha-junit-reporter": "^2.2.0",
40
+ "cypress-real-events": "^1.8.1"
40
41
  },
41
42
  "resolutions": {
42
43
  "minimist": "^1.2.5"
@@ -0,0 +1,23 @@
1
+ export class ApplicationSteps {
2
+
3
+ // notifications
4
+ static getNotifications() {
5
+ return cy.get('#toast-container');
6
+ }
7
+
8
+ static getSuccessNotifications() {
9
+ return this.getNotifications().find('.toast-success');
10
+ }
11
+
12
+ static getErrorNotifications() {
13
+ return this.getNotifications().find('.toast-error');
14
+ }
15
+
16
+ static getInfoNotification() {
17
+ return this.getNotifications().find('.toast-info');
18
+ }
19
+
20
+ static getWarningNotification() {
21
+ return this.getNotifications().find('.toast-warning');
22
+ }
23
+ }
@@ -0,0 +1,9 @@
1
+ export class ErrorSteps {
2
+ static getErrorElement() {
3
+ return cy.get('.idError');
4
+ }
5
+
6
+ static verifyError(errorMessage) {
7
+ ErrorSteps.getErrorElement().contains(errorMessage);
8
+ }
9
+ }
@@ -0,0 +1,24 @@
1
+ const VIEW_URL = '/graphs';
2
+
3
+ export class GraphsOverviewSteps {
4
+
5
+ static visit() {
6
+ cy.visit(VIEW_URL);
7
+ }
8
+
9
+ static verifyUrl() {
10
+ cy.url().should('eq', `${Cypress.config('baseUrl')}${VIEW_URL}`);
11
+ }
12
+
13
+ static getResults() {
14
+ return cy.get('#export-graphs').find('tbody tr');
15
+ }
16
+
17
+ static getResult(row = 0) {
18
+ return GraphsOverviewSteps.getResults().eq(row);
19
+ }
20
+
21
+ static openGraph(row = 0) {
22
+ GraphsOverviewSteps.getResult(row).find('td ').eq(1).find('a').click();
23
+ }
24
+ }
@@ -0,0 +1,113 @@
1
+ export class SimilarityIndexCreateSteps {
2
+
3
+ static visit() {
4
+ cy.visit('/similarity/index/create');
5
+ }
6
+
7
+ static verifyUrl() {
8
+ cy.url().should('include', '/similarity/index/create');
9
+ }
10
+
11
+ static getCancelButton() {
12
+ return cy.get('.cancel-similarity-index-btn');
13
+ }
14
+
15
+ static cancel() {
16
+ SimilarityIndexCreateSteps.getCancelButton().click();
17
+ }
18
+
19
+ static getCreateButton() {
20
+ return cy.get('.create-similarity-index-btn');
21
+ }
22
+
23
+ static create() {
24
+ SimilarityIndexCreateSteps.getCreateButton().click();
25
+ }
26
+
27
+ static getQueryButton() {
28
+ return cy.get('.save-query-btn');
29
+ }
30
+
31
+ static save() {
32
+ SimilarityIndexCreateSteps.getQueryButton().click();
33
+ }
34
+
35
+ static getSimilarityIndexNameInput() {
36
+ return cy.get('.similarity-index-name');
37
+ }
38
+
39
+ static typeSimilarityIndexName(similarityIndexName) {
40
+ // Forced because yasqe gets focus when it is initialized and can break typing of name.
41
+ // For example, if we type a long name, the first half will be typed in the input field and the second half into yasqe.
42
+ SimilarityIndexCreateSteps.getSimilarityIndexNameInput().type(similarityIndexName, {force: true});
43
+ }
44
+
45
+ static getSemanticVectorsInput() {
46
+ return cy.get('#indexParameters');
47
+ }
48
+
49
+ static getStopWordsInput() {
50
+ return cy.get('.stop-words');
51
+ }
52
+
53
+ static getAnalyzerClassInput() {
54
+ return cy.get('.analyzer-class');
55
+ }
56
+
57
+ static getLiteralIndexCheckbox() {
58
+ return cy.get('.literal-index');
59
+ }
60
+
61
+ static checkLiteralIndex() {
62
+ SimilarityIndexCreateSteps.getLiteralIndexCheckbox().check();
63
+ }
64
+
65
+ static getMoreOptions() {
66
+ return cy.get('.more-options-btn');
67
+ }
68
+
69
+ static showMoreOptions() {
70
+ SimilarityIndexCreateSteps.getMoreOptions().click();
71
+ }
72
+
73
+ static getSelectQueryTab() {
74
+ return cy.get('.select-query-tab');
75
+ }
76
+
77
+ static checkSelectQueryTabActive() {
78
+ SimilarityIndexCreateSteps.getSelectQueryTab().find('a.active');
79
+ }
80
+
81
+ static getSearchQueryTab() {
82
+ return cy.get('.search-query-tab');
83
+ }
84
+ static checkSearchQueryTabActive() {
85
+ SimilarityIndexCreateSteps.getSearchQueryTab().find('a.active');
86
+ }
87
+
88
+ static switchToSearchQueryTab() {
89
+ SimilarityIndexCreateSteps.getSearchQueryTab().click();
90
+ SimilarityIndexCreateSteps.checkSearchQueryTabActive();
91
+ }
92
+
93
+ static getAnalogicalQueryTab() {
94
+ return cy.get('.analogical-query-tab');
95
+ }
96
+
97
+ static checkAnalogicalQueryTabActive() {
98
+ SimilarityIndexCreateSteps.getAnalogicalQueryTab().find('a.active');
99
+ }
100
+
101
+ static switchToAnalogicalQueryTab() {
102
+ SimilarityIndexCreateSteps.getAnalogicalQueryTab().click();
103
+ SimilarityIndexCreateSteps.checkAnalogicalQueryTabActive();
104
+ }
105
+
106
+ static getCreatePredictionIndexTab() {
107
+ return cy.get('#create-predication-index');
108
+ }
109
+
110
+ static switchToCreatePredictionIndexTab() {
111
+ SimilarityIndexCreateSteps.getCreatePredictionIndexTab().click();
112
+ }
113
+ }
@@ -0,0 +1,18 @@
1
+ export class SimilarityIndexesSteps {
2
+
3
+ static visit() {
4
+ cy.visit('/similarity');
5
+ }
6
+
7
+ static verifyUrl() {
8
+ cy.url().should('eq', `${Cypress.config('baseUrl')}/similarity`);
9
+ }
10
+
11
+ static getSimilarityIndexRow(similarityIndexName) {
12
+ return cy.get('.index-row').contains(similarityIndexName).parent().parent();
13
+ }
14
+
15
+ static getEditButton(similarityIndexName) {
16
+ return SimilarityIndexesSteps.getSimilarityIndexRow(similarityIndexName).find('.edit-query-btn');
17
+ }
18
+ }
@@ -1,3 +1,5 @@
1
+ import {ModalDialogSteps} from "./modal-dialog-steps";
2
+
1
3
  /**
2
4
  * Reusable functions for interacting with the import page.
3
5
  */
@@ -7,6 +9,10 @@ class ImportSteps {
7
9
  ImportSteps.visitImport('user', repository);
8
10
  }
9
11
 
12
+ static verifyUserImportUrl() {
13
+ cy.url().should('include', '/import#user');
14
+ }
15
+
10
16
  static visitServerImport(repository) {
11
17
  ImportSteps.visitImport('server', repository);
12
18
  }
@@ -84,8 +90,9 @@ class ImportSteps {
84
90
  static removeUploadedFiles() {
85
91
  ImportSteps.selectAllUserFiles();
86
92
  cy.get('#wb-import-removeEntries').click();
93
+ ModalDialogSteps.getDialog().should('be.visible');
94
+ ModalDialogSteps.clickOnConfirmButton();
87
95
  cy.get('#wb-import-fileInFiles').should('be.hidden');
88
-
89
96
  return ImportSteps;
90
97
  }
91
98
 
@@ -0,0 +1,22 @@
1
+ export class LanguageSelectorSteps {
2
+ static getLanguageSelectorDropdown() {
3
+ return cy.get('#languageGroupDrop').should('be.visible');
4
+ }
5
+
6
+ static openLanguageSelectorDropdown() {
7
+ LanguageSelectorSteps.getLanguageSelectorDropdown().should('be.visible').click();
8
+ }
9
+
10
+ static changeLanguage(language) {
11
+ LanguageSelectorSteps.openLanguageSelectorDropdown();
12
+ cy.get('#lang-select-' + language).click();
13
+ }
14
+
15
+ static switchToFr() {
16
+ LanguageSelectorSteps.changeLanguage('fr');
17
+ }
18
+
19
+ static switchToEn() {
20
+ LanguageSelectorSteps.changeLanguage('en');
21
+ }
22
+ }
@@ -0,0 +1,10 @@
1
+ export class LoaderSteps {
2
+
3
+ static getLoader() {
4
+ return cy.get('.ot-loader-new-content');
5
+ }
6
+
7
+ static verifyMessage(message) {
8
+ LoaderSteps.getLoader().contains(message);
9
+ }
10
+ }