graphdb-workbench-tests 2.7.0-TR6 → 2.7.0-TR7
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.
- package/fixtures/graphdb-import/more-files/jsonld-file.jsonld +8 -0
- package/fixtures/graphdb-import/more-files/rdfxml.rdf +15 -0
- package/fixtures/locale-en.json +6 -4
- package/integration/import/import-server-files.spec.js +53 -82
- package/integration/import/import-user-data-file-upload.spec.js +61 -61
- package/integration/import/import-user-data-settings-dialog.spec.js +2 -3
- package/integration/import/import-user-data-text-snippet.spec.js +119 -209
- package/integration/import/import-user-data-url.spec.js +28 -32
- package/integration/import/import-user-data.spec.js +42 -43
- package/integration/import/import-view.spec.js +12 -11
- package/integration/monitor/global-operation-statuses-component.spec.js +2 -2
- package/integration/repository/repositories.spec.js +15 -14
- package/integration/setup/sparql-template-create.js +4 -4
- package/integration-flaky/import/import-server-files-batch-operations.spec.js +95 -0
- package/integration-flaky/import/import-server-files-operations.spec.js +142 -0
- package/{integration → integration-flaky}/import/import-user-data-batch-operations.spec.js +67 -66
- package/integration-flaky/import/import.server.files.spec.js +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/import/import-server-files-steps.js +36 -0
- package/steps/import/import-settings-dialog-steps.js +37 -0
- package/steps/import/import-steps.js +104 -185
- package/steps/import/import-user-data-steps.js +167 -0
|
@@ -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>
|
package/fixtures/locale-en.json
CHANGED
|
@@ -927,14 +927,15 @@
|
|
|
927
927
|
"show.files.only": "Show files only",
|
|
928
928
|
"show.files.directories": "Show both files and directories",
|
|
929
929
|
"show.directories.only": "Show directories only",
|
|
930
|
-
"type.to.filter": "Type to filter",
|
|
930
|
+
"type.to.filter": "Type to filter by name",
|
|
931
931
|
"selected.items": "Import the selected items",
|
|
932
932
|
"without.changing.settings": "Import without changing settings",
|
|
933
933
|
"reset.last.imported": "Reset the last imported status of the selected items",
|
|
934
934
|
"reset.status": "Reset status",
|
|
935
935
|
"remove.selected": "Remove the selected items from the list",
|
|
936
936
|
"remove.btn": "Remove",
|
|
937
|
-
"
|
|
937
|
+
"import.btn": "Import",
|
|
938
|
+
"remove.confirm.msg": "Are you sure you want to remove selected files: {{name}}",
|
|
938
939
|
"mode.not.supported.constraint": "This mode is not supported when importing multiple items.",
|
|
939
940
|
"enable.replace.option": "Enable this to replace the data in one or more graphs with the imported data.",
|
|
940
941
|
"context.link": "JSON-LD context",
|
|
@@ -979,7 +980,7 @@
|
|
|
979
980
|
"the_property": "property"
|
|
980
981
|
},
|
|
981
982
|
"on_file_size_limit": {
|
|
982
|
-
"file_size_limit_info": "To import larger than {{fileSizeLimit}} MB, use the ",
|
|
983
|
+
"file_size_limit_info": "To import larger than {{fileSizeLimit}} MB files, use the ",
|
|
983
984
|
"server_files_link": "Server files",
|
|
984
985
|
"import_or_use": "import or use the",
|
|
985
986
|
"api_link": "API"
|
|
@@ -1003,7 +1004,8 @@
|
|
|
1003
1004
|
"interrupt_import": "Interrupt import",
|
|
1004
1005
|
"abort": "Abort"
|
|
1005
1006
|
}
|
|
1006
|
-
},
|
|
1007
|
+
},
|
|
1008
|
+
"status-info": {
|
|
1007
1009
|
"last_import_settings": "Last import settings",
|
|
1008
1010
|
"context": "Context",
|
|
1009
1011
|
"replaced_graphs": "Replaced graphs",
|
|
@@ -1,107 +1,78 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
|
|
2
|
+
import {ImportServerFilesSteps} from "../../steps/import/import-server-files-steps";
|
|
2
3
|
|
|
3
|
-
|
|
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
|
-
|
|
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('
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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('
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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('
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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('
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
30
|
+
ImportUserDataSteps.visitImport('user', repositoryId);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
afterEach(() => {
|
|
@@ -37,94 +37,94 @@ 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
|
-
|
|
40
|
+
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
41
41
|
// When I start to upload a file
|
|
42
|
-
|
|
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
|
-
|
|
49
|
-
|
|
48
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
49
|
+
ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
it('Should be able to upload and import files one after the other and then override them', () => {
|
|
53
53
|
// Given there are no files uploaded yet
|
|
54
|
-
|
|
54
|
+
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
55
55
|
// When I upload a file
|
|
56
|
-
|
|
56
|
+
ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
|
|
57
57
|
ImportSettingsDialogSteps.import();
|
|
58
58
|
// Then I should see the uploaded file
|
|
59
|
-
|
|
59
|
+
ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
|
|
60
60
|
// When I upload another file
|
|
61
|
-
|
|
61
|
+
ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld));
|
|
62
62
|
ImportSettingsDialogSteps.import();
|
|
63
63
|
// Then I should see the uploaded file - it becomes first in the list
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
|
|
65
|
+
ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
|
|
66
66
|
// When I override the first file
|
|
67
|
-
|
|
67
|
+
ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
|
|
68
68
|
ModalDialogSteps.clickOnConfirmButton();
|
|
69
69
|
ImportSettingsDialogSteps.import();
|
|
70
70
|
// Then I should see the uploaded file - it becomes first in the list
|
|
71
71
|
// TODO: timestamps currently seems to not be changed on reimport
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
|
|
73
|
+
ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
|
|
74
74
|
// When I override the second file
|
|
75
|
-
|
|
75
|
+
ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld));
|
|
76
76
|
ModalDialogSteps.clickOnConfirmButton();
|
|
77
77
|
ImportSettingsDialogSteps.import();
|
|
78
78
|
// Then I should see the uploaded file - it becomes first in the list
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
|
|
80
|
+
ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
it('should be able to only upload a single file without importing it', () => {
|
|
84
84
|
// Given there are no files uploaded yet
|
|
85
|
-
|
|
85
|
+
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
86
86
|
// When I start to upload a file
|
|
87
|
-
|
|
87
|
+
ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
|
|
88
88
|
// Then the import settings dialog should open automatically
|
|
89
89
|
ImportSettingsDialogSteps.cancelImport();
|
|
90
90
|
// Then I should see the uploaded file
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
92
|
+
ImportUserDataSteps.checkUserDataUploadedResource(0, 'bnodes.ttl');
|
|
93
93
|
// And the file should really be there
|
|
94
94
|
MainMenuSteps.openHomePage();
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
ImportUserDataSteps.visit();
|
|
96
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
97
97
|
});
|
|
98
98
|
|
|
99
99
|
it('Should be able to upload multiple unique files', () => {
|
|
100
100
|
// Given there are no files uploaded yet
|
|
101
|
-
|
|
101
|
+
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
102
102
|
// When I upload a file
|
|
103
|
-
const file1 =
|
|
104
|
-
const file2 =
|
|
105
|
-
|
|
103
|
+
const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
|
|
104
|
+
const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
|
|
105
|
+
ImportUserDataSteps.selectFile([file1, file2]);
|
|
106
106
|
// Then the import settings dialog should open automatically
|
|
107
107
|
ImportSettingsDialogSteps.import();
|
|
108
108
|
// Then I should see the uploaded file
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
ImportUserDataSteps.getResources().should('have.length', 2);
|
|
110
|
+
ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
|
|
111
|
+
ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
|
|
112
112
|
// And the files should really be there
|
|
113
113
|
MainMenuSteps.openHomePage();
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
ImportUserDataSteps.visit();
|
|
115
|
+
ImportUserDataSteps.getResources().should('have.length', 2);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
it('Should be able to override a single file', () => {
|
|
119
119
|
// Given I have uploaded a file
|
|
120
|
-
|
|
121
|
-
const file1 =
|
|
122
|
-
|
|
120
|
+
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
121
|
+
const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
|
|
122
|
+
ImportUserDataSteps.selectFile(file1);
|
|
123
123
|
ImportSettingsDialogSteps.import();
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
125
|
+
ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
|
|
126
126
|
// When I upload a file with the same name
|
|
127
|
-
|
|
127
|
+
ImportUserDataSteps.selectFile(file1);
|
|
128
128
|
// Then I should see a file override confirmation dialog
|
|
129
129
|
ModalDialogSteps.getDialog().should('be.visible');
|
|
130
130
|
// When I confirm the file override
|
|
@@ -132,52 +132,52 @@ describe('Import user data: File upload', () => {
|
|
|
132
132
|
// Then the import settings dialog should open automatically
|
|
133
133
|
ImportSettingsDialogSteps.import();
|
|
134
134
|
// Then The file should be overridden
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
136
|
+
ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
|
|
137
137
|
});
|
|
138
138
|
|
|
139
139
|
it('Should be able to upload file with same name and preserve the existing file', () => {
|
|
140
140
|
// Given I have uploaded a file
|
|
141
|
-
|
|
142
|
-
const file1 =
|
|
143
|
-
|
|
141
|
+
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
142
|
+
const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
|
|
143
|
+
ImportUserDataSteps.selectFile(file1);
|
|
144
144
|
ImportSettingsDialogSteps.import();
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
146
|
+
ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
|
|
147
147
|
// When I upload a file with the same name
|
|
148
|
-
|
|
148
|
+
ImportUserDataSteps.selectFile(file1);
|
|
149
149
|
// Then I should see a file override confirmation dialog
|
|
150
150
|
ModalDialogSteps.getDialog().should('be.visible');
|
|
151
151
|
// When I cancel the file override
|
|
152
152
|
ModalDialogSteps.clickOnCancelButton();
|
|
153
153
|
ImportSettingsDialogSteps.import();
|
|
154
154
|
// Then The file should not be overridden but prefixed instead
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
ImportUserDataSteps.getResources().should('have.length', 2);
|
|
156
|
+
ImportUserDataSteps.checkImportedResource(0, 'bnodes-0.ttl');
|
|
157
|
+
ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
|
|
158
158
|
// When I upload two files, one with the same name and second new one
|
|
159
|
-
const file2 =
|
|
160
|
-
|
|
159
|
+
const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
|
|
160
|
+
ImportUserDataSteps.selectFile([file1, file2]);
|
|
161
161
|
ModalDialogSteps.getDialog().should('be.visible');
|
|
162
162
|
ModalDialogSteps.clickOnCancelButton();
|
|
163
163
|
ImportSettingsDialogSteps.import();
|
|
164
164
|
// Then The file should not be overridden but prefixed with increased index instead
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
ImportUserDataSteps.getResources().should('have.length', 4);
|
|
166
|
+
ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
|
|
167
|
+
ImportUserDataSteps.checkImportedResource(1, 'bnodes-1.ttl');
|
|
168
|
+
ImportUserDataSteps.checkImportedResource(2, 'bnodes-0.ttl');
|
|
169
|
+
ImportUserDataSteps.checkImportedResource(3, 'bnodes.ttl');
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
it('should see error message when uploaded file has invalid format', () => {
|
|
173
173
|
// Given I don't have any files uploaded yet
|
|
174
174
|
|
|
175
175
|
// When I upload a file with invalid format
|
|
176
|
-
const file1 =
|
|
177
|
-
|
|
176
|
+
const file1 = ImportUserDataSteps.createFile(testFiles[2], jsonld);
|
|
177
|
+
ImportUserDataSteps.selectFile(file1);
|
|
178
178
|
ImportSettingsDialogSteps.import();
|
|
179
179
|
// Then I should see an error message
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
181
|
+
ImportUserDataSteps.checkImportedResource(0, 'invalid-format.json', 'RDF Parse Error: Invalid file format');
|
|
182
182
|
});
|
|
183
183
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
26
|
+
ImportUserDataSteps.visitImport('user', repositoryId);
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
afterEach(() => {
|