graphdb-workbench-tests 2.7.2-TR2 → 2.7.2

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.
@@ -1671,6 +1671,7 @@
1671
1671
  "search.plugins.placeholder": "Search plugins",
1672
1672
  "showing.label": "Showing",
1673
1673
  "results.label": "results",
1674
+ "pagination.of.label": "of",
1674
1675
  "no.plugins.match.filter.warning": "No plugins match this filter.",
1675
1676
  "error.warning": "404 That’s an error!",
1676
1677
  "requested.url.not.found.msg": "The requested URL was not found on this server. That’s all I know.",
@@ -98,6 +98,8 @@ describe('Import view', () => {
98
98
 
99
99
  // When I go to user tab and upload a file
100
100
  ImportSteps.openUserDataTab();
101
+ // And I wait for tab data to load
102
+ cy.wait(100);
101
103
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
102
104
  ImportSettingsDialogSteps.import();
103
105
  ImportUserDataSteps.getResources().should('have.length', 1);
@@ -52,4 +52,30 @@ describe('Sparql editor', () => {
52
52
  // And yasr tabs should not be visible
53
53
  YasrSteps.getResultHeader().should('not.be.visible');
54
54
  });
55
+
56
+ it('Should paste and add prefixes', () => {
57
+ // Given I have opened the workbench
58
+ // When I visit the sparql editor page
59
+ SparqlEditorSteps.visitSparqlEditorPage();
60
+ YasqeSteps.clearEditor();
61
+ const prefix = 'PREFIX afn: <http://jena.apache.org/ARQ/function#>\n';
62
+ const query = 'select distinct ?x ?Person where {\n' +
63
+ '?x a afn:Person .\n' +
64
+ '?x afn:preferredLabel ?Person .\n' +
65
+ '?doc afn:containsMention / pub-old:hasInstance ?x .\n' +
66
+ '}';
67
+ // I paste a query into the editor
68
+ cy.pasteIntoCodeMirror('.CodeMirror', query);
69
+ // Then I expect the prefixes to be added automatically
70
+ cy.get('.CodeMirror').then((codeMirrorElement) => {
71
+ const codeMirror = codeMirrorElement[0].CodeMirror;
72
+ // Wait, so that Yasqe can have time to replace the existing query with the new one
73
+ cy.waitUntil(() => {
74
+ return codeMirror.getValue() === prefix + query;
75
+ }).then(() => {
76
+ const value = codeMirror.getValue();
77
+ expect(value).to.equal(prefix + query);
78
+ });
79
+ });
80
+ });
55
81
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.7.2-TR2",
3
+ "version": "2.7.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "2.7.2-TR2",
9
+ "version": "2.7.2",
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.7.2-TR2",
3
+ "version": "2.7.2",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "prepack": "npm shrinkwrap",
@@ -48,7 +48,7 @@ export class ClusterPageSteps {
48
48
  }
49
49
 
50
50
  static openLegend() {
51
- return cy.get('.toggle-legend-btn button');
51
+ return cy.get('.toggle-legend-btn button').click();
52
52
  }
53
53
 
54
54
  static getLegend() {
@@ -37,6 +37,22 @@ Cypress.Commands.add('waitUntilQueryIsVisible', () => {
37
37
  Cypress.Commands.add('verifyQueryAreaContains', (query) => {
38
38
  verifyQueryAreaContains(query);
39
39
  });
40
+
41
+ Cypress.Commands.add('pasteIntoCodeMirror', (selector, text) => {
42
+ cy.get(selector).then((codeMirrorElement) => {
43
+ const codeMirror = codeMirrorElement[0].CodeMirror;
44
+ const event = new ClipboardEvent('paste', {
45
+ bubbles: true,
46
+ cancelable: true,
47
+ clipboardData: new DataTransfer()
48
+ });
49
+ event.clipboardData.setData('text/plain', text);
50
+
51
+ const inputField = codeMirror.getInputField();
52
+ inputField.dispatchEvent(event);
53
+ });
54
+ });
55
+
40
56
  // Helper functions
41
57
 
42
58
  function clearQuery() {