diff --git a/docker-compose.yml b/docker-compose.yml index f67c855d3..8cb6a33c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,8 @@ services: -Dgraphdb.workbench.importDirectory=/opt/home/import-data/ -Dgraphdb.jsonld.whitelist=https://w3c.github.io/json-ld-api/tests/* -Dgraphdb.stats.default=disabled + -Dgraphdb.foreground= + -Dgraphdb.logger.root.level=ERROR expose: - 7200 volumes: diff --git a/docker-rootfs/usr/local/bin/start-workbench.sh b/docker-rootfs/usr/local/bin/start-workbench.sh index be21655e7..cdbd28e94 100644 --- a/docker-rootfs/usr/local/bin/start-workbench.sh +++ b/docker-rootfs/usr/local/bin/start-workbench.sh @@ -9,4 +9,4 @@ mv /etc/nginx/conf.d/default.conf.tmp /etc/nginx/conf.d/default.conf # Tests & prints the whole configuration (easy to debug issues) nginx -T -nginx -g "daemon off;" +nginx -g "daemon off;" > /dev/null diff --git a/src/pages/import.html b/src/pages/import.html index 9b98c32fd..1ea3bbdf2 100644 --- a/src/pages/import.html +++ b/src/pages/import.html @@ -59,13 +59,15 @@

ngf-max-size="maxUploadFileSizeMB + 'MB'">
-
+ +
+
diff --git a/test-cypress/integration/import/import-user-data-file-upload.spec.js b/test-cypress/integration/import/import-user-data-file-upload.spec.js index 2f2f9ae19..d1f027d4c 100644 --- a/test-cypress/integration/import/import-user-data-file-upload.spec.js +++ b/test-cypress/integration/import/import-user-data-file-upload.spec.js @@ -99,11 +99,14 @@ describe('Import user data: File upload', () => { ImportUserDataSteps.getResourcesTable().should('be.hidden'); // When I upload a file ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes)); + // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); // Then I should see the uploaded file ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl'); // When I upload another file ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld)); + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); // Then I should see the uploaded file - it becomes first in the list ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld'); @@ -111,6 +114,7 @@ describe('Import user data: File upload', () => { // When I override the first file ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes)); FileOverwriteDialogSteps.overwrite(); + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); // Then I should see the uploaded file - it becomes first in the list // TODO: timestamps currently seems to not be changed on reimport @@ -119,6 +123,7 @@ describe('Import user data: File upload', () => { // When I override the second file ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld)); FileOverwriteDialogSteps.overwrite(); + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); // Then I should see the uploaded file - it becomes first in the list ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld'); @@ -131,6 +136,7 @@ describe('Import user data: File upload', () => { // When I start to upload a file ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes)); // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.uploadOnly(); // Then I should see the uploaded file ImportUserDataSteps.getResources().should('have.length', 1); @@ -149,6 +155,7 @@ describe('Import user data: File upload', () => { const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld); ImportUserDataSteps.selectFile([file1, file2]); // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); // Then I should see the uploaded file ImportUserDataSteps.getResources().should('have.length', 2); @@ -165,6 +172,8 @@ describe('Import user data: File upload', () => { ImportUserDataSteps.getResourcesTable().should('be.hidden'); const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes); ImportUserDataSteps.selectFile(file1); + // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); ImportUserDataSteps.getResources().should('have.length', 1); ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl'); @@ -186,6 +195,8 @@ describe('Import user data: File upload', () => { ImportUserDataSteps.getResourcesTable().should('be.hidden'); const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes); ImportUserDataSteps.selectFile(file1); + // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); ImportUserDataSteps.getResources().should('have.length', 1); ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl'); @@ -220,6 +231,8 @@ describe('Import user data: File upload', () => { // When I upload a file with invalid format const file1 = ImportUserDataSteps.createFile(testFiles[2], jsonld); ImportUserDataSteps.selectFile(file1); + // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); // Then I should see an error message ImportUserDataSteps.getResources().should('have.length', 1); diff --git a/test-cypress/integration/import/import-view.spec.js b/test-cypress/integration/import/import-view.spec.js index 168983f12..93cd3ccd8 100644 --- a/test-cypress/integration/import/import-view.spec.js +++ b/test-cypress/integration/import/import-view.spec.js @@ -31,6 +31,8 @@ describe('Import view', () => { // Given I have opened the user data tab and uploaded a single file ImportUserDataSteps.getResourcesTable().should('be.hidden'); ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes)); + // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); ImportUserDataSteps.getResources().should('have.length', 1); ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible'); @@ -43,6 +45,7 @@ describe('Import view', () => { // Then I should see the uploaded file ImportUserDataSteps.getResources().should('have.length', 1); ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible'); + ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl'); }); it('Should display/hide help message depends on resource result', () => { @@ -99,8 +102,9 @@ describe('Import view', () => { // When I go to user tab and upload a file ImportSteps.openUserDataTab(); // And I wait for tab data to load - cy.wait(100); ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes)); + // Then the import settings dialog should open automatically + ImportSettingsDialogSteps.getDialog().should('be.visible'); ImportSettingsDialogSteps.import(); ImportUserDataSteps.getResources().should('have.length', 1); ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl'); diff --git a/test-cypress/integration/repository/repositories.spec.js b/test-cypress/integration/repository/repositories.spec.js index 44188cc98..73c6784d4 100644 --- a/test-cypress/integration/repository/repositories.spec.js +++ b/test-cypress/integration/repository/repositories.spec.js @@ -420,13 +420,7 @@ describe('Repositories', () => { HomeSteps.visitAndWaitLoader(); cy.visit('/repository'); - // Verify that the repositories are loaded - // and only afterwards continue with the check - cy.get('#wb-repositories-repositoryInGetRepositories .repository') - .should('have.length.greaterThan', 0) - .then(() => { - RepositorySteps.assertRepositoryStatus(repositoryId, "RUNNING"); - }); + RepositorySteps.assertRepositoryStatus(repositoryId, "RUNNING"); //Restart the repository RepositorySteps.restartRepository(repositoryId); diff --git a/test-cypress/package.json b/test-cypress/package.json index 00f6f3a0f..88508540d 100644 --- a/test-cypress/package.json +++ b/test-cypress/package.json @@ -10,7 +10,7 @@ "test": "cypress run", "test:flaky": "cypress run --config-file cypress-flaky.config.js", "test:partial": "cypress run --spec \"integration/repository/**\"", - "test:core": "cypress run --spec integration/repository/**,integration/import/**,integration/sparql-editor/**,integration/monitor/**,integration/cluster/**" + "test:core": "cypress run --spec integration/repository/**,integration/import/**,integration/sparql-editor/**,integration/monitor/**,integration/cluster/**,integration/ttyg/**" }, "author": { "name": "\"Sirma AI\" JSC, trading as Ontotext", diff --git a/test-cypress/steps/import/import-steps.js b/test-cypress/steps/import/import-steps.js index 110ba84e7..f67e59e82 100644 --- a/test-cypress/steps/import/import-steps.js +++ b/test-cypress/steps/import/import-steps.js @@ -292,7 +292,7 @@ class ImportSteps { } static selectFile(files) { - cy.get('input[type=file]').selectFile(files, {force: true}); + cy.get('#wb-import-uploadFile label').selectFile(files); } static uploadFile(filePath) { diff --git a/test-cypress/steps/repository-steps.js b/test-cypress/steps/repository-steps.js index 05ee6340c..766d1e9b9 100644 --- a/test-cypress/steps/repository-steps.js +++ b/test-cypress/steps/repository-steps.js @@ -268,11 +268,8 @@ export class RepositorySteps { } static assertRepositoryStatus(repositoryId, status) { - cy.waitUntil(() => - RepositorySteps.getRepositoryFromList(repositoryId) - .should('be.visible') - .find('.repository-status .text-secondary') - .then(($el) => $el) - .then(($el) => $el && $el.text() === status)); + RepositorySteps.getRepositoryFromList(repositoryId).as('repo'); + cy.get('@repo').should('be.visible'); + cy.get('@repo').find('.repository-status .text-secondary').contains(status); } }