graphdb-workbench-tests 2.8.8-TR2 → 2.8.9-TR1

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.
@@ -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
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.8.8-TR2",
3
+ "version": "2.8.9-TR1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "2.8.8-TR2",
9
+ "version": "2.8.9-TR1",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "cypress": "^13.3.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.8.8-TR2",
3
+ "version": "2.8.9-TR1",
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
  }