graphdb-workbench-tests 3.0.1 → 3.0.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.
@@ -194,7 +194,8 @@
194
194
  "actions": {
195
195
  "replace_node": "Replace node",
196
196
  "delete_node": "Delete node",
197
- "cannot_delete_node": "You cannot remove more than half of the healthy nodes at the same time",
197
+ "cannot_delete_node": "The current node cannot be removed",
198
+ "cannot_replace_node": "You cannot replace this node",
198
199
  "add_node": "Add node",
199
200
  "add_node_tooltip": "Add node to current cluster",
200
201
  "cancel": "Cancel",
@@ -208,6 +209,11 @@
208
209
  },
209
210
  "field_placeholders": {
210
211
  "location": "http://my-hostname:7200"
212
+ },
213
+ "copy_to_clipboard": {
214
+ "copied": {
215
+ "tooltip": "IRI copied"
216
+ }
211
217
  }
212
218
  }
213
219
  },
@@ -2467,6 +2473,9 @@
2467
2473
  "dates": {
2468
2474
  "today": "Today",
2469
2475
  "yesterday": "Yesterday"
2476
+ },
2477
+ "messages": {
2478
+ "copied_to_clipboard": "Copied to clipboard"
2470
2479
  }
2471
2480
  },
2472
2481
  "common.confirm.delete": "Confirm delete",
@@ -2505,6 +2514,7 @@
2505
2514
  "common.show_all": "Show all",
2506
2515
  "common.hide": "Hide",
2507
2516
  "common.learn_more_in_documentation": "Learn more in the GraphDB documentation",
2517
+ "click.to": "Click to",
2508
2518
  "paginator.first.page.label": "First",
2509
2519
  "paginator.last.page.label": "Last",
2510
2520
  "deactivate": "deactivate",
@@ -102,7 +102,7 @@ describe('Graphql: edit endpoint settings', () => {
102
102
  "langValidate": null,
103
103
  "langImplicit": null,
104
104
  "langDefaultNameFetch": "NONE",
105
- "langAppendDefaultNameFetch": "true",
105
+ "langAppendDefaultNameFetch": true,
106
106
  "includeInferred": true,
107
107
  "expandOwlSameAs": true,
108
108
  "enableMutations": null,
@@ -66,4 +66,28 @@ describe('Autocomplete ', () => {
66
66
  .should('be.visible')
67
67
  .and('not.be.disabled');
68
68
  });
69
+
70
+ it('should allow add and edit of autocomplete label', () => {
71
+ // Given I'm on the Autocomplete page
72
+ AutocompleteSteps.visit();
73
+ cy.wait('@get-license');
74
+ AutocompleteSteps.waitUntilAutocompletePageIsLoaded();
75
+ // The table should not contain this label
76
+ AutocompleteSteps.getAutocompleteLabels().should('not.contain.text', 'http://xmlns.com/foaf/0.1/name');
77
+
78
+ // When I add a label
79
+ AutocompleteSteps.addLabelAndLanguage('http://xmlns.com/foaf/0.1/name', 'fr');
80
+ // Then the list should have my new label
81
+ AutocompleteSteps.getAutocompleteLabels().should('contain.text', 'http://xmlns.com/foaf/0.1/name');
82
+
83
+ // When I edit the new label
84
+ AutocompleteSteps.editLabelOnRow(0);
85
+ AutocompleteSteps.typeLabelIri('http://purl.org/dc/elements/1.1/title');
86
+ AutocompleteSteps.saveLabel();
87
+ // Then the list should no longer have the old label
88
+ AutocompleteSteps.getAutocompleteLabels().should('not.contain.text', 'http://xmlns.com/foaf/0.1/name');
89
+ // And instead have the edited label
90
+ AutocompleteSteps.getAutocompleteLabels().should('contain.text', 'http://purl.org/dc/elements/1.1/title');
91
+ AutocompleteSteps.getAutocompleteLabels().should('contain.text', 'fr');
92
+ });
69
93
  });
@@ -8,9 +8,11 @@ import {SaveQueryDialog} from "../../../steps/yasgui/save-query-dialog";
8
8
  describe('Edit saved queries', () => {
9
9
 
10
10
  let repositoryId;
11
+ let savedQueryName;
11
12
 
12
13
  beforeEach(() => {
13
14
  repositoryId = 'sparql-editor-' + Date.now();
15
+ savedQueryName = SavedQuery.generateQueryName();
14
16
  QueryStubs.stubQueryCountResponse();
15
17
  cy.createRepository({id: repositoryId});
16
18
  cy.presetRepository(repositoryId);
@@ -21,12 +23,12 @@ describe('Edit saved queries', () => {
21
23
  });
22
24
 
23
25
  afterEach(() => {
26
+ cy.deleteSavedQuery(savedQueryName);
24
27
  cy.deleteRepository(repositoryId);
25
28
  });
26
29
 
27
30
  it('Should prevent saving query with duplicated name', () => {
28
31
  // Given I have created a query
29
- const savedQueryName = SavedQuery.generateQueryName();
30
32
  SavedQuery.create(savedQueryName);
31
33
  // When I open the saved queries popup
32
34
  YasguiSteps.showSavedQueries();
@@ -48,21 +50,35 @@ describe('Edit saved queries', () => {
48
50
  YasguiSteps.showSavedQueries();
49
51
  SavedQueriesDialog.editQueryByName(savedQueryName);
50
52
  SaveQueryDialog.getQueryField().should('have.value', 'select $s $p $o');
53
+ // Then I close the dialog
54
+ SaveQueryDialog.closeSaveQueryDialog();
55
+ });
56
+
57
+ // TODO skipped until .env can be updated with BE version, which includes the API changes
58
+ it.skip('should allow renaming saved query', () => {
59
+ // Given I have created a query
60
+ SavedQuery.create(savedQueryName);
61
+ // When I open the saved queries popup
62
+ YasguiSteps.showSavedQueries();
63
+ // And I edit the saved query
64
+ SavedQueriesDialog.editQueryByName(savedQueryName);
65
+ // Then the save query dialog should be opened
66
+ SaveQueryDialog.getQueryNameField().should('have.value', savedQueryName);
67
+ SaveQueryDialog.getQueryField().should('have.value', 'select *');
68
+ SaveQueryDialog.getIsPublicField().should('be.checked');
51
69
  // When I change the query name
52
- // TODO: This currently won't work. The legacy implementation in the WB does the following:
53
- // * First POST to create a new query with the new name
54
- // * Then DELETE the query with the old name
55
- // This is quite hackish and would require maintaining some state in the WB which is awkward.
56
- // Better approach would be to think of a way to delegate this to the backend api for the edit.
57
- // YasguiSteps.clearQueryNameField();
58
- // savedQueryName = generateQueryName();
59
- // YasguiSteps.writeQueryName(savedQueryName);
60
- // YasguiSteps.saveQuery();
61
- // // Then a new query should be created
62
- // YasguiSteps.getSaveQueryDialog().should('not.exist');
63
- // YasguiSteps.showSavedQueries();
64
- // YasguiSteps.editQueryByName(savedQueryName);
65
- // YasguiSteps.getQueryNameField().should('have.value', savedQueryName);
66
- // YasguiSteps.getQueryField().should('have.value', 'select $s $p $o');
70
+ SaveQueryDialog.clearQueryNameField();
71
+ savedQueryName = SavedQuery.generateQueryName();
72
+ SaveQueryDialog.writeQueryName(savedQueryName);
73
+ // And try to save the query
74
+ SaveQueryDialog.saveQuery();
75
+ // Then the query should be updated
76
+ SaveQueryDialog.getSaveQueryDialog().should('not.exist');
77
+ YasguiSteps.showSavedQueries();
78
+ SavedQueriesDialog.editQueryByName(savedQueryName);
79
+ SaveQueryDialog.getQueryNameField().should('have.value', savedQueryName);
80
+ SaveQueryDialog.getQueryField().should('have.value', 'select *');
81
+ // Then I close the dialog
82
+ SaveQueryDialog.closeSaveQueryDialog();
67
83
  });
68
84
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.0.1",
3
+ "version": "3.0.2-RC1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "3.0.1",
9
+ "version": "3.0.2-RC1",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "cypress": "^14.0.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.0.1",
3
+ "version": "3.0.2-RC1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "prepack": "npm shrinkwrap",
@@ -57,11 +57,42 @@ export class AutocompleteSteps {
57
57
  return this.getAutocompletePage().find('#wb-autocomplete-addLabel');
58
58
  }
59
59
 
60
+ static addLabelAndLanguage(label, language) {
61
+ this.getAddLabelButton().click();
62
+ this.typeLabelIri(label);
63
+ this.typeLabelLanguages(language);
64
+ this.saveLabel();
65
+ }
66
+
67
+ static typeLabelIri(iri) {
68
+ this.getAddLabelForm().find('#wb-autocomplete-iri').click().clear().type(iri);
69
+ }
70
+
71
+ static typeLabelLanguages(languages) {
72
+ this.getAddLabelForm().find('#wb-autocomplete-languages').click().type(languages);
73
+ }
74
+
60
75
  static getAutocompleteLabels() {
61
76
  return this.getAutocompletePage().find('#wb-autocomplete-labels');
62
77
  }
63
78
 
79
+ static getTableRows() {
80
+ return cy.get('.wb-autocomplete-labels-row');
81
+ }
82
+
64
83
  static getSuccessStatusElement() {
65
84
  return cy.get('.autocomplete-status').find('.tag.tag-success.ng-binding');
66
85
  }
86
+
87
+ static getAddLabelForm() {
88
+ return cy.get('#addLabelForm');
89
+ }
90
+
91
+ static saveLabel() {
92
+ cy.get('#wb-autocomplete-savegraph-submit').click();
93
+ }
94
+
95
+ static editLabelOnRow(rowIndex) {
96
+ this.getTableRows().eq(rowIndex).find('.actions-bar .icon-edit').click();
97
+ }
67
98
  }
@@ -1,3 +1,5 @@
1
+ const DELETE_SAVED_QUERY_URL = '/rest/sparql/saved-queries';
2
+
1
3
  Cypress.Commands.add('pasteQuery', (query) => {
2
4
  // Setting the textarea and the calling setValue seems to work
3
5
  // more reliably then other strategies (see history)
@@ -12,6 +14,24 @@ Cypress.Commands.add('executeQuery', () => {
12
14
  getLoader().should('not.exist');
13
15
  });
14
16
 
17
+ Cypress.Commands.add('deleteSavedQuery', (savedQueryName, secured = false) => {
18
+ const url = DELETE_SAVED_QUERY_URL + '?name=' + savedQueryName;
19
+ let headers = {'Content-Type': 'application/json'};
20
+ if (secured) {
21
+ const authHeader = Cypress.env('adminToken');
22
+ headers = {...headers,
23
+ 'Authorization': authHeader
24
+ }
25
+ }
26
+ return cy.request({
27
+ method: 'DELETE',
28
+ url: url,
29
+ headers,
30
+ // Prevent Cypress from failing the test on non-2xx status codes
31
+ failOnStatusCode: false
32
+ });
33
+ });
34
+
15
35
  Cypress.Commands.add('verifyResultsPageLength', (resultLength) => {
16
36
  getResultsWrapper().should('be.visible');
17
37
  getTableResultRows()