graphdb-workbench-tests 2.5.1 → 2.6.0-RC2

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 (114) 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/guides/guides.json +764 -0
  4. package/fixtures/guides/movies.ttl +629 -0
  5. package/fixtures/guides/starwars.ttl +4384 -0
  6. package/fixtures/locale-en.json +53 -12
  7. package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
  8. package/fixtures/queries/empty-query-response.json +11 -0
  9. package/integration/cluster/cluster-management.spec.js +1 -2
  10. package/integration/explore/graphs.overview.spec.js +4 -2
  11. package/integration/explore/similariti-index-create.spec.js +333 -0
  12. package/integration/explore/similarity-index.spec.js +88 -0
  13. package/integration/explore/similarity.spec.js +180 -56
  14. package/integration/explore/visual-graph/graphs-config.spec.js +453 -0
  15. package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +146 -347
  16. package/integration/guides/movies-interactive-guide.spec.js +73 -0
  17. package/integration/guides/star-wars-interactive-guide.js +60 -0
  18. package/integration/home/language-change.spec.js +3 -3
  19. package/integration/import/import.user.data.spec.js +2 -0
  20. package/integration/resource/resource.spec.js +357 -0
  21. package/integration/setup/aclmanagement/create-rule.spec.js +88 -11
  22. package/integration/setup/aclmanagement/delete-rule.spec.js +6 -4
  23. package/integration/setup/aclmanagement/edit-rule.spec.js +13 -8
  24. package/integration/setup/aclmanagement/render-rules.spec.js +4 -2
  25. package/integration/setup/aclmanagement/reorder-rules.spec.js +5 -3
  26. package/integration/setup/aclmanagement/revert-rules.spec.js +4 -3
  27. package/integration/setup/aclmanagement/scopes.spec.js +228 -0
  28. package/integration/setup/aclmanagement/update-rules.spec.js +17 -9
  29. package/integration/setup/jdbc-create.spec.js +330 -0
  30. package/integration/setup/jdbc.spec.js +78 -154
  31. package/integration/setup/my-settings.spec.js +9 -41
  32. package/integration/setup/sparql-template-create.js +150 -0
  33. package/integration/setup/sparql-templates.spec.js +82 -146
  34. package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
  35. package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
  36. package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
  37. package/integration/sparql-editor/actions/inferred-sameas.spec.js +47 -0
  38. package/integration/sparql-editor/actions/save-query.spec.js +70 -0
  39. package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
  40. package/integration/sparql-editor/internationalization.spec.js +41 -0
  41. package/integration/sparql-editor/saved-query/abort-query.spec.js +51 -0
  42. package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
  43. package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
  44. package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
  45. package/integration/sparql-editor/sparql-editor.spec.js +55 -0
  46. package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
  47. package/integration/sparql-editor/yasr/download-as.spec.js +54 -0
  48. package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
  49. package/integration/sparql-editor/yasr/table-plugin.spec.js +39 -0
  50. package/integration/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +57 -0
  51. package/integration-flaky/explore/visual.graph.spec.js +3 -2
  52. package/integration-flaky/setup/sparql-template-create.js +139 -0
  53. package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
  54. package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
  55. package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
  56. package/integration-flaky/sparql-editor/plugins/error-plugin.spec.js +83 -0
  57. package/integration-flaky/sparql-editor/yasr/table-plugin.spec.js +81 -0
  58. package/package.json +3 -1
  59. package/steps/application-steps.js +5 -0
  60. package/steps/autocomplete-steps.js +10 -0
  61. package/steps/error-steps.js +9 -0
  62. package/steps/explore/graphs-overview-steps.js +24 -0
  63. package/steps/explore/similarity-index-create-steps.js +113 -0
  64. package/steps/explore/similarity-indexes-steps.js +18 -0
  65. package/steps/guides/guide-dialog-steps.js +38 -0
  66. package/steps/guides/guide-steps.js +278 -0
  67. package/steps/guides/movies-guide-steps.js +241 -0
  68. package/steps/guides/star-wars-guide-steps.js +188 -0
  69. package/steps/import-steps.js +16 -0
  70. package/steps/language-selector-steps.js +22 -0
  71. package/steps/loader-steps.js +10 -0
  72. package/steps/lucene-connector-steps.js +43 -0
  73. package/steps/main-menu-steps.js +67 -0
  74. package/steps/repository-selector-steps.js +26 -0
  75. package/steps/repository-steps.js +4 -0
  76. package/steps/resource/resource-edit-steps.js +111 -0
  77. package/steps/resource/resource-steps.js +149 -0
  78. package/steps/setup/acl-management-steps.js +201 -39
  79. package/steps/setup/jdbc-create-steps.js +97 -0
  80. package/steps/setup/jdbc-steps.js +42 -0
  81. package/steps/setup/sparql-create-update-steps.js +55 -0
  82. package/steps/setup/sparql-templates-steps.js +38 -0
  83. package/steps/sparql-editor-steps.js +20 -0
  84. package/steps/sparql-steps.js +0 -6
  85. package/steps/visual-graph-steps.js +365 -6
  86. package/steps/yasgui/confirmation-dialog-steps.js +13 -0
  87. package/steps/yasgui/pagination-steps.js +47 -0
  88. package/steps/yasgui/plugin/error-plugin-steps.js +30 -0
  89. package/steps/yasgui/save-query-dialog.js +61 -0
  90. package/steps/yasgui/saved-queries-dialog.js +29 -0
  91. package/steps/yasgui/saved-query.js +25 -0
  92. package/steps/yasgui/share-saved-query-dialog.js +25 -0
  93. package/steps/yasgui/table-plugin-steps.js +29 -0
  94. package/steps/yasgui/yasgui-loader.js +10 -0
  95. package/steps/yasgui/yasgui-steps.js +191 -0
  96. package/steps/yasgui/yasqe-steps.js +187 -0
  97. package/steps/yasgui/yasr-steps.js +108 -0
  98. package/stubs/namespace-stubs.js +10 -0
  99. package/stubs/repositories-stub.js +58 -0
  100. package/stubs/security-stubs.js +69 -0
  101. package/stubs/yasgui/connectors-stubs.js +12 -0
  102. package/stubs/yasgui/query-stubs.js +253 -0
  103. package/support/index.js +3 -0
  104. package/support/repository-commands.js +5 -5
  105. package/support/sparql-commands.js +1 -1
  106. package/support/visual-graph-commands.js +25 -0
  107. package/integration/sparql/main.menu.spec.js +0 -232
  108. package/integration/sparql/sparql-error-handling.spec.js +0 -74
  109. package/integration/sparql/sparql-language-change.spec.js +0 -58
  110. package/integration/sparql/sparql-result-formating.spec.js +0 -84
  111. package/integration/sparql/sparql.menu.spec.js +0 -1253
  112. package/integration-flaky/setup/sparql-templates.spec.js +0 -125
  113. package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
  114. package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
@@ -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
+ });
@@ -0,0 +1,83 @@
1
+ import SparqlSteps from "../../../steps/sparql-steps";
2
+ import {QueryStubs} from "../../../stubs/query-stubs";
3
+ import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
4
+ import {ErrorPluginSteps} from "../../../steps/yasgui/plugin/error-plugin-steps";
5
+ import {YasrSteps} from "../../../steps/yasgui/yasr-steps";
6
+
7
+ const SHORT_ERROR_BODY = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore';
8
+ const LONG_ERROR_BODY = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
9
+ const LESS_MESSAGE = LONG_ERROR_BODY.substring(0, 160);
10
+
11
+ describe('Error handling', () => {
12
+ let repositoryId;
13
+
14
+ beforeEach(() => {
15
+ repositoryId = 'sparql-error-handling' + Date.now();
16
+ cy.createRepository({id: repositoryId});
17
+ cy.presetRepository(repositoryId);
18
+ SparqlSteps.visit();
19
+ });
20
+
21
+ afterEach(() => {
22
+ cy.deleteRepository(repositoryId);
23
+ });
24
+
25
+ it('should show error without show full message button when error message is less than 160 characters.', () => {
26
+ // When I visit a page with "ontotext-yasgui-web-component" in it,
27
+ // and execute wrong query that returns short error message (less thant 160).
28
+ QueryStubs.stubQueryErrorResponse(repositoryId, 500, SHORT_ERROR_BODY);
29
+ YasqeSteps.executeErrorQuery();
30
+
31
+ // Then I expect to see a message that
32
+ // describes error status and error text,
33
+ ErrorPluginSteps.getErrorPluginErrorStatus().contains('500: Internal Server Error');
34
+ // and time when the query is executed,
35
+ ErrorPluginSteps.getErrorPluginErrorTimeMessage().contains(/Query took \d{1}\.\d{1}s, moments ago\./);
36
+ // and error message sent by server,
37
+ ErrorPluginSteps.getErrorPluginBody().should('have.text', SHORT_ERROR_BODY);
38
+ // and toolbar with plugins to not be visible,
39
+ YasrSteps.getResultHeader().should('not.be.visible');
40
+ // and message info to not be visible,
41
+ YasrSteps.getResponseInfo().should('not.be.visible');
42
+ // and show full/less error message not be visible
43
+ ErrorPluginSteps.getShowFullErrorMessage().should('not.exist');
44
+ ErrorPluginSteps.getShowLessErrorMessage().should('not.exist');
45
+ });
46
+
47
+ it('should show error with show full message button when error message is more than than 160 characters.', () => {
48
+ // When I visit a page with "ontotext-yasgui-web-component" in it,
49
+ // and execute wrong query.
50
+ QueryStubs.stubQueryErrorResponse(repositoryId, 500, LONG_ERROR_BODY);
51
+ YasqeSteps.executeErrorQuery();
52
+
53
+ // Then I expect to see a message that
54
+ // describes error status and error text,
55
+ ErrorPluginSteps.getErrorPluginErrorStatus().contains('500: Internal Server Error');
56
+ // and time when the query is executed,
57
+ ErrorPluginSteps.getErrorPluginErrorTimeMessage().contains(/Query took \d{1}\.\d{1}s, moments ago\./);
58
+ // and error message sent by server,
59
+ ErrorPluginSteps.getErrorPluginBody().should('have.text', LESS_MESSAGE);
60
+ // and toolbar with plugins to not be visible,
61
+ YasrSteps.getResultHeader().should('not.be.visible');
62
+ // and message info to not be visible,
63
+ YasrSteps.getResponseInfo().should('not.be.visible');
64
+ ErrorPluginSteps.getShowFullErrorMessage().should('be.visible');
65
+ ErrorPluginSteps.getShowLessErrorMessage().should('not.exist');
66
+
67
+ // When click on show full message
68
+ ErrorPluginSteps.getShowFullErrorMessage().click();
69
+
70
+ // Then I expect to see full message
71
+ ErrorPluginSteps.getErrorPluginBody().should('have.text', LONG_ERROR_BODY);
72
+ ErrorPluginSteps.getShowFullErrorMessage().should('not.exist');
73
+ ErrorPluginSteps.getShowLessErrorMessage().should('be.visible');
74
+
75
+ // When click on show less message
76
+ ErrorPluginSteps.getShowLessErrorMessage().click();
77
+
78
+ // Then I expect to see first 160 characters of the error message
79
+ ErrorPluginSteps.getErrorPluginBody().should('have.text', LESS_MESSAGE);
80
+ ErrorPluginSteps.getShowFullErrorMessage().should('be.visible');
81
+ ErrorPluginSteps.getShowLessErrorMessage().should('not.exist');
82
+ });
83
+ });
@@ -0,0 +1,81 @@
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 {YasrSteps} from "../../../steps/yasgui/yasr-steps";
5
+ import {ApplicationSteps} from "../../../steps/application-steps";
6
+ import {TablePluginSteps} from "../../../steps/yasgui/table-plugin-steps";
7
+
8
+ describe('Yasr Table plugin', () => {
9
+ let repositoryId;
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
+ // Given I visit a page with "ontotex-yasgu-web-component" in it.
17
+ SparqlEditorSteps.visitSparqlEditorPage();
18
+ });
19
+
20
+ afterEach(() => {
21
+ cy.deleteRepository(repositoryId);
22
+ });
23
+
24
+ describe('Copy resource link dialog', () => {
25
+ it('Should copy url link be visible when the mouse is over a cell of result table', () => {
26
+ // When I execute a query which return results and results type is uri.
27
+ QueryStubs.stubDefaultQueryResponse();
28
+ YasqeSteps.executeQuery();
29
+
30
+ // And I hovered the mouse over a cell of result table.
31
+ YasrSteps.hoverCell(28, 2);
32
+
33
+ // Then I expect copy url link to be visible
34
+ YasrSteps.getCopyResourceLink(28, 2).should('be.visible');
35
+ });
36
+
37
+ it('Should be able to copy a link', {
38
+ retries: {
39
+ runMode: 1,
40
+ openMode: 0
41
+ }
42
+ }, () => {
43
+ // When I execute a query which returns results of type is uri.
44
+ QueryStubs.stubDefaultQueryResponse();
45
+ YasqeSteps.executeQuery();
46
+
47
+ // And copy resource dialog is open.
48
+ openCopyResourceLinkDialog();
49
+
50
+ // Then I expect copy link dialog to be opened.
51
+ TablePluginSteps.getCopyResourceLinkDialog().should('be.visible');
52
+
53
+ // And I expect the input of dialog to have value.
54
+ TablePluginSteps.getCopyResourceLinkInput().should('have.value', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type');
55
+
56
+ // When I click on cancel button
57
+ TablePluginSteps.clickCopyLinkDialogCancelButton();
58
+
59
+ // Then I expect copy link dialog to be closed.
60
+ TablePluginSteps.getCopyResourceLinkDialog().should('not.exist');
61
+
62
+ // And copy resource dialog is open.
63
+ openCopyResourceLinkDialog();
64
+
65
+ // And click on copy button
66
+ TablePluginSteps.clickCopyLinkDialogCopyButton();
67
+
68
+ // Then I expect copy link dialog to be closed.
69
+ TablePluginSteps.getCopyResourceLinkDialog().should('not.exist');
70
+
71
+ // And expect success message to be displayed.
72
+ ApplicationSteps.getSuccessNotifications().contains('URL copied successfully to clipboard.');
73
+
74
+ });
75
+ });
76
+ });
77
+
78
+ function openCopyResourceLinkDialog(rowNumber = 28, cellNumber = 2) {
79
+ YasrSteps.getCopyResourceLink(rowNumber, cellNumber).should('be.visible');
80
+ YasrSteps.copyResourceLink(rowNumber, cellNumber);
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.5.1",
3
+ "version": "2.6.0-RC2",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",
@@ -33,7 +33,9 @@
33
33
  "graphdb-workbench-cypress": "bin/graphdb-workbench-cypress"
34
34
  },
35
35
  "devDependencies": {
36
+ "cypress-file-upload": "^5.0.8",
36
37
  "cypress-multi-reporters": "^1.6.3",
38
+ "cypress-real-events": "^1.8.1",
37
39
  "del": "^6.1.1",
38
40
  "minimist": "^1.2.5",
39
41
  "mocha-junit-reporter": "^2.2.0"
@@ -1,4 +1,5 @@
1
1
  export class ApplicationSteps {
2
+
2
3
  // notifications
3
4
  static getNotifications() {
4
5
  return cy.get('#toast-container');
@@ -24,4 +25,8 @@ export class ApplicationSteps {
24
25
  static openImportPage() {
25
26
  cy.get('.main-menu .menu-element-root[href=import]').click();
26
27
  }
28
+
29
+ static geLoader() {
30
+ return cy.get('.ot-loader-new-content');
31
+ }
27
32
  }
@@ -0,0 +1,10 @@
1
+ export class AutocompleteSteps {
2
+
3
+ static getAutocompleteSwitch() {
4
+ return cy.get('.autocomplete-switch');
5
+ }
6
+
7
+ static getSuccessStatusElement() {
8
+ return cy.get('.autocomplete-status').find('.tag.tag-success.ng-binding');
9
+ }
10
+ }
@@ -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
+ }
@@ -0,0 +1,38 @@
1
+ export class GuideDialogSteps {
2
+
3
+ static getModalDialog() {
4
+ return cy.get('.shepherd-content:visible');
5
+ }
6
+
7
+ static getHeader() {
8
+ return GuideDialogSteps.getModalDialog().find('.shepherd-header');
9
+ }
10
+
11
+ static getContent() {
12
+ return GuideDialogSteps.getModalDialog().find('.shepherd-text');
13
+ }
14
+
15
+ static getFooter() {
16
+ return GuideDialogSteps.getModalDialog().find('.shepherd-footer');
17
+ }
18
+
19
+ static getNextButton() {
20
+ return GuideDialogSteps.getFooter().find('.shepherd-button').contains('Next');
21
+ }
22
+
23
+ static getPreviousButton() {
24
+ return GuideDialogSteps.getFooter().find('.shepherd-button').contains('Previous');
25
+ }
26
+
27
+ static clickOnNextButton(forceVisible = false) {
28
+ GuideDialogSteps.getNextButton().scrollIntoView().click({force: forceVisible});
29
+ }
30
+
31
+ static clickOnPreviousButton(forceVisible = false) {
32
+ GuideDialogSteps.getPreviousButton().scrollIntoView().click({force: forceVisible});
33
+ }
34
+
35
+ static assertDialogWithTitleIsVisible(text) {
36
+ GuideDialogSteps.getHeader().contains(text);
37
+ }
38
+ }