graphdb-workbench-tests 2.7.0-TR6 → 2.7.0-TR8

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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "@context": {
3
+ "ab": "http://learningsparql.com/ns/addressbook#"
4
+ },
5
+ "@id": "ab:richard",
6
+ "ab:homeTel": "(229)276-5135",
7
+ "ab:email": "richard491@hotmail.com"
8
+ }
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0"?>
2
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
4
+ xmlns:ex="http://example.org/stuff/1.0/">
5
+
6
+ <rdf:Description rdf:about="http://www.w3.org/TR/rdf-syntax-grammar"
7
+ dc:title="RDF1.1 XML Syntax">
8
+ <ex:editor>
9
+ <rdf:Description ex:fullName="Dave Beckett">
10
+ <ex:homePage rdf:resource="http://purl.org/net/dajobe/" />
11
+ </rdf:Description>
12
+ </ex:editor>
13
+ </rdf:Description>
14
+
15
+ </rdf:RDF>
@@ -900,14 +900,11 @@
900
900
  "restore.defaults.btn": "Restore defaults",
901
901
  "abort.btn": "Abort",
902
902
  "no.files.found": "No files found",
903
- "rdf.from.snippet": "Import RDF data from a text snippet",
904
- "rdf.data.here": "Put your RDF data here and select its format.",
905
903
  "enable.for.auto.start": "Enable this option to start the import when you click the Import button. If it is disabled the import will be added to the list but not started automatically.",
906
904
  "auto.start": "Start import automatically",
907
905
  "data.from.url": "Import RDF data from URL",
908
906
  "supported.url.with.rdf": "URL with RDF data. Supported formats are",
909
907
  "invalid.url": "Not valid url!",
910
- "format": "Format",
911
908
  "gz.zip": ", as well as their .gz versions and .zip archives",
912
909
  "error.could.not.get.files": "Could not get files; {{data}}",
913
910
  "error.could.not.stop": "Could not stop import; {{data}}",
@@ -927,19 +924,35 @@
927
924
  "show.files.only": "Show files only",
928
925
  "show.files.directories": "Show both files and directories",
929
926
  "show.directories.only": "Show directories only",
930
- "type.to.filter": "Type to filter",
927
+ "type.to.filter": "Type to filter by name",
931
928
  "selected.items": "Import the selected items",
932
929
  "without.changing.settings": "Import without changing settings",
933
930
  "reset.last.imported": "Reset the last imported status of the selected items",
934
931
  "reset.status": "Reset status",
935
932
  "remove.selected": "Remove the selected items from the list",
936
933
  "remove.btn": "Remove",
937
- "remove.confirm.msg": "Are you sure you want to remove selected files: '{{name}}'?",
934
+ "import.btn": "Import",
935
+ "remove.confirm.msg": "Are you sure you want to remove selected files: {{name}}",
938
936
  "mode.not.supported.constraint": "This mode is not supported when importing multiple items.",
939
937
  "enable.replace.option": "Enable this to replace the data in one or more graphs with the imported data.",
940
938
  "context.link": "JSON-LD context",
941
939
  "context.link.info": "Specifies external JSON-LD context as a URL. Only whitelisted URLs can be used.",
942
940
  "file.upload.progress": "{{progress}} % uploaded",
941
+ "text_snippet_dialog": {
942
+ "title": "Import RDF data from a text snippet",
943
+ "text_snippet": {
944
+ "label": "Insert your RDF data here and select its format below.",
945
+ "placeholder": "# Example: rdf:predicate a rdf:Property .",
946
+ "validation_message": "Maximum length of {{limit}} characters exceeded."
947
+ },
948
+ "auto_start": {
949
+ "tooltip": "Enable this option to start the import when you click the Import button. If it is disabled the import will be added to the list but not started automatically.",
950
+ "label": "Start import automatically"
951
+ },
952
+ "import_format_menu": {
953
+ "label": "Format"
954
+ }
955
+ },
943
956
  "user_data": {
944
957
  "duplicates_confirmation": {
945
958
  "title": "Confirm files overwrite",
@@ -979,7 +992,7 @@
979
992
  "the_property": "property"
980
993
  },
981
994
  "on_file_size_limit": {
982
- "file_size_limit_info": "To import larger than {{fileSizeLimit}} MB, use the ",
995
+ "file_size_limit_info": "To import larger than {{fileSizeLimit}} MB files, use the ",
983
996
  "server_files_link": "Server files",
984
997
  "import_or_use": "import or use the",
985
998
  "api_link": "API"
@@ -1003,7 +1016,8 @@
1003
1016
  "interrupt_import": "Interrupt import",
1004
1017
  "abort": "Abort"
1005
1018
  }
1006
- },"status-info": {
1019
+ },
1020
+ "status-info": {
1007
1021
  "last_import_settings": "Last import settings",
1008
1022
  "context": "Context",
1009
1023
  "replaced_graphs": "Replaced graphs",
@@ -1013,7 +1027,6 @@
1013
1027
  "parser_settings": "Parser settings"
1014
1028
  }
1015
1029
  },
1016
- "text.snippet.text.aria.placeholder": "# Example: rdf:predicate a rdf:Property .",
1017
1030
  "url.import.input.placeholder": "Data URL",
1018
1031
  "filesTable.interrupt.import": "Interrupt import",
1019
1032
  "core.errors.no.connected.repository.warning.msg": "Some functionalities are not available because you are not connected to any repository.",
@@ -1,107 +1,78 @@
1
- import ImportSteps from "../../steps/import/import-steps";
1
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
2
+ import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
2
3
 
3
- // the suite will be fixed with the next MR
4
- describe.skip('Import server files', () => {
4
+ describe('Import server files', () => {
5
5
 
6
6
  let repositoryId;
7
7
 
8
- const BASE_URI = 'http://purl.org/dc/elements/1.1/';
9
- const CONTEXT = 'http://example.org/context';
10
- const SUCCESS_MESSAGE = 'Imported successfully';
11
- const FILE_FOR_IMPORT = 'italian_public_schools_links.nt.gz';
12
- const TTLS_FOR_IMPORT = 'test_turtlestar.ttls';
13
- const TRIGS_FOR_IMPORT = 'test-trigstar.trigs';
14
8
  const JSONLD_FILE_FOR_IMPORT = '0007-import-file.jsonld';
15
- const JSONLD_CONTEXT = 'https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld';
16
9
 
17
10
  beforeEach(() => {
18
11
  repositoryId = 'server-import-' + Date.now();
19
12
  cy.createRepository({id: repositoryId});
20
- ImportSteps.visitServerImport(repositoryId);
13
+ ImportServerFilesSteps.visitServerImport(repositoryId);
14
+ ImportServerFilesSteps.getResources().should('have.length', 14);
21
15
  });
22
16
 
23
17
  afterEach(() => {
24
18
  cy.deleteRepository(repositoryId);
25
19
  });
26
20
 
27
- it('Test import Server files successfully without changing settings', () => {
28
- ImportSteps.selectServerFile(FILE_FOR_IMPORT);
29
- ImportSteps.importServerFiles();
30
- ImportSteps.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE);
31
- ImportSteps.verifyImportStatusDetails(FILE_FOR_IMPORT, '"preserveBNodeIds": false,');
21
+ it('Should be able to open the server files tab through a click on the tab', () => {
22
+ // Given I have visited the import page
23
+ ImportUserDataSteps.visit();
24
+ ImportUserDataSteps.getActiveTab().should('have.text', 'User data');
25
+ // When I switch to the server files tab
26
+ ImportUserDataSteps.openServerFilesTab();
27
+ // Then Server files tab should be active
28
+ cy.url().should('include', '/import#server');
29
+ ImportServerFilesSteps.getActiveTab().should('have.text', 'Server files');
30
+ ImportServerFilesSteps.getResourcesTable().should('be.visible');
32
31
  });
33
32
 
34
- it('Test import Server files successfully with changing settings', () => {
35
- ImportSteps.selectServerFile(FILE_FOR_IMPORT);
36
- ImportSteps.importServerFiles(true);
37
- ImportSteps.expandAdvancedSettings();
38
- ImportSteps.fillBaseURI(BASE_URI);
39
- ImportSteps.selectNamedGraph();
40
- ImportSteps.fillNamedGraph(CONTEXT);
41
- ImportSteps.enablePreserveBNodes();
42
- ImportSteps.importFromSettingsDialog();
43
- ImportSteps.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE);
44
- ImportSteps.verifyImportStatusDetails(FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,']);
33
+ it('Should be able to open the server files tab through a link', () => {
34
+ // When I visit the import page through a direct link to the server files tab
35
+ cy.visit('/import#server');
36
+ // Then Server files tab should be active
37
+ cy.url().should('include', '/import#server');
38
+ ImportServerFilesSteps.getActiveTab().should('have.text', 'Server files');
39
+ ImportServerFilesSteps.getResourcesTable().should('be.visible');
45
40
  });
46
41
 
47
- // for this test it is necessary to set up a whitelist to GraphDB in this way: -Dgraphdb.jsonld.whitelist=https://w3c.github.io/json-ld-api/tests/*
48
- it('Test import Server files successfully with JSONLD context link settings', () => {
49
- ImportSteps.selectServerFile(JSONLD_FILE_FOR_IMPORT);
50
- ImportSteps.importServerFiles(true);
51
- ImportSteps.expandAdvancedSettings();
52
- ImportSteps.fillBaseURI(BASE_URI);
53
- ImportSteps.fillContextLink(JSONLD_CONTEXT);
54
- ImportSteps.selectNamedGraph();
55
- ImportSteps.fillNamedGraph(CONTEXT);
56
- ImportSteps.enablePreserveBNodes();
57
- ImportSteps.importFromSettingsDialog();
58
- ImportSteps.verifyImportStatus(JSONLD_FILE_FOR_IMPORT, SUCCESS_MESSAGE);
59
- ImportSteps.verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,', JSONLD_CONTEXT]);
42
+ it('Should be able to toggle the server file import help', () => {
43
+ // When the page is loaded
44
+ // Then I should see the server files import help
45
+ ImportServerFilesSteps.getHelpMessage().should('be.visible');
46
+ // When I close the help
47
+ ImportServerFilesSteps.closeHelpMessage();
48
+ // Then the help should disappear
49
+ ImportServerFilesSteps.getHelpMessage().should('not.exist');
60
50
  });
61
51
 
62
- it('Test import Server files successfully with JSONLD default settings', () => {
63
- ImportSteps.selectServerFile(JSONLD_FILE_FOR_IMPORT);
64
- ImportSteps.importServerFiles(true);
65
- ImportSteps.expandAdvancedSettings();
66
- ImportSteps.fillBaseURI(BASE_URI);
67
- ImportSteps.selectNamedGraph();
68
- ImportSteps.fillNamedGraph(CONTEXT);
69
- ImportSteps.setContextLinkToBeVisible();
70
- ImportSteps.enablePreserveBNodes();
71
- ImportSteps.importFromSettingsDialog();
72
- ImportSteps.verifyImportStatus(JSONLD_FILE_FOR_IMPORT, SUCCESS_MESSAGE);
73
- ImportSteps.verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [CONTEXT, BASE_URI, '"preserveBNodeIds": true,']);
52
+ it('Should be able to filter the files', () => {
53
+ // When the server files tab is loaded
54
+ // Then I should see all the files
55
+ ImportServerFilesSteps.getResources().should('have.length', 14);
56
+ // When I type in the filter filed
57
+ ImportServerFilesSteps.typeInFilterField('007');
58
+ // Then I should see only the files matching the filter
59
+ ImportServerFilesSteps.getResources().should('have.length', 1);
60
+ ImportServerFilesSteps.getResourceByName(JSONLD_FILE_FOR_IMPORT).should('be.visible');
74
61
  });
75
62
 
76
- it('Test import Server file successfully with JSONLD, button on row, with settings', () => {
77
- ImportSteps.clickImportOnRow(0);
78
- ImportSteps.expandAdvancedSettings();
79
- ImportSteps.fillBaseURI(BASE_URI);
80
- ImportSteps.fillContextLink(JSONLD_CONTEXT);
81
- ImportSteps.importFromSettingsDialog();
82
- ImportSteps.verifyImportStatus(JSONLD_FILE_FOR_IMPORT, SUCCESS_MESSAGE);
83
- ImportSteps.verifyImportStatusDetails(JSONLD_FILE_FOR_IMPORT, [BASE_URI, '"preserveBNodeIds": false,', JSONLD_CONTEXT]);
84
- });
85
-
86
- it('Test import with resetting status of imported file', () => {
87
- ImportSteps.selectServerFile(FILE_FOR_IMPORT);
88
- ImportSteps.importServerFiles();
89
- ImportSteps.verifyImportStatus(FILE_FOR_IMPORT, SUCCESS_MESSAGE);
90
- ImportSteps.resetStatusOfUploadedFile(FILE_FOR_IMPORT);
91
- ImportSteps.verifyNoImportStatus(FILE_FOR_IMPORT);
92
- });
93
-
94
- it('Test import turtlestar from Server files successfully without changing settings', () => {
95
- ImportSteps.selectServerFile(TTLS_FOR_IMPORT);
96
- ImportSteps.importServerFiles();
97
- ImportSteps.verifyImportStatus(TTLS_FOR_IMPORT, SUCCESS_MESSAGE);
98
- ImportSteps.verifyImportStatusDetails(TTLS_FOR_IMPORT, '"preserveBNodeIds": false,');
99
- });
100
-
101
- it('Test import trigstar from Server files successfully without changing settings', () => {
102
- ImportSteps.selectServerFile(TRIGS_FOR_IMPORT);
103
- ImportSteps.importServerFiles();
104
- ImportSteps.verifyImportStatus(TRIGS_FOR_IMPORT, SUCCESS_MESSAGE);
105
- ImportSteps.verifyImportStatusDetails(TRIGS_FOR_IMPORT, '"preserveBNodeIds": false,');
63
+ it('Should be able to switch between files, folders and mixed list', () => {
64
+ // When the server files tab is loaded
65
+ // Then I should see all the files and folders by default
66
+ ImportServerFilesSteps.getShowAllResourceTypesButton().should('have.class', 'active');
67
+ ImportServerFilesSteps.getResources().should('have.length', 14);
68
+ // When I select the folders only filter
69
+ ImportServerFilesSteps.selectFoldersOnlyFilter();
70
+ // Then I should see only the folders
71
+ ImportServerFilesSteps.getShowOnlyFoldersButton().should('have.class', 'active');
72
+ ImportServerFilesSteps.getResources().should('have.length', 1);
73
+ // When I select the files only filter
74
+ ImportServerFilesSteps.selectFilesOnlyFilter();
75
+ // Then I should see only the files
76
+ ImportServerFilesSteps.getResources().should('have.length', 13);
106
77
  });
107
78
  });
@@ -1,7 +1,7 @@
1
- import ImportSteps from "../../steps/import/import-steps";
2
1
  import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
3
2
  import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
4
3
  import {MainMenuSteps} from "../../steps/main-menu-steps";
4
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
5
5
 
6
6
  const bnodes = `_:node0 <http://purl.org/dc/elements/1.1/title> "A new book" ;
7
7
  \t<http://purl.org/dc/elements/1.1/creator> "A.N.Other" .`;
@@ -27,7 +27,7 @@ describe('Import user data: File upload', () => {
27
27
  repositoryId = 'user-import-' + Date.now();
28
28
  cy.createRepository({id: repositoryId});
29
29
  cy.presetRepository(repositoryId);
30
- ImportSteps.visitImport('user', repositoryId);
30
+ ImportUserDataSteps.visitImport('user', repositoryId);
31
31
  });
32
32
 
33
33
  afterEach(() => {
@@ -37,94 +37,105 @@ describe('Import user data: File upload', () => {
37
37
 
38
38
  it('Should be able to upload and import a single unique file', () => {
39
39
  // Given there are no files uploaded yet
40
- ImportSteps.getUserDataUploadedFilesTable().should('be.hidden');
40
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
41
41
  // When I start to upload a file
42
- ImportSteps.selectFile(ImportSteps.createFile(testFiles[0], bnodes));
42
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
43
43
  // Then the import settings dialog should open automatically
44
44
  ImportSettingsDialogSteps.getDialog().should('be.visible');
45
45
  ImportSettingsDialogSteps.import();
46
46
  ImportSettingsDialogSteps.getDialog().should('not.exist');
47
47
  // Then I should see the uploaded file
48
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
49
- ImportSteps.checkUserDataImportedResource(0, 'bnodes.ttl');
48
+ ImportUserDataSteps.getResources().should('have.length', 1);
49
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
50
+ });
51
+
52
+ it('Should allow replacing graph when uploading and importing single file', () => {
53
+ // Given there are no files uploaded yet
54
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
55
+ // When I start to upload a file
56
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
57
+ // Then the import settings dialog should open automatically
58
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
59
+ // And the option for replace graph should be active
60
+ ImportSettingsDialogSteps.getReplaceExistingDataCheckbox().should('be.enabled').and('not.be.checked');
50
61
  });
51
62
 
52
63
  it('Should be able to upload and import files one after the other and then override them', () => {
53
64
  // Given there are no files uploaded yet
54
- ImportSteps.getUserDataUploadedFilesTable().should('be.hidden');
65
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
55
66
  // When I upload a file
56
- ImportSteps.selectFile(ImportSteps.createFile(testFiles[0], bnodes));
67
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
57
68
  ImportSettingsDialogSteps.import();
58
69
  // Then I should see the uploaded file
59
- ImportSteps.checkUserDataImportedResource(0, 'bnodes.ttl');
70
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
60
71
  // When I upload another file
61
- ImportSteps.selectFile(ImportSteps.createFile(testFiles[1], jsonld));
72
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld));
62
73
  ImportSettingsDialogSteps.import();
63
74
  // Then I should see the uploaded file - it becomes first in the list
64
- ImportSteps.checkUserDataImportedResource(0, 'jsonld.jsonld');
65
- ImportSteps.checkUserDataImportedResource(1, 'bnodes.ttl');
75
+ ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
76
+ ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
66
77
  // When I override the first file
67
- ImportSteps.selectFile(ImportSteps.createFile(testFiles[0], bnodes));
78
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
68
79
  ModalDialogSteps.clickOnConfirmButton();
69
80
  ImportSettingsDialogSteps.import();
70
81
  // Then I should see the uploaded file - it becomes first in the list
71
82
  // TODO: timestamps currently seems to not be changed on reimport
72
- ImportSteps.checkUserDataImportedResource(0, 'jsonld.jsonld');
73
- ImportSteps.checkUserDataImportedResource(1, 'bnodes.ttl');
83
+ ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
84
+ ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
74
85
  // When I override the second file
75
- ImportSteps.selectFile(ImportSteps.createFile(testFiles[1], jsonld));
86
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld));
76
87
  ModalDialogSteps.clickOnConfirmButton();
77
88
  ImportSettingsDialogSteps.import();
78
89
  // Then I should see the uploaded file - it becomes first in the list
79
- ImportSteps.checkUserDataImportedResource(0, 'jsonld.jsonld');
80
- ImportSteps.checkUserDataImportedResource(1, 'bnodes.ttl');
90
+ ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
91
+ ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
81
92
  });
82
93
 
83
94
  it('should be able to only upload a single file without importing it', () => {
84
95
  // Given there are no files uploaded yet
85
- ImportSteps.getUserDataUploadedFilesTable().should('be.hidden');
96
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
86
97
  // When I start to upload a file
87
- ImportSteps.selectFile(ImportSteps.createFile(testFiles[0], bnodes));
98
+ ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
88
99
  // Then the import settings dialog should open automatically
89
100
  ImportSettingsDialogSteps.cancelImport();
90
101
  // Then I should see the uploaded file
91
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
92
- ImportSteps.checkUserDataUploadedResource(0, 'bnodes.ttl');
102
+ ImportUserDataSteps.getResources().should('have.length', 1);
103
+ ImportUserDataSteps.checkUserDataUploadedResource(0, 'bnodes.ttl');
93
104
  // And the file should really be there
94
105
  MainMenuSteps.openHomePage();
95
- ImportSteps.visit();
96
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
106
+ ImportUserDataSteps.visit();
107
+ ImportUserDataSteps.getResources().should('have.length', 1);
97
108
  });
98
109
 
99
110
  it('Should be able to upload multiple unique files', () => {
100
111
  // Given there are no files uploaded yet
101
- ImportSteps.getUserDataUploadedFilesTable().should('be.hidden');
112
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
102
113
  // When I upload a file
103
- const file1 = ImportSteps.createFile(testFiles[0], bnodes);
104
- const file2 = ImportSteps.createFile(testFiles[1], jsonld);
105
- ImportSteps.selectFile([file1, file2]);
114
+ const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
115
+ const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
116
+ ImportUserDataSteps.selectFile([file1, file2]);
106
117
  // Then the import settings dialog should open automatically
107
118
  ImportSettingsDialogSteps.import();
108
119
  // Then I should see the uploaded file
109
- ImportSteps.getUserDataUploadedFiles().should('have.length', 2);
110
- ImportSteps.checkUserDataImportedResource(0, 'jsonld.jsonld');
111
- ImportSteps.checkUserDataImportedResource(1, 'bnodes.ttl');
120
+ ImportUserDataSteps.getResources().should('have.length', 2);
121
+ ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
122
+ ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
112
123
  // And the files should really be there
113
124
  MainMenuSteps.openHomePage();
114
- ImportSteps.visit();
115
- ImportSteps.getUserDataUploadedFiles().should('have.length', 2);
125
+ ImportUserDataSteps.visit();
126
+ ImportUserDataSteps.getResources().should('have.length', 2);
116
127
  });
117
128
 
118
129
  it('Should be able to override a single file', () => {
119
130
  // Given I have uploaded a file
120
- ImportSteps.getUserDataUploadedFilesTable().should('be.hidden');
121
- const file1 = ImportSteps.createFile(testFiles[0], bnodes);
122
- ImportSteps.selectFile(file1);
131
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
132
+ const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
133
+ ImportUserDataSteps.selectFile(file1);
123
134
  ImportSettingsDialogSteps.import();
124
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
125
- ImportSteps.checkUserDataImportedResource(0, 'bnodes.ttl');
135
+ ImportUserDataSteps.getResources().should('have.length', 1);
136
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
126
137
  // When I upload a file with the same name
127
- ImportSteps.selectFile(file1);
138
+ ImportUserDataSteps.selectFile(file1);
128
139
  // Then I should see a file override confirmation dialog
129
140
  ModalDialogSteps.getDialog().should('be.visible');
130
141
  // When I confirm the file override
@@ -132,52 +143,52 @@ describe('Import user data: File upload', () => {
132
143
  // Then the import settings dialog should open automatically
133
144
  ImportSettingsDialogSteps.import();
134
145
  // Then The file should be overridden
135
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
136
- ImportSteps.checkUserDataImportedResource(0, 'bnodes.ttl');
146
+ ImportUserDataSteps.getResources().should('have.length', 1);
147
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
137
148
  });
138
149
 
139
150
  it('Should be able to upload file with same name and preserve the existing file', () => {
140
151
  // Given I have uploaded a file
141
- ImportSteps.getUserDataUploadedFilesTable().should('be.hidden');
142
- const file1 = ImportSteps.createFile(testFiles[0], bnodes);
143
- ImportSteps.selectFile(file1);
152
+ ImportUserDataSteps.getResourcesTable().should('be.hidden');
153
+ const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
154
+ ImportUserDataSteps.selectFile(file1);
144
155
  ImportSettingsDialogSteps.import();
145
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
146
- ImportSteps.checkUserDataImportedResource(0, 'bnodes.ttl');
156
+ ImportUserDataSteps.getResources().should('have.length', 1);
157
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
147
158
  // When I upload a file with the same name
148
- ImportSteps.selectFile(file1);
159
+ ImportUserDataSteps.selectFile(file1);
149
160
  // Then I should see a file override confirmation dialog
150
161
  ModalDialogSteps.getDialog().should('be.visible');
151
162
  // When I cancel the file override
152
163
  ModalDialogSteps.clickOnCancelButton();
153
164
  ImportSettingsDialogSteps.import();
154
165
  // Then The file should not be overridden but prefixed instead
155
- ImportSteps.getUserDataUploadedFiles().should('have.length', 2);
156
- ImportSteps.checkUserDataImportedResource(0, 'bnodes-0.ttl');
157
- ImportSteps.checkUserDataImportedResource(1, 'bnodes.ttl');
166
+ ImportUserDataSteps.getResources().should('have.length', 2);
167
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes-0.ttl');
168
+ ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
158
169
  // When I upload two files, one with the same name and second new one
159
- const file2 = ImportSteps.createFile(testFiles[1], jsonld);
160
- ImportSteps.selectFile([file1, file2]);
170
+ const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
171
+ ImportUserDataSteps.selectFile([file1, file2]);
161
172
  ModalDialogSteps.getDialog().should('be.visible');
162
173
  ModalDialogSteps.clickOnCancelButton();
163
174
  ImportSettingsDialogSteps.import();
164
175
  // Then The file should not be overridden but prefixed with increased index instead
165
- ImportSteps.getUserDataUploadedFiles().should('have.length', 4);
166
- ImportSteps.checkUserDataImportedResource(0, 'jsonld.jsonld');
167
- ImportSteps.checkUserDataImportedResource(1, 'bnodes-1.ttl');
168
- ImportSteps.checkUserDataImportedResource(2, 'bnodes-0.ttl');
169
- ImportSteps.checkUserDataImportedResource(3, 'bnodes.ttl');
176
+ ImportUserDataSteps.getResources().should('have.length', 4);
177
+ ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
178
+ ImportUserDataSteps.checkImportedResource(1, 'bnodes-1.ttl');
179
+ ImportUserDataSteps.checkImportedResource(2, 'bnodes-0.ttl');
180
+ ImportUserDataSteps.checkImportedResource(3, 'bnodes.ttl');
170
181
  });
171
182
 
172
183
  it('should see error message when uploaded file has invalid format', () => {
173
184
  // Given I don't have any files uploaded yet
174
185
 
175
186
  // When I upload a file with invalid format
176
- const file1 = ImportSteps.createFile(testFiles[2], jsonld);
177
- ImportSteps.selectFile(file1);
187
+ const file1 = ImportUserDataSteps.createFile(testFiles[2], jsonld);
188
+ ImportUserDataSteps.selectFile(file1);
178
189
  ImportSettingsDialogSteps.import();
179
190
  // Then I should see an error message
180
- ImportSteps.getUserDataUploadedFiles().should('have.length', 1);
181
- ImportSteps.checkUserDataImportedResource(0, 'invalid-format.json', 'RDF Parse Error: Invalid file format');
191
+ ImportUserDataSteps.getResources().should('have.length', 1);
192
+ ImportUserDataSteps.checkImportedResource(0, 'invalid-format.json', 'RDF Parse Error: Invalid file format');
182
193
  });
183
194
  });
@@ -1,5 +1,4 @@
1
- import ImportSteps from "../../steps/import/import-steps";
2
- import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
1
+ import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
3
2
 
4
3
  const bnodes = `_:node0 <http://purl.org/dc/elements/1.1/title> "A new book" ;
5
4
  \t<http://purl.org/dc/elements/1.1/creator> "A.N.Other" .`;
@@ -24,7 +23,7 @@ describe('Import user data: Import settings dialog', () => {
24
23
  repositoryId = 'user-import-' + Date.now();
25
24
  cy.createRepository({id: repositoryId});
26
25
  cy.presetRepository(repositoryId);
27
- ImportSteps.visitImport('user', repositoryId);
26
+ ImportUserDataSteps.visitImport('user', repositoryId);
28
27
  });
29
28
 
30
29
  afterEach(() => {