graphdb-workbench-tests 3.3.0-TR6 → 3.3.0
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/e2e-legacy/guides/connectors/connectors-guide.spec.js +12 -1
- package/e2e-legacy/guides/create-similarity-index/create-similarity-index-guide.spec.js +74 -0
- package/e2e-legacy/guides/download-guide-resource/download-guide-resource-guide.js +55 -0
- package/e2e-legacy/guides/ttyg/conversation/ttyg-conversation-guide.spec.js +88 -0
- package/e2e-legacy/help/guides/guides-autostart.spec.js +93 -0
- package/e2e-legacy/setup/jdbc/jdbc-create.spec.js +2 -2
- package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +82 -71
- package/e2e-legacy/ttyg/chat-panel.spec.js +5 -1
- package/fixtures/guides/connectors/lucene-connector-guide.json +14 -0
- package/fixtures/guides/create-similarity-index/create-similarity-index-guide.json +36 -0
- package/fixtures/guides/download-guide-resource/download-guide-resource-guide.json +25 -0
- package/fixtures/guides/download-resource.ttl +629 -0
- package/fixtures/guides/ttyg/conversation/ttyg-conversation-guide.json +26 -0
- package/fixtures/ttyg/chats/explain-response-3.json +12 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/explore/similarity-index-create-steps.js +5 -3
- package/steps/explore/similarity-indexes-steps.js +4 -0
- package/steps/guides/guide-dialog-steps.js +5 -0
- package/steps/guides/guide-steps.js +17 -0
- package/steps/main-menu-steps.js +4 -0
- package/steps/ttyg/chat-panel-steps.js +19 -1
- package/steps/ttyg/ttyg-agent-settings-modal.steps.js +8 -0
- package/steps/yasgui/yasgui-loader.js +3 -3
- package/stubs/guides/guides-stubs.js +19 -1
- package/support/connector-commands.js +1 -1
- package/support/user-commands.js +9 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"guideName": {
|
|
4
|
+
"en": "TTYG-conversation-test-guide"
|
|
5
|
+
},
|
|
6
|
+
"steps": [
|
|
7
|
+
{
|
|
8
|
+
"guideBlockName": "select-ttyg-agent"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"guideBlockName": "conversation-with-ttyg-agent",
|
|
12
|
+
"options": {
|
|
13
|
+
"startNewConversation": true,
|
|
14
|
+
"questions": [
|
|
15
|
+
{
|
|
16
|
+
"question": "Count all the web pages published in 2020? Provide five sample names.",
|
|
17
|
+
"explain": true,
|
|
18
|
+
"explainMore": true,
|
|
19
|
+
"exploreSparql": true
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"conversationId": "thread_new_created_chat",
|
|
3
|
+
"answerId": "msg_drDW9OTkPkY0oGoXSdPD5qEx",
|
|
4
|
+
"queryMethods": [
|
|
5
|
+
{
|
|
6
|
+
"name": "sparql_query",
|
|
7
|
+
"rawQuery": "SELECT ?character ?name ?height WHERE {\n ?character a voc:Character;\n rdfs:label ?name;\n voc:height ?height.\n FILTER(?name = \"Luke Skywalker\" || ?name = \"Leia Organa\")\n}",
|
|
8
|
+
"query": "SELECT ?character ?name ?height WHERE {\n ?character a voc:Character;\n rdfs:label ?name;\n voc:height ?height.\n FILTER(?name = \"Luke Skywalker\" || ?name = \"Leia Organa\")\n}",
|
|
9
|
+
"queryType": "sparql"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "3.3.0
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "3.3.0
|
|
9
|
+
"version": "3.3.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import {BaseSteps} from '../base-steps.js';
|
|
2
|
+
|
|
3
|
+
export class SimilarityIndexCreateSteps extends BaseSteps {
|
|
2
4
|
|
|
3
5
|
static visit() {
|
|
4
6
|
cy.visit('/similarity/index/create');
|
|
@@ -17,7 +19,7 @@ export class SimilarityIndexCreateSteps {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
static getCreateButton() {
|
|
20
|
-
return
|
|
22
|
+
return this.getByTestId('create-similarity-index-btn');
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
static create() {
|
|
@@ -33,7 +35,7 @@ export class SimilarityIndexCreateSteps {
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
static getSimilarityIndexNameInput() {
|
|
36
|
-
return
|
|
38
|
+
return this.getByTestId('similarity-index-name');
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
static typeSimilarityIndexName(similarityIndexName) {
|
|
@@ -40,6 +40,11 @@ export class GuideDialogSteps {
|
|
|
40
40
|
GuideDialogSteps.getCloseButton().scrollIntoView().click();
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
static getContentLink() {
|
|
44
|
+
return GuideDialogSteps.getContent().find('a');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
43
48
|
static assertDialogWithTitleIsVisible(text) {
|
|
44
49
|
GuideDialogSteps.getHeader().contains(text);
|
|
45
50
|
}
|
|
@@ -11,6 +11,10 @@ export class GuideSteps extends BaseSteps {
|
|
|
11
11
|
cy.visit('/guides');
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
static autostartGuide(guideId) {
|
|
15
|
+
cy.visit(`/?autostartGuide=${guideId}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
static runGuide(guideName) {
|
|
15
19
|
cy.contains('td', guideName)
|
|
16
20
|
.parent()
|
|
@@ -35,6 +39,10 @@ export class GuideSteps extends BaseSteps {
|
|
|
35
39
|
cy.get(selector).should('be.visible');
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
static getGuidesModal() {
|
|
43
|
+
return cy.get('.shepherd-modal-is-visible');
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
static assertPageNotInteractive() {
|
|
39
47
|
cy.get('.shepherd-modal-is-visible');
|
|
40
48
|
}
|
|
@@ -296,4 +304,13 @@ export class GuideSteps extends BaseSteps {
|
|
|
296
304
|
static verifyGuidesListExists() {
|
|
297
305
|
this.getGuidesList().should('be.visible');
|
|
298
306
|
}
|
|
307
|
+
|
|
308
|
+
static getDownloadResourceLink(guideRepositoryId) {
|
|
309
|
+
const downloadButtonClass = guideRepositoryId ? `.guide-${guideRepositoryId}-download-resource-link` : '.guide-download-resource-link';
|
|
310
|
+
return cy.get(downloadButtonClass);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
static downloadResource(guideRepositoryId) {
|
|
314
|
+
GuideSteps.getDownloadResourceLink(guideRepositoryId).click();
|
|
315
|
+
}
|
|
299
316
|
}
|
package/steps/main-menu-steps.js
CHANGED
|
@@ -112,6 +112,10 @@ export class MainMenuSteps {
|
|
|
112
112
|
this.getSubMenuButton('sub-menu-similarity').click();
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
static clickOnSubmenuSimilarity() {
|
|
116
|
+
this.getSubMenuButton('sub-menu-similarity').click();
|
|
117
|
+
}
|
|
118
|
+
|
|
115
119
|
// --------------------------
|
|
116
120
|
// -- Monitoring menu --
|
|
117
121
|
// --------------------------
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import {BaseSteps} from "../base-steps.js";
|
|
2
|
+
|
|
3
|
+
export class ChatPanelSteps extends BaseSteps {
|
|
2
4
|
|
|
3
5
|
static getChatPanel() {
|
|
4
6
|
return cy.get('.chat-panel');
|
|
@@ -24,6 +26,18 @@ export class ChatPanelSteps {
|
|
|
24
26
|
return ChatPanelSteps.getChatPanel().find('.question-input .contenteditable');
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
static typeQuestion(question) {
|
|
30
|
+
ChatPanelSteps.getQuestionInputElement().type(question, {force: true});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static getQuestionLoader() {
|
|
34
|
+
return ChatPanelSteps.getByTestId('question-loader');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static waitForLoaderToDisappear() {
|
|
38
|
+
ChatPanelSteps.getQuestionLoader().should('not.exist');
|
|
39
|
+
}
|
|
40
|
+
|
|
27
41
|
static getAskButtonElement() {
|
|
28
42
|
return ChatPanelSteps.getChatPanel().find('.ask-button');
|
|
29
43
|
}
|
|
@@ -32,6 +46,10 @@ export class ChatPanelSteps {
|
|
|
32
46
|
ChatPanelSteps.getAskButtonElement().scrollIntoView().click();
|
|
33
47
|
}
|
|
34
48
|
|
|
49
|
+
static askQuestionWithEnter() {
|
|
50
|
+
ChatPanelSteps.getQuestionInputElement().type('{enter}');
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
static getChatDetailQuestionElement(index = 0) {
|
|
36
54
|
return ChatPanelSteps.getChatDetailElement(index).find('.question');
|
|
37
55
|
}
|
|
@@ -176,6 +176,14 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
|
|
|
176
176
|
return this.getSparqlMethodSparqlQueryField().type(value, {parseSpecialCharSequences: false});
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
static clickOpenQueryInSparqlEditor(index = 0) {
|
|
180
|
+
return this.getOpenQueryInSparqlEditorButton(index).click();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
static getOpenQueryInSparqlEditorButton(index = 0) {
|
|
184
|
+
return this.getByTestId('open-in-sparql-editor-btn').eq(index);
|
|
185
|
+
}
|
|
186
|
+
|
|
179
187
|
static getAddMissingNamespacesCheckbox() {
|
|
180
188
|
return cy.get('#addMissingNamespaces');
|
|
181
189
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export class YasguiLoader {
|
|
2
2
|
|
|
3
|
-
static getLoader(
|
|
3
|
+
static getLoader() {
|
|
4
4
|
return cy.get('loader-component');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
static verifyMessage(message
|
|
8
|
-
YasguiLoader.getLoader(
|
|
7
|
+
static verifyMessage(message) {
|
|
8
|
+
YasguiLoader.getLoader().contains(message);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -8,7 +8,11 @@ export class GuidesStubs {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
static stubCreateAndConfigureAgentGuide() {
|
|
11
|
-
GuidesStubs.stubWithFixture('../fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json')
|
|
11
|
+
GuidesStubs.stubWithFixture('../fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static stubTTYGConversationGuide() {
|
|
15
|
+
GuidesStubs.stubWithFixture('../fixtures/guides/ttyg/conversation/ttyg-conversation-guide.json');
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
static stubClassHierarchyGuide() {
|
|
@@ -27,6 +31,20 @@ export class GuidesStubs {
|
|
|
27
31
|
GuidesStubs.stubWithFixture('../fixtures/guides/connectors/lucene-connector-guide.json');
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
static stubCreateSimilarityIndexGuide() {
|
|
35
|
+
GuidesStubs.stubWithFixture('../fixtures/guides/create-similarity-index/create-similarity-index-guide.json');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static stubDownloadGuideResourceGuide() {
|
|
39
|
+
GuidesStubs.stubWithFixture('../fixtures/guides/download-guide-resource/download-guide-resource-guide.json');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static stubDownloadResource(resourcePath, resourceFile) {
|
|
43
|
+
cy.intercept('GET', `/rest/guides/download/${resourcePath}/${resourceFile}`, {
|
|
44
|
+
fixture: `guides/download-resource.ttl`,
|
|
45
|
+
}).as('resource-download');;
|
|
46
|
+
}
|
|
47
|
+
|
|
30
48
|
static stubWithFixture(fixturePath) {
|
|
31
49
|
cy.intercept('/rest/guides', {fixture: fixturePath}).as('getGuides');
|
|
32
50
|
}
|
|
@@ -8,6 +8,6 @@ Cypress.Commands.add('createConnector', (repositoryId, connectorType, connectorN
|
|
|
8
8
|
},
|
|
9
9
|
method: 'POST',
|
|
10
10
|
url: REPOSITORIES_URL + repositoryId + STATEMENTS_URL,
|
|
11
|
-
body: `update=PREFIX%20%3A%3Chttp%3A%2F%2Fwww.ontotext.com%2Fconnectors%2F${connectorType}%23%3E%0APREFIX%20inst%3A%3Chttp%3A%2F%2Fwww.ontotext.com%2Fconnectors%2F${connectorType}%2Finstance%23%3E%0AINSERT%20DATA%20%7B%0A%09inst%3A${connectorName}%20%3AcreateConnector%20'''%0A%7B%0A%20%20%22fields%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22fieldName%22%3A%20%22sss%22%2C%0A%20%20%20%20%20%20%22propertyChain%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%22rdf%3Alabel%22%0A%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%22indexed%22%3A%20true%2C%0A%20%20%20%20%20%20%22stored%22%3A%20true%2C%0A%20%20%20%20%20%20%22analyzed%22%3A%20true%2C%0A%20%20%20%20%20%20%22multivalued%22%3A%20true%2C%0A%20%20%20%20%20%20%22ignoreInvalidValues%22%3A%20false%2C%0A%20%20%20%20%20%20%22facet%22%3A%20true%0A%20%20%20%20%7D%0A%20%20%5D%2C%0A%20%20%22languages%22%3A%20%5B%5D%2C%0A%20%20%22types%22%3A%20%5B%0A%20%20%20%20%22rdf%3Alabel%22%0A%20%20%5D%2C%0A%20%20%22readonly%22%3A%20false%2C%0A%20%20%22detectFields%22%3A%20false%2C%0A%20%20%22importGraph%22%3A%20false%2C%0A%20%20%22skipInitialIndexing%22%3A%20false%2C%0A%20%20%22boostProperties%22%3A%20%5B%5D%2C%0A%20%20%22stripMarkup%22%3A%20false%0A%7D%0A'''%20.%0A%7D%0A`
|
|
11
|
+
body: `update=PREFIX%20%3A%3Chttp%3A%2F%2Fwww.ontotext.com%2Fconnectors%2F${connectorType}%23%3E%0APREFIX%20inst%3A%3Chttp%3A%2F%2Fwww.ontotext.com%2Fconnectors%2F${connectorType}%2Finstance%23%3E%0AINSERT%20DATA%20%7B%0A%09inst%3A${connectorName}%20%3AcreateConnector%20'''%0A%7B%0A%20%20%22fields%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22fieldName%22%3A%20%22sss%22%2C%0A%20%20%20%20%20%20%22propertyChain%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%22rdf%3Alabel%22%0A%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%22indexed%22%3A%20true%2C%0A%20%20%20%20%20%20%22stored%22%3A%20true%2C%0A%20%20%20%20%20%20%22analyzed%22%3A%20true%2C%0A%20%20%20%20%20%20%22multivalued%22%3A%20true%2C%0A%20%20%20%20%20%20%22ignoreInvalidValues%22%3A%20false%2C%0A%20%20%20%20%20%20%22facet%22%3A%20true%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22fieldName%22%3A%20%22description%22%2C%0A%20%20%20%20%20%20%22propertyChain%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%22rdfs%3Acomment%22%0A%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%22indexed%22%3A%20true%2C%0A%20%20%20%20%20%20%22stored%22%3A%20true%2C%0A%20%20%20%20%20%20%22analyzed%22%3A%20true%2C%0A%20%20%20%20%20%20%22multivalued%22%3A%20false%2C%0A%20%20%20%20%20%20%22ignoreInvalidValues%22%3A%20false%2C%0A%20%20%20%20%20%20%22facet%22%3A%20false%0A%20%20%20%20%7D%0A%20%20%5D%2C%0A%20%20%22languages%22%3A%20%5B%5D%2C%0A%20%20%22types%22%3A%20%5B%0A%20%20%20%20%22rdf%3Alabel%22%0A%20%20%5D%2C%0A%20%20%22readonly%22%3A%20false%2C%0A%20%20%22detectFields%22%3A%20false%2C%0A%20%20%22importGraph%22%3A%20false%2C%0A%20%20%22skipInitialIndexing%22%3A%20false%2C%0A%20%20%22boostProperties%22%3A%20%5B%5D%2C%0A%20%20%22stripMarkup%22%3A%20false%0A%7D%0A'''%20.%0A%7D%0A`
|
|
12
12
|
}).should((response) => expect(response.status).to.equal(204));
|
|
13
13
|
});
|
package/support/user-commands.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
Cypress.Commands.add('createUser', (options = {}) => {
|
|
1
|
+
Cypress.Commands.add('createUser', (options = {}, secured = false) => {
|
|
2
|
+
let headers = {'Content-Type': 'application/json'};
|
|
3
|
+
if (secured) {
|
|
4
|
+
const authHeader = Cypress.env('adminToken');
|
|
5
|
+
headers = {...headers,
|
|
6
|
+
'Authorization': authHeader
|
|
7
|
+
}
|
|
8
|
+
}
|
|
2
9
|
cy.request({
|
|
3
10
|
method: 'POST',
|
|
4
11
|
url: `/rest/security/users/${options.username}`,
|
|
12
|
+
headers,
|
|
5
13
|
body: {
|
|
6
14
|
"password": options.password || "root",
|
|
7
15
|
"appSettings": {
|
|
@@ -12,9 +20,6 @@ Cypress.Commands.add('createUser', (options = {}) => {
|
|
|
12
20
|
"DEFAULT_VIS_GRAPH_SCHEMA": true
|
|
13
21
|
},
|
|
14
22
|
"grantedAuthorities": options.grantedAuthorities || ["ROLE_USER", "WRITE_REPO_*", "READ_REPO_*"]
|
|
15
|
-
},
|
|
16
|
-
headers: {
|
|
17
|
-
'Content-Type': 'application/json'
|
|
18
23
|
}
|
|
19
24
|
}).then((response) => {
|
|
20
25
|
cy.waitUntil(() => response && response.status === 201); // 201 Created
|