graphdb-workbench-tests 2.2.1 → 2.2.2-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/integration/import/import.server.files.spec.js +0 -20
- package/integration/monitor/monitor.resources.spec.js +2 -3
- package/integration/repository/repositories.spec.js +2 -3
- package/integration/setup/my-settings.spec.js +2 -1
- package/integration/setup/sparql-templates.spec.js +0 -19
- package/integration/sparql/main.menu.spec.js +2 -2
- package/integration-flaky/import/import.server.files.spec.js +39 -0
- package/integration-flaky/setup/sparql-templates.spec.js +125 -0
- package/package.json +1 -1
- package/steps/import-steps.js +1 -1
|
@@ -10,7 +10,6 @@ describe('Import screen validation - server files', () => {
|
|
|
10
10
|
const FILE_FOR_IMPORT = 'italian_public_schools_links.nt.gz';
|
|
11
11
|
const TTLS_FOR_IMPORT = 'test_turtlestar.ttls';
|
|
12
12
|
const TRIGS_FOR_IMPORT = 'test-trigstar.trigs';
|
|
13
|
-
const BLANK_NODE_FILE = 'bnodes.ttl';
|
|
14
13
|
|
|
15
14
|
beforeEach(() => {
|
|
16
15
|
repositoryId = 'server-import-' + Date.now();
|
|
@@ -43,14 +42,6 @@ describe('Import screen validation - server files', () => {
|
|
|
43
42
|
.verifyImportStatusDetails(FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,']);
|
|
44
43
|
});
|
|
45
44
|
|
|
46
|
-
it('Test import all Server files successfully without changing settings', () => {
|
|
47
|
-
ImportSteps
|
|
48
|
-
.selectAllServerFiles()
|
|
49
|
-
.importServerFiles()
|
|
50
|
-
.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE)
|
|
51
|
-
.verifyImportStatus(BLANK_NODE_FILE, SUCCESS_MESSAGE);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
45
|
it('Test import with resetting status of imported file', () => {
|
|
55
46
|
ImportSteps
|
|
56
47
|
.selectServerFile(FILE_FOR_IMPORT)
|
|
@@ -60,17 +51,6 @@ describe('Import screen validation - server files', () => {
|
|
|
60
51
|
.verifyNoImportStatus(FILE_FOR_IMPORT);
|
|
61
52
|
});
|
|
62
53
|
|
|
63
|
-
it('Test import with resetting status of all imported files', () => {
|
|
64
|
-
ImportSteps
|
|
65
|
-
.selectAllServerFiles()
|
|
66
|
-
.importServerFiles()
|
|
67
|
-
.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE)
|
|
68
|
-
.verifyImportStatus(BLANK_NODE_FILE, SUCCESS_MESSAGE)
|
|
69
|
-
.resetStatusOfUploadedFiles()
|
|
70
|
-
.verifyNoImportStatus(BLANK_NODE_FILE)
|
|
71
|
-
.verifyNoImportStatus(FILE_FOR_IMPORT);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
54
|
it('Test import turtlestar from Server files successfully without changing settings', () => {
|
|
75
55
|
ImportSteps
|
|
76
56
|
.selectServerFile(TTLS_FOR_IMPORT)
|
|
@@ -10,7 +10,7 @@ describe('Monitor Resources', () => {
|
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
cy.presetRepository(repositoryId);
|
|
12
12
|
|
|
13
|
-
cy.visit('/monitor/
|
|
13
|
+
cy.visit('/monitor/system');
|
|
14
14
|
cy.window();
|
|
15
15
|
|
|
16
16
|
// Wait for loaders to disappear
|
|
@@ -127,8 +127,7 @@ describe('Monitor Resources', () => {
|
|
|
127
127
|
verifyCharts(charts);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
it('Should show info
|
|
131
|
-
getErrorsPane().should('not.be.visible');
|
|
130
|
+
it('Should show info for non existing cluster', () => {
|
|
132
131
|
getTabButtons().eq(2).click();
|
|
133
132
|
cy.get('.alert-info').should('be.visible').and('contain', 'Charts are not available because GraphDB is not in cluster configuration');
|
|
134
133
|
});
|
|
@@ -568,7 +568,7 @@ describe('Repositories', () => {
|
|
|
568
568
|
testOntopConfigurationElementsVisibility('Constraint file', '#constraintFile');
|
|
569
569
|
testOntopConfigurationElementsVisibility('Ontology file', '#owlFile');
|
|
570
570
|
//verify driver download url
|
|
571
|
-
compareDriverDownloadUrl('https://jdbc.postgresql.org/download
|
|
571
|
+
compareDriverDownloadUrl('https://jdbc.postgresql.org/download');
|
|
572
572
|
|
|
573
573
|
//Select Oracle driver type and verify elements and download url (if available)
|
|
574
574
|
selectDatabaseDriver('Oracle');
|
|
@@ -956,8 +956,7 @@ describe('Repositories', () => {
|
|
|
956
956
|
function compareDriverDownloadUrl(expectedUrl){
|
|
957
957
|
cy.get('.uri')
|
|
958
958
|
.should('be.visible')
|
|
959
|
-
.and('have.attr', 'href')
|
|
960
|
-
.and('contain', expectedUrl);
|
|
959
|
+
.and('have.attr', 'href', expectedUrl);
|
|
961
960
|
}
|
|
962
961
|
|
|
963
962
|
function getSHACLRepositoryCheckbox(){
|
|
@@ -202,7 +202,8 @@ describe('My Settings', () => {
|
|
|
202
202
|
cy.get('.rdf-info-side-panel .filter-sidepanel').should('be.visible');
|
|
203
203
|
cy.get('.include-schema-statements')
|
|
204
204
|
.scrollIntoView().should('be.visible').click()
|
|
205
|
-
.then(() => {
|
|
205
|
+
.then(($el) => {
|
|
206
|
+
cy.wrap($el).trigger('mouseleave', {force: true});
|
|
206
207
|
cy.get('.include-schema-statements').scrollIntoView()
|
|
207
208
|
.should('be.visible').and('not.be.checked');
|
|
208
209
|
saveGraphSettings()
|
|
@@ -70,7 +70,6 @@ describe('SPARQL Templates', () => {
|
|
|
70
70
|
getTemplateNameField().type(TEMPLATE_NAME);
|
|
71
71
|
//Verify default query
|
|
72
72
|
verifyQueryAreaEquals(DEFAULT_QUERY);
|
|
73
|
-
clearQuery();
|
|
74
73
|
//Paste new template query and verify content
|
|
75
74
|
cy.pasteQuery(SPARQL_TEMPLATE);
|
|
76
75
|
verifyQueryAreaEquals(SPARQL_TEMPLATE);
|
|
@@ -89,15 +88,6 @@ describe('SPARQL Templates', () => {
|
|
|
89
88
|
getEditTemplateButton(TEMPLATE_NAME);
|
|
90
89
|
cy.waitUntilQueryIsVisible();
|
|
91
90
|
verifyQueryAreaEquals(SPARQL_TEMPLATE);
|
|
92
|
-
clearQuery();
|
|
93
|
-
//Change query to the default template again
|
|
94
|
-
cy.pasteQuery(DEFAULT_QUERY);
|
|
95
|
-
verifyQueryAreaEquals(DEFAULT_QUERY);
|
|
96
|
-
getSaveButton().click();
|
|
97
|
-
//Verify change to default template is persisted
|
|
98
|
-
getEditTemplateButton(TEMPLATE_NAME);
|
|
99
|
-
cy.waitUntilQueryIsVisible();
|
|
100
|
-
verifyQueryAreaEquals(DEFAULT_QUERY);
|
|
101
91
|
//Cancel as no changes have been made
|
|
102
92
|
getCancelButton().click();
|
|
103
93
|
//Delete template and verify templates table is empty
|
|
@@ -132,15 +122,6 @@ describe('SPARQL Templates', () => {
|
|
|
132
122
|
return cy.get('#queryEditor .CodeMirror');
|
|
133
123
|
}
|
|
134
124
|
|
|
135
|
-
function clearQuery() {
|
|
136
|
-
// Using force because the textarea is not visible
|
|
137
|
-
getQueryTextArea().type(Cypress.env('modifierKey') + 'a{backspace}', {force: true});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function getQueryTextArea() {
|
|
141
|
-
return getQueryArea().find('textarea');
|
|
142
|
-
}
|
|
143
|
-
|
|
144
125
|
function getSaveButton() {
|
|
145
126
|
return cy.get('.save-query-btn');
|
|
146
127
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import ImportSteps from '../../steps/import-steps';
|
|
2
|
+
|
|
3
|
+
describe('Import screen validation - server files', () => {
|
|
4
|
+
|
|
5
|
+
let repositoryId;
|
|
6
|
+
|
|
7
|
+
const SUCCESS_MESSAGE = 'Imported successfully';
|
|
8
|
+
const FILE_FOR_IMPORT = 'italian_public_schools_links.nt.gz';
|
|
9
|
+
const BLANK_NODE_FILE = 'bnodes.ttl';
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
repositoryId = 'server-import-' + Date.now();
|
|
13
|
+
cy.createRepository({id: repositoryId});
|
|
14
|
+
ImportSteps.visitServerImport(repositoryId);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
cy.deleteRepository(repositoryId);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('Test import all Server files successfully without changing settings', () => {
|
|
22
|
+
ImportSteps
|
|
23
|
+
.selectAllServerFiles()
|
|
24
|
+
.importServerFiles()
|
|
25
|
+
.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE)
|
|
26
|
+
.verifyImportStatus(BLANK_NODE_FILE, SUCCESS_MESSAGE);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('Test import with resetting status of all imported files', () => {
|
|
30
|
+
ImportSteps
|
|
31
|
+
.selectAllServerFiles()
|
|
32
|
+
.importServerFiles()
|
|
33
|
+
.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE)
|
|
34
|
+
.verifyImportStatus(BLANK_NODE_FILE, SUCCESS_MESSAGE)
|
|
35
|
+
.resetStatusOfUploadedFiles()
|
|
36
|
+
.verifyNoImportStatus(BLANK_NODE_FILE)
|
|
37
|
+
.verifyNoImportStatus(FILE_FOR_IMPORT);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
describe('SPARQL Templates', () => {
|
|
2
|
+
|
|
3
|
+
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
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
cy.visit('/sparql-templates', {
|
|
38
|
+
onBeforeLoad: (win) => {
|
|
39
|
+
win.localStorage.setItem('com.ontotext.graphdb.repository', repositoryId);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
cy.window()
|
|
43
|
+
.then(() => getTemplatesTable().scrollIntoView().should('be.visible'));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
after(() => {
|
|
47
|
+
cy.deleteRepository(repositoryId);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('Should create/edit/delete a SPARQL template', () => {
|
|
51
|
+
// The test is flaky because it depends on an asynchronous DB insert which can not be easily observed from the UI
|
|
52
|
+
//Click create template button
|
|
53
|
+
getCreateSparqlTemplateButton().click();
|
|
54
|
+
cy.waitUntilQueryIsVisible();
|
|
55
|
+
//Type a valid Template IRI value in the filed
|
|
56
|
+
getTemplateNameField().type(TEMPLATE_NAME);
|
|
57
|
+
//Paste new template query and verify content
|
|
58
|
+
cy.pasteQuery(SPARQL_TEMPLATE);
|
|
59
|
+
verifyQueryAreaEquals(SPARQL_TEMPLATE);
|
|
60
|
+
getSaveButton()
|
|
61
|
+
.scrollIntoView()
|
|
62
|
+
.click()
|
|
63
|
+
.then(() => {
|
|
64
|
+
cy.waitUntil(() =>
|
|
65
|
+
cy.get('.edit-query-btn')
|
|
66
|
+
.then((editBtn) => editBtn));
|
|
67
|
+
});
|
|
68
|
+
//Verify new template is stored in the templates table
|
|
69
|
+
getTemplatesTable().should('be.visible').and('contain', TEMPLATE_NAME);
|
|
70
|
+
//Edit template
|
|
71
|
+
getEditTemplateButton(TEMPLATE_NAME);
|
|
72
|
+
cy.waitUntilQueryIsVisible();
|
|
73
|
+
verifyQueryAreaEquals(SPARQL_TEMPLATE);
|
|
74
|
+
//Change query to the default template again
|
|
75
|
+
cy.pasteQuery(DEFAULT_QUERY);
|
|
76
|
+
verifyQueryAreaEquals(DEFAULT_QUERY);
|
|
77
|
+
getSaveButton()
|
|
78
|
+
.click()
|
|
79
|
+
.then(() => {
|
|
80
|
+
cy.waitUntil(() => cy.get('.edit-query-btn').should('be.visible'));
|
|
81
|
+
});
|
|
82
|
+
//Verify change to default template is persisted
|
|
83
|
+
getEditTemplateButton(TEMPLATE_NAME);
|
|
84
|
+
cy.waitUntilQueryIsVisible();
|
|
85
|
+
verifyQueryAreaEquals(DEFAULT_QUERY);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
function getTemplatesTable() {
|
|
89
|
+
return cy.get('.sparql-templates-list');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function getCreateSparqlTemplateButton() {
|
|
93
|
+
return cy.get('.clearfix .create-sql-table-configuration');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function getTemplateNameField() {
|
|
97
|
+
return cy.get('.sparql-template-name');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function verifyQueryAreaEquals(query) {
|
|
101
|
+
// Using the CodeMirror instance because getting the value from the DOM is very cumbersome
|
|
102
|
+
getQueryArea().should((codeMirrorEl) => {
|
|
103
|
+
const cm = codeMirrorEl[0].CodeMirror;
|
|
104
|
+
expect(cm.getValue().trim()).to.equal(query.trim());
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function getQueryArea() {
|
|
109
|
+
return cy.get('#queryEditor .CodeMirror');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getSaveButton() {
|
|
113
|
+
return cy.get('.save-query-btn');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getEditTemplateButton(templateName) {
|
|
117
|
+
return cy.get('#configurations-table tr')
|
|
118
|
+
.contains(templateName)
|
|
119
|
+
.parent()
|
|
120
|
+
.parent()
|
|
121
|
+
.within(() => {
|
|
122
|
+
cy.get('.icon-edit').click();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
package/package.json
CHANGED
package/steps/import-steps.js
CHANGED
|
@@ -199,7 +199,7 @@ class ImportSteps {
|
|
|
199
199
|
static verifyImportStatusDetails(fileToSelect, details) {
|
|
200
200
|
ImportSteps.getServerFileElement(fileToSelect).find('.import-status .import-status-info').then(infoIconEl => {
|
|
201
201
|
cy.wrap(infoIconEl).should('be.visible');
|
|
202
|
-
cy.wrap(infoIconEl).trigger('
|
|
202
|
+
cy.wrap(infoIconEl).trigger('mouseenter');
|
|
203
203
|
|
|
204
204
|
cy.get('.popover-content').then(content => {
|
|
205
205
|
cy.wrap(content).should('be.visible');
|