graphdb-workbench-tests 2.5.1 → 2.6.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.
- package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
- package/fixtures/graphql-editor/default-query-response.json +517 -0
- package/fixtures/guides/guides.json +764 -0
- package/fixtures/guides/movies.ttl +629 -0
- package/fixtures/guides/starwars.ttl +4384 -0
- package/fixtures/locale-en.json +44 -10
- package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
- package/fixtures/queries/empty-query-response.json +11 -0
- package/integration/cluster/cluster-management.spec.js +1 -2
- package/integration/explore/graphs.overview.spec.js +4 -2
- package/integration/explore/similariti-index-create.spec.js +333 -0
- package/integration/explore/similarity-index.spec.js +88 -0
- package/integration/explore/similarity.spec.js +180 -56
- package/integration/explore/visual-graph/graphs-config.spec.js +453 -0
- package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +146 -347
- package/integration/guides/movies-interactive-guide.spec.js +73 -0
- package/integration/guides/star-wars-interactive-guide.js +60 -0
- package/integration/home/language-change.spec.js +3 -3
- package/integration/import/import.user.data.spec.js +2 -0
- package/integration/resource/resource.spec.js +357 -0
- package/integration/setup/aclmanagement/create-rule.spec.js +88 -11
- package/integration/setup/aclmanagement/delete-rule.spec.js +6 -4
- package/integration/setup/aclmanagement/edit-rule.spec.js +13 -8
- package/integration/setup/aclmanagement/render-rules.spec.js +4 -2
- package/integration/setup/aclmanagement/reorder-rules.spec.js +5 -3
- package/integration/setup/aclmanagement/revert-rules.spec.js +4 -3
- package/integration/setup/aclmanagement/scopes.spec.js +220 -0
- package/integration/setup/aclmanagement/update-rules.spec.js +17 -9
- package/integration/setup/jdbc-create.spec.js +330 -0
- package/integration/setup/jdbc.spec.js +78 -154
- package/integration/setup/my-settings.spec.js +9 -41
- package/integration/setup/sparql-template-create.js +150 -0
- package/integration/setup/sparql-templates.spec.js +82 -146
- package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
- package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
- package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
- package/integration/sparql-editor/actions/inferred-sameas.spec.js +47 -0
- package/integration/sparql-editor/actions/save-query.spec.js +70 -0
- package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
- package/integration/sparql-editor/internationalization.spec.js +41 -0
- package/integration/sparql-editor/saved-query/abort-query.spec.js +51 -0
- package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
- package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
- package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
- package/integration/sparql-editor/sparql-editor.spec.js +55 -0
- package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
- package/integration/sparql-editor/yasr/download-as.spec.js +54 -0
- package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
- package/integration/sparql-editor/yasr/table-plugin.spec.js +39 -0
- package/integration/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +57 -0
- package/integration-flaky/explore/visual.graph.spec.js +3 -2
- package/integration-flaky/setup/sparql-template-create.js +139 -0
- package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
- package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
- package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
- package/integration-flaky/sparql-editor/plugins/error-plugin.spec.js +83 -0
- package/integration-flaky/sparql-editor/yasr/table-plugin.spec.js +81 -0
- package/package.json +3 -1
- package/steps/application-steps.js +5 -0
- package/steps/autocomplete-steps.js +10 -0
- package/steps/error-steps.js +9 -0
- package/steps/explore/graphs-overview-steps.js +24 -0
- package/steps/explore/similarity-index-create-steps.js +113 -0
- package/steps/explore/similarity-indexes-steps.js +18 -0
- package/steps/guides/guide-dialog-steps.js +38 -0
- package/steps/guides/guide-steps.js +278 -0
- package/steps/guides/movies-guide-steps.js +241 -0
- package/steps/guides/star-wars-guide-steps.js +188 -0
- package/steps/import-steps.js +16 -0
- package/steps/language-selector-steps.js +22 -0
- package/steps/loader-steps.js +10 -0
- package/steps/lucene-connector-steps.js +43 -0
- package/steps/main-menu-steps.js +67 -0
- package/steps/repository-selector-steps.js +26 -0
- package/steps/repository-steps.js +4 -0
- package/steps/resource/resource-edit-steps.js +111 -0
- package/steps/resource/resource-steps.js +149 -0
- package/steps/setup/acl-management-steps.js +193 -35
- package/steps/setup/jdbc-create-steps.js +97 -0
- package/steps/setup/jdbc-steps.js +42 -0
- package/steps/setup/sparql-create-update-steps.js +55 -0
- package/steps/setup/sparql-templates-steps.js +38 -0
- package/steps/sparql-editor-steps.js +20 -0
- package/steps/sparql-steps.js +0 -6
- package/steps/visual-graph-steps.js +365 -6
- package/steps/yasgui/confirmation-dialog-steps.js +13 -0
- package/steps/yasgui/pagination-steps.js +47 -0
- package/steps/yasgui/plugin/error-plugin-steps.js +30 -0
- package/steps/yasgui/save-query-dialog.js +61 -0
- package/steps/yasgui/saved-queries-dialog.js +29 -0
- package/steps/yasgui/saved-query.js +25 -0
- package/steps/yasgui/share-saved-query-dialog.js +25 -0
- package/steps/yasgui/table-plugin-steps.js +29 -0
- package/steps/yasgui/yasgui-loader.js +10 -0
- package/steps/yasgui/yasgui-steps.js +191 -0
- package/steps/yasgui/yasqe-steps.js +187 -0
- package/steps/yasgui/yasr-steps.js +108 -0
- package/stubs/namespace-stubs.js +10 -0
- package/stubs/repositories-stub.js +58 -0
- package/stubs/security-stubs.js +69 -0
- package/stubs/yasgui/connectors-stubs.js +12 -0
- package/stubs/yasgui/query-stubs.js +253 -0
- package/support/index.js +3 -0
- package/support/repository-commands.js +5 -5
- package/support/sparql-commands.js +1 -1
- package/support/visual-graph-commands.js +25 -0
- package/integration/sparql/main.menu.spec.js +0 -232
- package/integration/sparql/sparql-error-handling.spec.js +0 -74
- package/integration/sparql/sparql-language-change.spec.js +0 -58
- package/integration/sparql/sparql-result-formating.spec.js +0 -84
- package/integration/sparql/sparql.menu.spec.js +0 -1253
- package/integration-flaky/setup/sparql-templates.spec.js +0 -125
- package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
- package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
|
@@ -0,0 +1,150 @@
|
|
|
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 template id is required', () => {
|
|
29
|
+
// When I visit 'Sparql create template' view,
|
|
30
|
+
// and click on "Save" button without to fill template id.
|
|
31
|
+
SparqlCreateUpdateSteps.clickOnSaveButton();
|
|
32
|
+
|
|
33
|
+
// Then I expect to see error message.
|
|
34
|
+
SparqlCreateUpdateSteps.getRequiredErrorElement().contains('SPARQL template IRI is required');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should has error message described that template id is invalid', () => {
|
|
38
|
+
// When I visit 'Sparql create template' view,
|
|
39
|
+
// and fill an invalid template id,
|
|
40
|
+
const invalidTemplateName = 'invalid-template-id';
|
|
41
|
+
SparqlCreateUpdateSteps.typeTemplateId(invalidTemplateName);
|
|
42
|
+
// and click on "Save" button without to fill template id.
|
|
43
|
+
SparqlCreateUpdateSteps.clickOnSaveButton();
|
|
44
|
+
|
|
45
|
+
// Then I expect to see error message.
|
|
46
|
+
SparqlCreateUpdateSteps.getInvalidErrorElement().contains(`'${invalidTemplateName}' is not a valid IRI`);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should has error message described that query mode is invalid', () => {
|
|
50
|
+
// When I visit 'Sparql create template' view,
|
|
51
|
+
// and fill valid template id.
|
|
52
|
+
SparqlCreateUpdateSteps.typeTemplateId('http://test');
|
|
53
|
+
|
|
54
|
+
// When I fill non update query (select for example).
|
|
55
|
+
YasqeSteps.clearEditor();
|
|
56
|
+
YasqeSteps.writeInEditor('select * where {?s ?p ?o}');
|
|
57
|
+
// and click on "Save" button.
|
|
58
|
+
SparqlCreateUpdateSteps.clickOnSaveButton();
|
|
59
|
+
|
|
60
|
+
// Then I expect to see error message.
|
|
61
|
+
SparqlCreateUpdateSteps.getInvalidQueryModeElement().contains('The template query must be an UPDATE query');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should navigate to other view if there are no changes', () => {
|
|
65
|
+
// When I visit 'Sparql create template' view,
|
|
66
|
+
// and navigate to other view.
|
|
67
|
+
ImportSteps.visitUserImport(repositoryId);
|
|
68
|
+
|
|
69
|
+
// Then I expect to be navigated without confirmation.
|
|
70
|
+
ImportSteps.verifyUserImportUrl();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should confirm me before navigate when template id is changed', () => {
|
|
74
|
+
// When I visit 'Sparql create template' view,
|
|
75
|
+
// and set template id.
|
|
76
|
+
SparqlCreateUpdateSteps.typeTemplateId('http://test');
|
|
77
|
+
|
|
78
|
+
// When I try to navigate to other view
|
|
79
|
+
MainMenuSteps.clickOnMenu('Import');
|
|
80
|
+
|
|
81
|
+
// Then I expect to see confirm dialog inform me that there are unsaved changes.
|
|
82
|
+
ModalDialogSteps.getDialogHeader().contains('Confirm');
|
|
83
|
+
ModalDialogSteps.getDialogBody().contains('You have unsaved changes. Are you sure that you want to exit?');
|
|
84
|
+
|
|
85
|
+
// When I click on close button
|
|
86
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
87
|
+
|
|
88
|
+
// Then I expect to stay on current page
|
|
89
|
+
SparqlCreateUpdateSteps.verifyUrl();
|
|
90
|
+
|
|
91
|
+
// When I click on cancel button.
|
|
92
|
+
MainMenuSteps.clickOnMenu('Import');
|
|
93
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
94
|
+
|
|
95
|
+
// Then I expect to stay on current page
|
|
96
|
+
SparqlCreateUpdateSteps.verifyUrl();
|
|
97
|
+
|
|
98
|
+
// When I click on confirm button.
|
|
99
|
+
MainMenuSteps.clickOnMenu('Import');
|
|
100
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
101
|
+
|
|
102
|
+
// Then I expect to be navigated to other view.
|
|
103
|
+
ImportSteps.verifyUserImportUrl();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('should not change the view if I am creating a new sparql template and change the repository', () => {
|
|
107
|
+
// When I visit 'Sparql create template' view,
|
|
108
|
+
// make some changes.
|
|
109
|
+
SparqlCreateUpdateSteps.typeTemplateId('http://test');
|
|
110
|
+
// When I change the repository.
|
|
111
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
112
|
+
// Then I expect the view not changed
|
|
113
|
+
SparqlCreateUpdateSteps.verifyUrl();
|
|
114
|
+
// And I expect to see a confirmation dialog.
|
|
115
|
+
ModalDialogSteps.getDialog().should('be.visible');
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('Should redirect to templates catalog view when repository is changed', () => {
|
|
119
|
+
// When I visit 'Sparql create template' view
|
|
120
|
+
// When I change the repository.
|
|
121
|
+
RepositorySelectorSteps.selectRepository(secondRepositoryId);
|
|
122
|
+
// Then I expect to be redirected to templates catalog view.
|
|
123
|
+
SparqlTemplatesSteps.verifyUrl();
|
|
124
|
+
SparqlTemplatesSteps.getSparqlTemplatesListContainer().should('be.visible');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('should ask for confirmation when try to save sparql template with already existing template id', () => {
|
|
128
|
+
// When I visit 'Sparql create template' view,
|
|
129
|
+
// create a SPARQL template
|
|
130
|
+
const templateName = 'http://' + Date.now();
|
|
131
|
+
SparqlCreateUpdateSteps.typeTemplateId(templateName);
|
|
132
|
+
SparqlCreateUpdateSteps.clickOnSaveButton();
|
|
133
|
+
SparqlTemplatesSteps.verifyUrl();
|
|
134
|
+
|
|
135
|
+
// When try to create a template with same template IRI
|
|
136
|
+
SparqlCreateUpdateSteps.visit();
|
|
137
|
+
SparqlCreateUpdateSteps.typeTemplateId(templateName);
|
|
138
|
+
SparqlCreateUpdateSteps.clickOnSaveButton();
|
|
139
|
+
|
|
140
|
+
// Then I expect to see confirm dialog.
|
|
141
|
+
ModalDialogSteps.getDialogHeader().contains('Confirm save');
|
|
142
|
+
ModalDialogSteps.getDialogBody().contains('Do you want to override the template query?');
|
|
143
|
+
|
|
144
|
+
// When I click on cancel button.
|
|
145
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
146
|
+
|
|
147
|
+
// Then I expect template to not be saved and stay on sparql template create view.
|
|
148
|
+
SparqlCreateUpdateSteps.verifyUrl();
|
|
149
|
+
});
|
|
150
|
+
});
|
|
@@ -1,160 +1,96 @@
|
|
|
1
|
+
import {SparqlTemplatesSteps} from "../../steps/setup/sparql-templates-steps";
|
|
2
|
+
import {SparqlCreateUpdateSteps} from "../../steps/setup/sparql-create-update-steps";
|
|
3
|
+
import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
|
|
4
|
+
import {ToasterSteps} from "../../steps/toaster-steps";
|
|
5
|
+
|
|
1
6
|
describe('SPARQL Templates', () => {
|
|
2
7
|
|
|
3
8
|
let repositoryId;
|
|
4
|
-
const TEMPLATE_NAME = "http://example.com/salary_template";
|
|
5
|
-
const SPARQL_TEMPLATE = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" +
|
|
6
|
-
"PREFIX factory: <http://factory/>\n" +
|
|
7
|
-
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n" +
|
|
8
|
-
"PREFIX spif: <http://spinrdf.org/spif#>\n" +
|
|
9
|
-
"INSERT {\n" +
|
|
10
|
-
"?id <http://factory/updatedOn> \"2021-10-01T07:55:38.238Z\"^^xsd:dateTime .\n" +
|
|
11
|
-
"?split spif:split (\"blaaa/blaa\" \"/\")\n" +
|
|
12
|
-
"} WHERE {\n" +
|
|
13
|
-
"?id rdf:type <http://factory/Factory> .\n" +
|
|
14
|
-
"?worker <http://factory/worksIn> ?id .\n" +
|
|
15
|
-
"?worker <http://factory/hasSalary> ?oldSalary .\n" +
|
|
16
|
-
"FILTER regex(STR(?id), \"fac\", \"i\")\n" +
|
|
17
|
-
"?split spif:split (\"blaaa/blaa\" \"/\")\n" +
|
|
18
|
-
"bind(now() as ?now)\n" +
|
|
19
|
-
"}";
|
|
20
|
-
const DEFAULT_QUERY = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" +
|
|
21
|
-
"PREFIX ex: <http://example.com#>\n" +
|
|
22
|
-
"DELETE {\n" +
|
|
23
|
-
" ?subject ex:myPredicate ?oldValue .\n" +
|
|
24
|
-
"} INSERT {\n" +
|
|
25
|
-
" ?subject ex:myPredicate ?newValue .\n" +
|
|
26
|
-
"} WHERE {\n" +
|
|
27
|
-
" ?id rdf:type ex:MyType .\n" +
|
|
28
|
-
" ?subject ex:isRelatedTo ?id .\n" +
|
|
29
|
-
"}\n";
|
|
30
|
-
|
|
31
|
-
before(() => {
|
|
32
|
-
repositoryId = 'sparql-templates-repo' + Date.now();
|
|
33
|
-
cy.createRepository({id: repositoryId});
|
|
34
|
-
});
|
|
35
9
|
|
|
36
10
|
beforeEach(() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
cy.window()
|
|
43
|
-
.then(() => getTemplatesTable().scrollIntoView().should('be.visible'));
|
|
11
|
+
repositoryId = 'sparql-templates-repo' + Date.now();
|
|
12
|
+
cy.createRepository({id: repositoryId});
|
|
13
|
+
cy.presetRepository(repositoryId);
|
|
14
|
+
SparqlTemplatesSteps.visit();
|
|
44
15
|
});
|
|
45
16
|
|
|
46
|
-
|
|
17
|
+
afterEach(() => {
|
|
47
18
|
cy.deleteRepository(repositoryId);
|
|
48
19
|
});
|
|
49
20
|
|
|
50
|
-
it('
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
21
|
+
it('should not create a SPARQL template if cancel button is clicked', () => {
|
|
22
|
+
// When I visit 'Sparql templates' view,
|
|
23
|
+
// and click on create template button.
|
|
24
|
+
SparqlTemplatesSteps.clickOnCreateSparqlTemplateButton();
|
|
25
|
+
|
|
26
|
+
// Then, I expect to be navigated to "Sparql create template" view.
|
|
27
|
+
SparqlCreateUpdateSteps.verifyUrl();
|
|
28
|
+
|
|
29
|
+
// When I click on button cancel.
|
|
30
|
+
SparqlCreateUpdateSteps.clickOnCancelButton();
|
|
58
31
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
getSaveButton().click();
|
|
65
|
-
//Verify error toast
|
|
66
|
-
getToastError()
|
|
67
|
-
.should('be.visible')
|
|
68
|
-
.and('contain','SPARQL template IRI is required');
|
|
69
|
-
//Type a valid Template IRI value in the filed
|
|
70
|
-
getTemplateNameField().type(TEMPLATE_NAME);
|
|
71
|
-
//Verify default query
|
|
72
|
-
verifyQueryAreaEquals(DEFAULT_QUERY);
|
|
73
|
-
//Paste new template query and verify content
|
|
74
|
-
cy.pasteQuery(SPARQL_TEMPLATE);
|
|
75
|
-
verifyQueryAreaEquals(SPARQL_TEMPLATE);
|
|
76
|
-
getSaveButton()
|
|
77
|
-
.scrollIntoView()
|
|
78
|
-
.click()
|
|
79
|
-
.then(() => {
|
|
80
|
-
cy.waitUntil(() =>
|
|
81
|
-
cy.get('.edit-query-btn')
|
|
82
|
-
.then(editBtn => editBtn));
|
|
83
|
-
});
|
|
84
|
-
//Verify new template is stored in the templates table
|
|
85
|
-
getTemplatesTable().should('be.visible')
|
|
86
|
-
.and('contain',TEMPLATE_NAME);
|
|
87
|
-
//Edit template
|
|
88
|
-
getEditTemplateButton(TEMPLATE_NAME);
|
|
89
|
-
cy.waitUntilQueryIsVisible();
|
|
90
|
-
verifyQueryAreaEquals(SPARQL_TEMPLATE);
|
|
91
|
-
//Cancel as no changes have been made
|
|
92
|
-
getCancelButton().click();
|
|
93
|
-
//Delete template and verify templates table is empty
|
|
94
|
-
getDeleteTemplateButton(TEMPLATE_NAME);
|
|
95
|
-
getConfirmDeleteTemplateButton().click();
|
|
96
|
-
cy.url().should('include', '/sparql-templates');
|
|
97
|
-
getTemplatesTable().should('be.visible')
|
|
98
|
-
.and('contain','No templates are defined');
|
|
32
|
+
// Then, I expect to be navigated to "Sparql templates" view,
|
|
33
|
+
SparqlTemplatesSteps.verifyUrl();
|
|
34
|
+
// and expect that no query has been created.
|
|
35
|
+
SparqlTemplatesSteps.getSparqlTemplates().should('have.length', 0);
|
|
36
|
+
SparqlTemplatesSteps.getNoTemplateDefinedElement().should('contain.text', 'No templates are defined');
|
|
99
37
|
});
|
|
100
38
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return cy.get('.confirm-btn');
|
|
159
|
-
}
|
|
39
|
+
it('should create a query and delete it', () => {
|
|
40
|
+
// When I visit 'Sparql templates' view,
|
|
41
|
+
// and click on create template button.
|
|
42
|
+
SparqlTemplatesSteps.clickOnCreateSparqlTemplateButton();
|
|
43
|
+
|
|
44
|
+
// Then, I expect to be navigated to "Sparql create template" view.
|
|
45
|
+
SparqlCreateUpdateSteps.verifyUrl();
|
|
46
|
+
|
|
47
|
+
const templateId = `http://test-${Date.now()}`;
|
|
48
|
+
// When I fill template id,
|
|
49
|
+
SparqlCreateUpdateSteps.typeTemplateId(templateId);
|
|
50
|
+
|
|
51
|
+
// and click on save button.
|
|
52
|
+
SparqlCreateUpdateSteps.clickOnSaveButton();
|
|
53
|
+
|
|
54
|
+
// Then, I expect to be navigated to "Sparql templates" view,
|
|
55
|
+
SparqlTemplatesSteps.verifyUrl();
|
|
56
|
+
// and expect a query has been created.
|
|
57
|
+
SparqlTemplatesSteps.getSparqlTemplates().should('have.length', 1);
|
|
58
|
+
SparqlTemplatesSteps.getNoTemplateDefinedElement().should('not.exist');
|
|
59
|
+
SparqlTemplatesSteps.getSparqlTemplate(templateId).should('exist');
|
|
60
|
+
|
|
61
|
+
// When I try to delete the query.
|
|
62
|
+
SparqlTemplatesSteps.deleteTemplate(templateId);
|
|
63
|
+
|
|
64
|
+
// Then I expect to see Warning dialog,
|
|
65
|
+
ModalDialogSteps.getDialogHeader().contains('Warning');
|
|
66
|
+
ModalDialogSteps.getDialogBody().contains(`Are you sure you want to delete the SPARQL template '${templateId}'?`);
|
|
67
|
+
|
|
68
|
+
// When click on close button
|
|
69
|
+
ModalDialogSteps.clickOnCloseButton();
|
|
70
|
+
|
|
71
|
+
//Then I expect query to be not deleted.
|
|
72
|
+
SparqlTemplatesSteps.getSparqlTemplate(templateId).should('exist');
|
|
73
|
+
|
|
74
|
+
// When confirm dialog is open,
|
|
75
|
+
SparqlTemplatesSteps.deleteTemplate(templateId);
|
|
76
|
+
// and click on cancel button.
|
|
77
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
78
|
+
|
|
79
|
+
//Then I expect query to be not deleted.
|
|
80
|
+
SparqlTemplatesSteps.getSparqlTemplate(templateId).should('exist');
|
|
81
|
+
|
|
82
|
+
// When confirm dialog is open,
|
|
83
|
+
SparqlTemplatesSteps.deleteTemplate(templateId);
|
|
84
|
+
// and click on confirm button.
|
|
85
|
+
ModalDialogSteps.clickOnConfirmButton();
|
|
86
|
+
|
|
87
|
+
// Then, I expect to be navigated to "Sparql templates" view,
|
|
88
|
+
SparqlTemplatesSteps.verifyUrl();
|
|
89
|
+
// and expect that no query has been created.
|
|
90
|
+
SparqlTemplatesSteps.getSparqlTemplates().should('have.length', 0);
|
|
91
|
+
SparqlTemplatesSteps.getNoTemplateDefinedElement().should('contain.text', 'No templates are defined');
|
|
92
|
+
|
|
93
|
+
ToasterSteps.verifyTitle('Deleted successfully SPARQL template');
|
|
94
|
+
ToasterSteps.verifySuccess(templateId);
|
|
95
|
+
});
|
|
160
96
|
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
|
|
2
|
+
import {YasguiSteps} from "../../../steps/yasgui/yasgui-steps";
|
|
3
|
+
import {QueryStubs} from "../../../stubs/yasgui/query-stubs";
|
|
4
|
+
import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
|
|
5
|
+
|
|
6
|
+
describe('Execute 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
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
cy.deleteRepository(repositoryId);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('Should be able to execute query from each editor tab', () => {
|
|
26
|
+
cy.intercept('POST', `/repositories/${repositoryId}`).as('query');
|
|
27
|
+
YasqeSteps.executeQuery();
|
|
28
|
+
cy.wait('@query').then((interception) => {
|
|
29
|
+
const headers = interception.request.headers;
|
|
30
|
+
expect(headers).to.have.property('x-graphdb-local-consistency');
|
|
31
|
+
expect(headers).to.have.property('x-graphdb-repository-location');
|
|
32
|
+
expect(headers).to.have.property('x-graphdb-track-alias');
|
|
33
|
+
});
|
|
34
|
+
YasguiSteps.openANewTab();
|
|
35
|
+
YasguiSteps.getTabs().should('have.length', 2);
|
|
36
|
+
YasqeSteps.executeQuery();
|
|
37
|
+
cy.wait('@query').then((interception) => {
|
|
38
|
+
const headers = interception.request.headers;
|
|
39
|
+
expect(headers).to.have.property('x-graphdb-local-consistency');
|
|
40
|
+
expect(headers).to.have.property('x-graphdb-repository-location');
|
|
41
|
+
expect(headers).to.have.property('x-graphdb-track-alias');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
|
|
2
|
+
import {YasguiSteps} from "../../../steps/yasgui/yasgui-steps";
|
|
3
|
+
import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
|
|
4
|
+
import {QueryStubDescription, QueryStubs} from "../../../stubs/yasgui/query-stubs";
|
|
5
|
+
|
|
6
|
+
describe('Expand results over owl:sameAs', () => {
|
|
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
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
cy.deleteRepository(repositoryId);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('Should be able to toggle expand results parameter', () => {
|
|
22
|
+
QueryStubs.stubInferAndSameAsDefaults(true, true);
|
|
23
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
24
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
25
|
+
const queryDescription = new QueryStubDescription()
|
|
26
|
+
.setRepositoryId(repositoryId)
|
|
27
|
+
.setTotalElements(1);
|
|
28
|
+
QueryStubs.stubQueryResults(queryDescription);
|
|
29
|
+
// When I open the editor
|
|
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');
|
|
32
|
+
YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-on');
|
|
33
|
+
YasqeSteps.executeQuery();
|
|
34
|
+
cy.wait('@query-1_0_1001_1').its('request.body').should('contain', 'sameAs=true');
|
|
35
|
+
// When I disable the expand results action
|
|
36
|
+
YasqeSteps.expandResultsOverSameAs();
|
|
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');
|
|
39
|
+
YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-off');
|
|
40
|
+
// And sameAs=false parameter should be sent with the request
|
|
41
|
+
YasqeSteps.executeQuery();
|
|
42
|
+
cy.wait('@query-1_0_1001_1').its('request.body').should('contain', 'sameAs=false');
|
|
43
|
+
YasqeSteps.expandResultsOverSameAs();
|
|
44
|
+
// When I disable the include inferred action
|
|
45
|
+
YasqeSteps.includeInferredStatements();
|
|
46
|
+
// Then I expect that sameAs should be disabled too
|
|
47
|
+
YasqeSteps.getExpandResultsOverSameAsButtonTooltip().should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
|
|
48
|
+
YasqeSteps.getExpandResultsOverSameAsButton().should('have.class', 'icon-same-as-off');
|
|
49
|
+
YasqeSteps.executeQuery();
|
|
50
|
+
cy.wait('@query-1_0_1001_1').its('request.body').should('contain', 'infer=false&sameAs=false');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should be enabled when infer is true and sameAs is true in user settings', () => {
|
|
54
|
+
QueryStubs.stubInferAndSameAsDefaults(true, true);
|
|
55
|
+
|
|
56
|
+
// When I visit a page with "ontotext-yasgui-web-component" in it.
|
|
57
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
58
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
59
|
+
|
|
60
|
+
// Then I expect that "sameAs" element to be enabled by default
|
|
61
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
|
|
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');
|
|
64
|
+
|
|
65
|
+
// When I open a new Tab.
|
|
66
|
+
YasguiSteps.openANewTab();
|
|
67
|
+
|
|
68
|
+
// Then I expect that "sameAs" element to be enabled in the new tab.
|
|
69
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
|
|
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');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should not be enabled when infer is true and sameAs is false in user settings', () => {
|
|
75
|
+
QueryStubs.stubInferAndSameAsDefaults(true, false);
|
|
76
|
+
|
|
77
|
+
// When I visit a page with "ontotext-yasgui-web-component" in it.
|
|
78
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
79
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
80
|
+
|
|
81
|
+
// Then I expect that "sameAs" element to be disabled by default
|
|
82
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
|
|
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');
|
|
85
|
+
|
|
86
|
+
// When I open a new Tab.
|
|
87
|
+
YasguiSteps.openANewTab();
|
|
88
|
+
|
|
89
|
+
// Then I expect that "sameAs" element to be disabled in the new tab.
|
|
90
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
|
|
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');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('should not be enabled when infer is false and sameAs is true in user settings', () => {
|
|
96
|
+
QueryStubs.stubInferAndSameAsDefaults(false, true);
|
|
97
|
+
|
|
98
|
+
// When I visit a page with "ontotext-yasgui-web-component" in it.
|
|
99
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
100
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
101
|
+
|
|
102
|
+
// Then I expect that "sameAs" element to be disabled by default
|
|
103
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
|
|
104
|
+
// and the tooltip of element describes that "infer" is required.
|
|
105
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
|
|
106
|
+
|
|
107
|
+
// When I open a new Tab.
|
|
108
|
+
YasguiSteps.openANewTab();
|
|
109
|
+
|
|
110
|
+
// Then I expect that "sameAs" element to be disabled in the new tab,
|
|
111
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
|
|
112
|
+
// and the tooltip of element describes that "infer" is required.
|
|
113
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('should not be enabled when infer is false and sameAs is false in user settings', () => {
|
|
117
|
+
QueryStubs.stubInferAndSameAsDefaults(false, false);
|
|
118
|
+
|
|
119
|
+
// When I visit a page with "ontotext-yasgui-web-component" in it.
|
|
120
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
121
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
122
|
+
|
|
123
|
+
// Then I expect that "sameAs" element to be disabled by default,
|
|
124
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
|
|
125
|
+
// and the tooltip of element describes that "infer" is required.
|
|
126
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
|
|
127
|
+
|
|
128
|
+
// When I open a new Tab.
|
|
129
|
+
YasguiSteps.openANewTab();
|
|
130
|
+
|
|
131
|
+
// Then I expect that "sameAs" element to be disabled in the new tab,
|
|
132
|
+
YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
|
|
133
|
+
// and the tooltip of element describes that "infer" is required.
|
|
134
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'data-tooltip', 'Requires \'Include Inferred\'!');
|
|
135
|
+
});
|
|
136
|
+
});
|