graphdb-workbench-tests 2.7.0-TR3 → 2.7.0-TR4

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.
@@ -1,4 +1,6 @@
1
1
  import {YasrSteps} from "../../steps/yasgui/yasr-steps";
2
+ import {GraphsOverviewSteps} from "../../steps/explore/graphs-overview-steps";
3
+ import {JsonLdModalSteps} from "../../steps/json-ld-modal-steps";
2
4
 
3
5
  const EXPORT_GRAPHS_TABLE_ID = '#export-graphs';
4
6
  const ROWS_PER_PAGE_20 = '1';
@@ -124,12 +126,63 @@ describe('Graphs overview screen validation', () => {
124
126
  YasrSteps.getResultTableHeaderColumns().should('have.length', 5);
125
127
  });
126
128
 
127
- it('Export repository in JSONLD format', () => {
128
- cy.get('.export-repository-btn').click();
129
- cy.get('.export-repo-format-JSONLD').click();
130
- cy.get('[id=wb-JSONLD-mode]').select("http://www.w3.org/ns/json-ld#compacted");
131
- cy.get('[id=wb-JSONLD-context]').type('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
132
- cy.get('[id=wb-export-JSONLD]').click();
133
- cy.get('.modal-content').should('not.exist');
129
+ it('Should be able to export repository in JSONLD format and restore defaults', () => {
130
+ // Given I select to export the repository as JSON-LD
131
+ GraphsOverviewSteps.selectRow(1);
132
+ GraphsOverviewSteps.exportRepository();
133
+ GraphsOverviewSteps.selectJSONLDOption();
134
+
135
+ // Then I select the 'compact' mode option and add context, and export
136
+ GraphsOverviewSteps.selectJSONLDMode(3);
137
+ JsonLdModalSteps.typeJSONLDContext('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
138
+ JsonLdModalSteps.clickExportJSONLD();
139
+
140
+ // Then the dialog should disappear
141
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
142
+ // And the file should have downloaded
143
+ JsonLdModalSteps.verifyFileExists('statements.jsonld');
144
+
145
+ // When I select the same download as option again and the dialog appears with the prior data
146
+ GraphsOverviewSteps.exportRepository();
147
+ GraphsOverviewSteps.selectJSONLDOption();
148
+ JsonLdModalSteps.getJSONLDModal().should('be.visible');
149
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#compacted');
150
+ JsonLdModalSteps.getJSONLDContext().should('have.value', 'https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
151
+
152
+ // Then clicking the 'Restore defaults' button should reset the data in the form
153
+ JsonLdModalSteps.clickRestoreDefaultsJSONLD();
154
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#expanded');
155
+ });
156
+
157
+ it('Should be able to export repository in JSONLD format with default settings', () => {
158
+ // Given I select to export the repository as JSON-LD
159
+ GraphsOverviewSteps.exportRepository();
160
+ GraphsOverviewSteps.selectJSONLDOption();
161
+
162
+ // Then I select the 'flattened' mode option and export
163
+ GraphsOverviewSteps.selectJSONLDMode(2);
164
+ JsonLdModalSteps.clickExportJSONLD();
165
+
166
+ // Then the dialog should disappear
167
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
168
+
169
+ // And the file should have downloaded
170
+ JsonLdModalSteps.verifyFileExists('statements.jsonld');
171
+ });
172
+
173
+ it('Should be able to export repository in JSONLD format using row download button', () => {
174
+ // Given I select to export the repository as JSON-LD
175
+ GraphsOverviewSteps.downloadAsFromRowButton(0);
176
+ GraphsOverviewSteps.selectJSONLDFromRowDropdown();
177
+
178
+ // Then I select the 'expanded' mode option and export
179
+ GraphsOverviewSteps.selectJSONLDMode(1);
180
+ JsonLdModalSteps.clickExportJSONLD();
181
+
182
+ // Then the dialog should disappear
183
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
184
+
185
+ // And the file should have downloaded
186
+ JsonLdModalSteps.verifyFileExists('statements.jsonld');
134
187
  });
135
188
  });
@@ -59,6 +59,30 @@ describe('Import screen validation - server files', () => {
59
59
  .verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,', JSONLD_CONTEXT]);
60
60
  });
61
61
 
62
+ it('Test import Server files successfully with JSONLD default settings', () => {
63
+ ImportSteps.selectServerFile(JSONLD_FILE_FOR_IMPORT)
64
+ .importServerFiles(true)
65
+ .fillBaseURI(BASE_URI)
66
+ .selectNamedGraph()
67
+ .fillNamedGraph(CONTEXT)
68
+ .expandAdvancedSettings()
69
+ .setContextLinkToBeVisible()
70
+ .enablePreserveBNodes()
71
+ .importFromSettingsDialog()
72
+ .verifyImportStatus(JSONLD_FILE_FOR_IMPORT, SUCCESS_MESSAGE)
73
+ .verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,']);
74
+ });
75
+
76
+ it('Test import Server file successfully with JSONLD, button on row, with settings', () => {
77
+ ImportSteps.clickImportOnRow(0)
78
+ .fillBaseURI(BASE_URI)
79
+ .expandAdvancedSettings()
80
+ .fillContextLink(JSONLD_CONTEXT)
81
+ .importFromSettingsDialog()
82
+ .verifyImportStatus(JSONLD_FILE_FOR_IMPORT, SUCCESS_MESSAGE)
83
+ .verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [BASE_URI, '"preserveBNodeIds": false,', JSONLD_CONTEXT]);
84
+ });
85
+
62
86
  it('Test import with resetting status of imported file', () => {
63
87
  ImportSteps
64
88
  .selectServerFile(FILE_FOR_IMPORT)
@@ -38,12 +38,24 @@ describe('Import screen validation - user data', () => {
38
38
  ' <<<http://example.org/a>ex:b ex:c>>ex:valid "1999-08-16"^^xsd:date .\n' +
39
39
  '}';
40
40
 
41
+ const JSONLD_TEXT_SNIPPET = '[\n' +
42
+ ' {\n' +
43
+ ' "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",\n' +
44
+ ' "@type": [\n' +
45
+ ' "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",\n' +
46
+ ' "http://www.w3.org/2000/01/rdf-schema#Datatype",\n' +
47
+ ' "http://www.w3.org/2000/01/rdf-schema#ContainerMembershipProperty"\n' +
48
+ ' ]\n' +
49
+ ' }' +
50
+ ']';
51
+
41
52
  const BASE_URI = 'http://purl.org/dc/elements/1.1/';
42
53
  const CONTEXT = 'http://example.org/graph';
43
54
 
44
55
  const IMPORT_URL = 'https://www.w3.org/TR/owl-guide/wine.rdf';
56
+ const IMPORT_JSONLD_URL = 'https://example.com/0007-context.jsonld';
45
57
  const TEXT_SNIPPET = 'Text snippet';
46
- const INVALID_URL_RDF_FORMAT = 'JSON-LD';
58
+ const JSONLD_FORMAT = 'JSON-LD';
47
59
  const VALID_URL_RDF_FORMAT = 'RDF/XML';
48
60
  const VALID_SNIPPET_TURTLESTAR_FORMAT = 'Turtle*';
49
61
  const VALID_SNIPPET_TRIGSTAR_FORMAT = 'TriG*';
@@ -73,7 +85,7 @@ describe('Import screen validation - user data', () => {
73
85
  it('Test import file via URL with invalid RDF format selected', () => {
74
86
  ImportSteps
75
87
  .openImportURLDialog(IMPORT_URL)
76
- .selectRDFFormat(INVALID_URL_RDF_FORMAT)
88
+ .selectRDFFormat(JSONLD_FORMAT)
77
89
  .clickImportUrlButton()
78
90
  .importFromSettingsDialog()
79
91
  .verifyImportStatus(IMPORT_URL, RDF_ERROR_MESSAGE);
@@ -101,7 +113,7 @@ describe('Import screen validation - user data', () => {
101
113
  ImportSteps
102
114
  .openImportTextSnippetDialog()
103
115
  .fillRDFTextSnippet(RDF_TEXT_SNIPPET_1)
104
- .selectRDFFormat(INVALID_URL_RDF_FORMAT)
116
+ .selectRDFFormat(JSONLD_FORMAT)
105
117
  .clickImportTextSnippetButton()
106
118
  .importFromSettingsDialog()
107
119
  .verifyImportStatus(TEXT_SNIPPET, RDF_ERROR_MESSAGE);
@@ -243,6 +255,74 @@ describe('Import screen validation - user data', () => {
243
255
  verifyGraphData("http://graph1", "urn:replaced-s1", "urn:replaced-p1", "urn:replaced-o1", "http://graph1", true, "urn:s1");
244
256
  });
245
257
 
258
+ it('should import JSON-LD text snippet successfully without URI', () => {
259
+ ImportSteps
260
+ .openImportTextSnippetDialog()
261
+ .fillRDFTextSnippet(JSONLD_TEXT_SNIPPET)
262
+ .selectRDFFormat(JSONLD_FORMAT)
263
+ .clickImportTextSnippetButton()
264
+ .selectNamedGraph()
265
+ .fillNamedGraph(CONTEXT)
266
+ .importFromSettingsDialog()
267
+ .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
268
+
269
+ // Go to Graphs overview
270
+ cy.visit('/graphs');
271
+ cy.get('.ot-splash').should('not.be.visible');
272
+
273
+ const graphName = CONTEXT.slice(0, CONTEXT.lastIndexOf('.'));
274
+
275
+ // Verify that created graph can be found
276
+ cy.get('.search-graphs').type(graphName).should('have.value', graphName);
277
+ cy.get('#export-graphs').should('be.visible').should('contain', graphName);
278
+ });
279
+
280
+ it('should import JSON-LD text snippet successfully with URI and context', () => {
281
+ ImportSteps
282
+ .openImportTextSnippetDialog()
283
+ .fillRDFTextSnippet(JSONLD_TEXT_SNIPPET)
284
+ .selectRDFFormat(JSONLD_FORMAT)
285
+ .clickImportTextSnippetButton()
286
+ .fillBaseURI(BASE_URI)
287
+ .selectNamedGraph()
288
+ .fillNamedGraph(CONTEXT)
289
+ .fillContextLink('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld')
290
+ .importFromSettingsDialog()
291
+ .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
292
+ const graphName = CONTEXT.slice(0, CONTEXT.lastIndexOf('.'));
293
+ // Verify that created graph can be found
294
+ verifyGraphData(graphName, "rdf:Property", "rdf:Property", "rdf:Property", "http://example.org/graph", false);
295
+ });
296
+
297
+ it('should import JSON-LD file via URL with correct request body', () => {
298
+ stubPostJSONLDFromURL();
299
+ ImportSteps
300
+ .openImportURLDialog(IMPORT_JSONLD_URL)
301
+ .selectRDFFormat(JSONLD_FORMAT)
302
+ .clickImportUrlButton()
303
+ .importFromSettingsDialog();
304
+ cy.wait('@postJsonldUrl').then((xhr) => {
305
+ expect(xhr.request.body.name).to.eq('https://example.com/0007-context.jsonld');
306
+ expect(xhr.request.body.data).to.eq('https://example.com/0007-context.jsonld');
307
+ expect(xhr.request.body.type).to.eq('url');
308
+ expect(xhr.request.body.isJSONLD).to.be.true;
309
+ });
310
+ });
311
+
312
+ it('should show error on invalid JSON-LD URL', () => {
313
+ stubPostJSONLDFromURL();
314
+ ImportSteps
315
+ .openImportURLDialog(IMPORT_JSONLD_URL)
316
+ .selectRDFFormat(JSONLD_FORMAT)
317
+ .clickImportUrlButton()
318
+ .importFromSettingsDialog()
319
+ .verifyImportStatus(IMPORT_JSONLD_URL, 'https://example.com/0007-context.jsonld');
320
+ });
321
+
322
+ function stubPostJSONLDFromURL() {
323
+ cy.intercept('POST', `/rest/repositories/${repositoryId}/import/upload/url`).as('postJsonldUrl');
324
+ }
325
+
246
326
  function getImportFromDataRadioButton() {
247
327
  return cy.get('.from-data-btn');
248
328
  }
@@ -287,7 +367,7 @@ describe('Import screen validation - user data', () => {
287
367
  return cy.get('.icon-trash');
288
368
  }
289
369
 
290
- //verifies that the data has been inserted in the given graph and that the new data has replaced the old one.
370
+ //verifies that the data has been inserted in the given graph and that the new data has replaced the old one.
291
371
  function verifyGraphData(graphName, s, p, o, c, checkForReplacedData, oldData) {
292
372
  cy.visit('/graphs');
293
373
  // wait a bit to give chance page loaded.
@@ -6,6 +6,7 @@ import {SparqlEditorSteps} from "../../steps/sparql-editor-steps";
6
6
  import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
7
7
  import {YasrSteps} from "../../steps/yasgui/yasr-steps";
8
8
  import {YasguiSteps} from "../../steps/yasgui/yasgui-steps";
9
+ import {JsonLdModalSteps} from "../../steps/json-ld-modal-steps";
9
10
 
10
11
  const FILE_TO_IMPORT = 'resource-test-data.ttl';
11
12
  const SUBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
@@ -46,6 +47,8 @@ describe('Resource view', () => {
46
47
  // When I load a resource that takes part in a triple with a blank node.
47
48
  ResourceSteps.visit(`uri=${PREDICATE_SOURCE}&role=subject`);
48
49
 
50
+ cy.get('.ontotext-yasgui-loader').should('be.hidden');
51
+
49
52
  // When I click on "predicate" tab.
50
53
  ResourceSteps.selectPredicateRole();
51
54
 
@@ -359,4 +362,41 @@ describe('Resource view', () => {
359
362
  YasguiSteps.getCurrentTab().should('contain', 'Unnamed 1');
360
363
  });
361
364
  });
365
+
366
+ context('Download as', () => {
367
+ it('should download as JSON-LD and then restore defaults', () => {
368
+ // Given I am in the Resource view
369
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
370
+ ResourceSteps.verifyActiveRoleTab('subject');
371
+
372
+ // When I download as JSON-LD
373
+ ResourceSteps.clickDownloadAsOption(1);
374
+
375
+ // Then I should see a dialog appear
376
+ JsonLdModalSteps.getJSONLDModal().should('be.visible');
377
+
378
+ // And I type some example data into the form
379
+ JsonLdModalSteps.selectJSONLDMode(0);
380
+ JsonLdModalSteps.typeJSONLDFrame('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
381
+
382
+ // And export a file
383
+ JsonLdModalSteps.clickExportJSONLD();
384
+
385
+ // Then the dialog should disappear
386
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
387
+
388
+ // And the file should have downloaded
389
+ JsonLdModalSteps.verifyFileExists('statements.jsonld');
390
+
391
+ // When I select the same download as option again and the dialog appears with the prior data
392
+ ResourceSteps.clickDownloadAsOption(1);
393
+ JsonLdModalSteps.getJSONLDModal().should('be.visible');
394
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#framed');
395
+ JsonLdModalSteps.getJSONLDFrame().should('have.value', 'https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
396
+
397
+ // Then clicking the 'Restore defaults' button should reset the data in the form
398
+ JsonLdModalSteps.clickRestoreDefaultsJSONLD();
399
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#expanded');
400
+ });
401
+ });
362
402
  });
@@ -2,6 +2,8 @@ import {QueryStubs} from "../../../stubs/yasgui/query-stubs";
2
2
  import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
3
3
  import {YasrSteps} from "../../../steps/yasgui/yasr-steps";
4
4
  import {YasqeSteps} from "../../../steps/yasgui/yasqe-steps";
5
+ import {JsonLdModalSteps} from "../../../steps/json-ld-modal-steps";
6
+ import {GraphsOverviewSteps} from "../../../steps/explore/graphs-overview-steps";
5
7
 
6
8
  describe('Download results', () => {
7
9
  let repositoryId;
@@ -50,5 +52,74 @@ describe('Download results', () => {
50
52
  YasrSteps.getDownloadAsOption(6).contains( 'TSV*');
51
53
  YasrSteps.getDownloadAsOption(7).contains( 'Binary RDF Results');
52
54
  });
55
+
56
+ it('should download as JSON-LD after a CONSTRUCT query', () => {
57
+ // Given I execute a CONSTRUCT query
58
+ pasteAndExecuteConstructQuery();
59
+ // And I open the download dropdown
60
+ YasrSteps.openDownloadAsDropdown();
61
+ // Then the second option should be JSON-LD
62
+ YasrSteps.getDownloadAsOption(1).contains( 'JSON-LD');
63
+ // When I select it
64
+ YasrSteps.selectDownloadAsOption(1);
65
+ // The dialog for download should appear
66
+ JsonLdModalSteps.getJSONLDModal().should('be.visible');
67
+ // Then I see the default settings
68
+ JsonLdModalSteps.getSelectedJSONLDModeField().should('have.value', 'http://www.w3.org/ns/json-ld#expanded');
69
+ // When I click to export
70
+ JsonLdModalSteps.clickExportJSONLD();
71
+ // Then the dialog should disappear
72
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
73
+ // And the file should have downloaded
74
+ // TODO: verify the file exists
75
+ // JsonLdModalSteps.verifyFileExists('query-result.jsonld');
76
+
77
+ // When I open the dialog again
78
+ YasrSteps.selectDownloadAsOption(1);
79
+ // And I change the JSON-LD form
80
+ GraphsOverviewSteps.selectJSONLDMode(0);
81
+ // And type in a context
82
+ JsonLdModalSteps.typeJSONLDFrame('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
83
+ // And export
84
+ JsonLdModalSteps.clickExportJSONLD();
85
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
86
+ // Then the file should have downloaded
87
+ // TODO: verify the file exists
88
+ // JsonLdModalSteps.verifyFileExists('query-result.jsonld');
89
+ });
90
+
91
+ it('should download as JSON-LD after a CONSTRUCT query, with context added', () => {
92
+ // Given I execute a CONSTRUCT query
93
+ pasteAndExecuteConstructQuery();
94
+ // And I open the download dropdown
95
+ YasrSteps.openDownloadAsDropdown();
96
+ // Then the second option should be JSON-LD
97
+ YasrSteps.getDownloadAsOption(1).contains( 'JSON-LD');
98
+ // When I select it
99
+ YasrSteps.selectDownloadAsOption(1);
100
+ // And I change the JSON-LD form
101
+ GraphsOverviewSteps.selectJSONLDMode(0);
102
+ // And type in a context
103
+ JsonLdModalSteps.typeJSONLDFrame('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
104
+ // And export
105
+ JsonLdModalSteps.clickExportJSONLD();
106
+ JsonLdModalSteps.getJSONLDModal().should('not.exist');
107
+ // Then the file should have downloaded
108
+ // TODO: verify the file exists
109
+ // JsonLdModalSteps.verifyFileExists('query-result.jsonld');
110
+ });
53
111
  });
54
112
  });
113
+
114
+ function pasteAndExecuteConstructQuery() {
115
+ YasqeSteps.clearEditor();
116
+ YasqeSteps.pasteQuery('PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' +
117
+ 'PREFIX onto: <http://www.ontotext.com/>' +
118
+ 'CONSTRUCT {' +
119
+ '?source rdf:type ?destination .' +
120
+ '} WHERE {' +
121
+ '?bag rdf:type ?source .' +
122
+ '?flight rdf:type ?destination' +
123
+ '}');
124
+ YasqeSteps.executeQuery();
125
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.7.0-TR3",
3
+ "version": "2.7.0-TR4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "2.7.0-TR3",
9
+ "version": "2.7.0-TR4",
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.0-TR3",
3
+ "version": "2.7.0-TR4",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "prepack": "npm shrinkwrap",
@@ -21,4 +21,36 @@ export class GraphsOverviewSteps {
21
21
  static openGraph(row = 0) {
22
22
  GraphsOverviewSteps.getResult(row).find('td ').eq(1).find('a').click();
23
23
  }
24
+
25
+ static selectRow(row) {
26
+ cy.get('.form-check-input').eq(row).click();
27
+ }
28
+
29
+ static getExportRepositoryButtonOnRow(index) {
30
+ return cy.get('.export-graph').eq(index);
31
+ }
32
+
33
+ static downloadAsFromRowButton(index) {
34
+ this.getExportRepositoryButtonOnRow(index).click();
35
+ }
36
+
37
+ static selectJSONLDFromRowDropdown() {
38
+ cy.get('.dropdown-menu').find('.export-repo-format-JSON-LD').eq(1).click();
39
+ }
40
+
41
+ static getExportRepositoryButton() {
42
+ return cy.get('.export-repository-btn');
43
+ }
44
+
45
+ static exportRepository() {
46
+ this.getExportRepositoryButton().click();
47
+ }
48
+
49
+ static selectJSONLDOption() {
50
+ cy.get('.export-repo-format-JSONLD').click();
51
+ }
52
+
53
+ static selectJSONLDMode(option) {
54
+ cy.get('[id=wb-JSONLD-mode]').select(option);
55
+ }
24
56
  }
@@ -145,6 +145,12 @@ class ImportSteps {
145
145
  return ImportSteps;
146
146
  }
147
147
 
148
+ static clickImportOnRow(row) {
149
+ this.getImportFileRow(row).find('.pull-right').contains('Import').click();
150
+
151
+ return ImportSteps;
152
+ }
153
+
148
154
  static importFromSettingsDialog() {
149
155
  // Dialog should disappear
150
156
  ImportSteps.getModal().
@@ -199,13 +205,21 @@ class ImportSteps {
199
205
  return ImportSteps;
200
206
  }
201
207
 
208
+ static setContextLinkToBeVisible() {
209
+ ImportSteps.getSettingsForm().within(() => {
210
+ cy.get('.contextLinkRow').invoke('attr', 'style', 'display: block !important');
211
+ });
212
+
213
+ return ImportSteps;
214
+ }
215
+
202
216
  static resetStatusOfUploadedFiles() {
203
217
  // Button should disappear
204
218
  cy.get('#import-server #wb-import-clearStatuses')
205
219
  .click()
206
220
  .then((el) => {
207
221
  cy.waitUntil(() => cy.wrap(el).should('not.be.visible'));
208
- })
222
+ });
209
223
 
210
224
  return ImportSteps;
211
225
  }
@@ -0,0 +1,41 @@
1
+ export class JsonLdModalSteps {
2
+ static getJSONLDModal() {
3
+ return cy.get('.modal-content');
4
+ }
5
+
6
+ static selectJSONLDMode(option) {
7
+ cy.get('[id=wb-JSONLD-mode]').select(option);
8
+ }
9
+
10
+ static getSelectedJSONLDModeField() {
11
+ return cy.get('#wb-JSONLD-mode option:checked');
12
+ }
13
+
14
+ static getJSONLDFrame() {
15
+ return cy.get('[id=wb-JSONLD-frame]');
16
+ }
17
+
18
+ static getJSONLDContext() {
19
+ return cy.get('[id=wb-JSONLD-context]');
20
+ }
21
+
22
+ static typeJSONLDFrame(text) {
23
+ this.getJSONLDFrame().type(text);
24
+ }
25
+
26
+ static typeJSONLDContext(text) {
27
+ this.getJSONLDContext().type(text);
28
+ }
29
+
30
+ static clickExportJSONLD() {
31
+ cy.get('[id=wb-export-JSONLD]').click();
32
+ }
33
+
34
+ static clickRestoreDefaultsJSONLD() {
35
+ cy.get('.restore-defaults').click();
36
+ }
37
+
38
+ static verifyFileExists(fileName) {
39
+ cy.readFile('cypress/downloads/' + fileName);
40
+ }
41
+ }
@@ -53,7 +53,12 @@ export class ResourceSteps {
53
53
  }
54
54
 
55
55
  static getDownloadAsDropdown() {
56
- return cy.get('.dropdown-toggle');
56
+ return cy.get('.download-as');
57
+ }
58
+
59
+ static clickDownloadAsOption(option) {
60
+ this.getDownloadAsDropdown().click();
61
+ cy.get('.download-options li').eq(option).click();
57
62
  }
58
63
 
59
64
  static getVisualGraphButton() {
@@ -97,7 +102,7 @@ export class ResourceSteps {
97
102
  }
98
103
 
99
104
  static selectRole(role) {
100
- ResourceSteps.getRoleTab(role).click();
105
+ ResourceSteps.getRoleTab(role).click({force: false});
101
106
  }
102
107
 
103
108
  static selectSubjectRole() {
@@ -86,6 +86,11 @@ export class YasrSteps {
86
86
  return this.getDownloadAsDropdown().find('.ontotext-dropdown-menu-item').eq(number);
87
87
  }
88
88
 
89
+ static selectDownloadAsOption(number) {
90
+ // Click with force: true, because the repository dropdown at the top of the page hides the option
91
+ this.getDownloadAsOption(number).click({force: true});
92
+ }
93
+
89
94
  static getPagination() {
90
95
  return YasrSteps.getYasr().find('.ontotext-pagination');
91
96
  }