graphdb-workbench-tests 2.3.0-RC1 → 2.3.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.
package/fixtures/locale-en.json
CHANGED
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
"menu.system.information.label": "System information",
|
|
616
616
|
"menu.rest.api.label": "REST API",
|
|
617
617
|
"menu.documentation.label": "Documentation",
|
|
618
|
-
"menu.
|
|
618
|
+
"menu.tutorials.label": "Tutorials",
|
|
619
619
|
"menu.support.label": "Support",
|
|
620
620
|
"menu.guides.label": "Interactive guides",
|
|
621
621
|
"menu.plugins.label": "Plugins",
|
|
@@ -141,9 +141,9 @@ describe('Main menu tests', function () {
|
|
|
141
141
|
externalRedirect: 'https://graphdb.ontotext.com/documentation/'
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
name: '
|
|
144
|
+
name: 'Tutorials',
|
|
145
145
|
visible: false,
|
|
146
|
-
externalRedirect: '/
|
|
146
|
+
externalRedirect: '/tutorials.html'
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
name: 'Support',
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import SparqlSteps from "../../steps/sparql-steps";
|
|
2
|
+
import {QueryStubs} from "../../stubs/query-stubs";
|
|
2
3
|
|
|
3
4
|
const LONG_ERROR_MESSAGE = "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.";
|
|
4
5
|
const MAX_VISIBLE_ERROR_CHARACTERS = 160;
|
|
5
6
|
const SHORTEN_PART_OFF_ERROR_MESSAGE = LONG_ERROR_MESSAGE.substring(0, MAX_VISIBLE_ERROR_CHARACTERS);
|
|
6
7
|
const SHORT_ERROR_MESSAGE = LONG_ERROR_MESSAGE.substring(0, MAX_VISIBLE_ERROR_CHARACTERS - 1);
|
|
7
|
-
describe
|
|
8
|
+
describe('Error handling', () => {
|
|
8
9
|
let repositoryId;
|
|
9
10
|
|
|
10
11
|
beforeEach(() => {
|
|
@@ -19,7 +20,7 @@ describe.skip('Error handling', () => {
|
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
it('should show all error message if message length is short', () => {
|
|
22
|
-
|
|
23
|
+
QueryStubs.stubQueryErrorResponse(repositoryId, 400, SHORT_ERROR_MESSAGE);
|
|
23
24
|
// When I open sparql editor page
|
|
24
25
|
// Then I should see no query has been executed
|
|
25
26
|
SparqlSteps.getNoQueryRunInfo().should('be.visible');
|
|
@@ -36,7 +37,7 @@ describe.skip('Error handling', () => {
|
|
|
36
37
|
});
|
|
37
38
|
|
|
38
39
|
it('should show shorten error message if message length is long', () => {
|
|
39
|
-
|
|
40
|
+
QueryStubs.stubQueryErrorResponse(repositoryId, 400, LONG_ERROR_MESSAGE);
|
|
40
41
|
// When I open sparql editor page
|
|
41
42
|
// Then I should see no query has been executed
|
|
42
43
|
SparqlSteps.getNoQueryRunInfo().should('be.visible');
|
|
@@ -70,11 +71,4 @@ describe.skip('Error handling', () => {
|
|
|
70
71
|
// and don't see the button "Show less exception message",
|
|
71
72
|
SparqlSteps.getShowLessExceptionMessage().should('not.exist');
|
|
72
73
|
});
|
|
73
|
-
|
|
74
|
-
const stubErrorResponse = (statusCode, errorMessage) => {
|
|
75
|
-
cy.intercept('POST', '/repositories/' + repositoryId, {
|
|
76
|
-
statusCode,
|
|
77
|
-
body: errorMessage
|
|
78
|
-
}).as('queryResultStub');
|
|
79
|
-
};
|
|
80
74
|
});
|
package/package.json
CHANGED
package/stubs/query-stubs.js
CHANGED
|
@@ -6,4 +6,11 @@ export class QueryStubs {
|
|
|
6
6
|
static stubQueryResponse(url, fixture, alias, withDelay = 0) {
|
|
7
7
|
cy.intercept(url, {fixture, delay: withDelay}).as(alias);
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
static stubQueryErrorResponse(repositoryId, statusCode, errorMessage) {
|
|
11
|
+
cy.intercept('POST', `/repositories/${repositoryId}`, {
|
|
12
|
+
statusCode,
|
|
13
|
+
body: errorMessage
|
|
14
|
+
}).as('queryErrorResultStub');
|
|
15
|
+
}
|
|
9
16
|
}
|