From 8c8dc82cd45ade9ccaa00a2295af8fc80afa07d5 Mon Sep 17 00:00:00 2001 From: Mariia Pukhliakova <mariia.pukhliakova@id.ethz.ch> Date: Tue, 6 Oct 2020 16:00:47 +0200 Subject: [PATCH] SSDM-8847 make js-test work with eln --- js-test/build.gradle | 10 +++++++ .../webapps/openbis-test/html/openbis-test.js | 29 ++++++++++--------- .../html/test/test-create.js | 6 ++-- .../html/test/test-dss-services.js | 15 +++++----- .../openbis-v3-api-test/html/test/test-get.js | 4 +-- .../html/test/test-search.js | 22 +++++++------- .../html/test/test-update.js | 8 ++--- 7 files changed, 54 insertions(+), 40 deletions(-) diff --git a/js-test/build.gradle b/js-test/build.gradle index 6cd2a8b2898..ab34e39075c 100644 --- a/js-test/build.gradle +++ b/js-test/build.gradle @@ -57,6 +57,16 @@ task copyWar(type: Copy, dependsOn: project(':openbis_standard_technologies').wa rename {filename -> 'openbis.war'} } +task deleteXlsImportVersionInfoJson { + doFirst { + println "DELETE xls-import-version-info.json file in $buildDir" + File file = file('xls-import-version-info.json') + file.delete(); + } +} + +clean.dependsOn deleteXlsImportVersionInfoJson + test { useTestNG() options.suites('source/java/tests.xml') diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js index 527eac2ad85..030a4779477 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js @@ -426,7 +426,7 @@ test("listNamedRoleSets()", function() { test("listSpacesWithProjectsAndRoleAssignments()", function() { createFacadeAndLogin(function(facade) { facade.listSpacesWithProjectsAndRoleAssignments(null, function(response) { - assertObjectsCount(response.result, 2); + assertObjectsCount(response.result, 10); facade.close(); }); }); @@ -708,7 +708,7 @@ test("getDataStoreBaseURLs()", function() { test("listDataSetTypes()", function() { createFacadeAndLogin(function(facade) { facade.listDataSetTypes(function(response) { - assertObjectsCount(response.result, 28); + assertObjectsCount(response.result, 38); facade.close(); }); }); @@ -717,7 +717,7 @@ test("listDataSetTypes()", function() { test("listSampleTypes()", function() { createFacadeAndLogin(function(facade) { facade.listSampleTypes(function(response) { - assertObjectsCount(response.result, 13); + assertObjectsCount(response.result, 39); facade.close(); }); }); @@ -726,7 +726,7 @@ test("listSampleTypes()", function() { test("listExperimentTypes()", function() { createFacadeAndLogin(function(facade) { facade.listExperimentTypes(function(response) { - assertObjectsCount(response.result, 5); + assertObjectsCount(response.result, 7); facade.close(); }); }); @@ -735,7 +735,7 @@ test("listExperimentTypes()", function() { test("listVocabularies()", function() { createFacadeAndLogin(function(facade) { facade.listVocabularies(function(response) { - assertObjectsCount(response.result, 25); + assertObjectsCount(response.result, 60); facade.close(); }); }); @@ -1025,9 +1025,9 @@ test("listAvailableSearchDomains()", function() { createFacadeAndLogin(function(facade) { facade.listAvailableSearchDomains(function(response) { - assertObjectsCount(response.result, 2); - assertObjectsWithValues(response.result, 'name', [ "echo-database" ]); - assertObjectsWithValues(response.result, 'label', [ "Echo database" ]); + assertObjectsCount(response.result, 4); + assertObjectsWithValues(response.result, 'name', [ "blastsearch", "echo-database" ]); + assertObjectsWithValues(response.result, 'label', [ "Blast", "Echo database" ]); facade.close(); }); }); @@ -1125,8 +1125,11 @@ test("searchForExperiments() withModifierUserId", function() { test("listProjects()", function() { createFacadeAndLogin(function(facade) { facade.listProjects(function(response) { - assertObjectsCount(response.result, 2); - assertObjectsWithCodes(response.result, [ "SCREENING-EXAMPLES", "TEST-PROJECT" ]); + assertObjectsCount(response.result, 19); + assertObjectsWithCodes(response.result, ["BACTERIA", "CELL_LINES", "DEFAULT_PROJECT", "FLIES", "ORDERS", + "PLANTS", "PLASMIDS", "POLYNUCLEOTIDES", "PRODUCTS", "PROTOCOLS", + "PUBLIC_REPOSITORIES", "REAGENTS", "REQUESTS", "SCREENING-EXAMPLES", + "STORAGES", "SUPPLIERS", "TEMPLATES", "TEST-PROJECT", "YEASTS" ]); facade.close(); }); }); @@ -1339,7 +1342,7 @@ test("createMetaproject(), addToMetaproject(), removeFromMetaproject()", functio var assignmentsIds = { "@type" : "MetaprojectAssignmentsIds", - "samples" : [ createSampleIdentifierId("/PLATONIC/PLATE-1") ] + "samples" : [ createSampleIdentifierId("/PLATONIC/SCREENING-EXAMPLES/PLATE-1") ] }; facade.addToMetaproject(metaprojectId, assignmentsIds, function(response) { @@ -1388,7 +1391,7 @@ test("listAttachmentsForExperiment()", function() { test("listAttachmentsForSample()", function() { createFacadeAndLogin(function(facade) { - var sampleId = createSampleIdentifierId("/TEST/TEST-SAMPLE-2"); + var sampleId = createSampleIdentifierId("/TEST/TEST-PROJECT/TEST-SAMPLE-2"); facade.listAttachmentsForSample(sampleId, false, function(response) { assertObjectsCount(response.result, 1); @@ -1523,7 +1526,7 @@ test("createReportFromDataSets()", function() { test("listAggregationServices()", function() { createFacadeAndLogin(function(facade) { facade.listAggregationServices(function(response) { - assertObjectsCount(response.result, 6); + assertObjectsCount(response.result, 18); facade.close(); }); }); diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-create.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-create.js index d34ba2df9dd..009c489695f 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-create.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-create.js @@ -196,7 +196,7 @@ define( c.assertEqual(experiment.getProject().getSpace().getCode(), "TEST", "Space code"); c.assertEqual(experiment.getProperties()[propertyTypeCodeSample], "20130412140147735-20", "Sample property id"); c.assertEqual(experiment.getProperties()[propertyTypeCodeDate], "2013-04-12", "Date property"); - c.assertEqual(experiment.getSampleProperties()[propertyTypeCodeSample].getIdentifier().getIdentifier(), "/PLATONIC/PLATE-1", "Sample property"); + c.assertEqual(experiment.getSampleProperties()[propertyTypeCodeSample].getIdentifier().getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-1", "Sample property"); } testCreate(c, fCreate, c.findExperiment, fCheck); @@ -364,7 +364,7 @@ define( c.assertEqual(sample.getCode(), code, "Sample code"); c.assertEqual(sample.getType().getCode(), sampleTypeCode, "Type code"); c.assertEqual(sample.getSpace().getCode(), "TEST", "Space code"); - c.assertEqual(sample.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/PLATE-1", "Sample property"); + c.assertEqual(sample.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-1", "Sample property"); c.assertEqual(sample.getProperties()[propertyTypeCode], "20130412140147735-20", "Sample property id"); } @@ -540,7 +540,7 @@ define( c.assertEqual(dataSet.getCode(), code, "Data set code"); c.assertEqual(dataSet.getType().getCode(), dataSetTypeCode, "Type code"); c.assertEqual(dataSet.getProperties()[propertyTypeCode], "20130412140147735-20", "Sample property id"); - c.assertEqual(dataSet.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/PLATE-1", "Sample property"); + c.assertEqual(dataSet.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-1", "Sample property"); } testCreate(c, fCreate, c.findDataSet, fCheck); diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dss-services.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dss-services.js index 12c5ee36e49..b196b4cb932 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dss-services.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dss-services.js @@ -53,15 +53,15 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' } var fCheck = function(facade, result) { - c.assertEqual(result.getTotalCount(), 2, "Number of results"); - c.assertEqual(result.getObjects().length, 2, "Number of results"); + c.assertEqual(result.getTotalCount(), 4, "Number of results"); + c.assertEqual(result.getObjects().length, 4, "Number of results"); var objects = result.getObjects(); objects.sort(function(o1, o2) { return o1.getPermId().toString().localeCompare(o2.getPermId().toString())}); - c.assertEqual(objects[0].getPermId().toString(), "DSS1:echo-database", "Perm id"); - c.assertEqual(objects[0].getName(), "echo-database", "Name"); - c.assertEqual(objects[0].getLabel(), "Echo database", "Label"); - c.assertEqual(objects[0].getPossibleSearchOptionsKey(), "optionsKey", "Possible searcg option keys"); - c.assertEqual(objects[0].getPossibleSearchOptions().toString(), "Alpha [alpha],beta [beta]", "Possible search options"); + c.assertEqual(objects[1].getPermId().toString(), "DSS1:echo-database", "Perm id"); + c.assertEqual(objects[1].getName(), "echo-database", "Name"); + c.assertEqual(objects[1].getLabel(), "Echo database", "Label"); + c.assertEqual(objects[1].getPossibleSearchOptionsKey(), "optionsKey", "Possible searcg option keys"); + c.assertEqual(objects[1].getPossibleSearchOptions().toString(), "Alpha [alpha],beta [beta]", "Possible search options"); } testAction(c, fAction, fCheck); @@ -72,6 +72,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fAction = function(facade) { var options = new c.SearchDomainServiceExecutionOptions(); + options.withPreferredSearchDomain("echo-database"); options.withSearchString("key").withParameter("key", JSON.stringify({ "searchDomain" : "Echo database", diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-get.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-get.js index a6702146e7f..842db200957 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-get.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-get.js @@ -813,7 +813,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' QUnit.test("getRights()", function(assert) { var c = new common(assert); - var sampleId = new c.SampleIdentifier("/PLATONIC/PLATE-2"); + var sampleId = new c.SampleIdentifier("/PLATONIC/SCREENING-EXAMPLES/PLATE-2"); c.start(); c.createFacadeAndLogin().then(function(facade) { @@ -835,7 +835,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' return facade.getServerInformation().then(function(serverInformation) { c.assertTrue(serverInformation != null); c.assertEqual(serverInformation["api-version"], "3.5", "api-version"); - c.assertEqual(serverInformation["project-samples-enabled"], "false", "project-samples-enabled"); + c.assertEqual(serverInformation["project-samples-enabled"], "true", "project-samples-enabled"); c.finish(); }); }).fail(function(error) { diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js index fc445fb0c2a..d4ca22b0beb 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js @@ -336,7 +336,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' testSearchWithPagingAndSorting(c, function(facade) { return facade.searchExperiments(criteria, fo); - }, fo, "code", null, true, "EXP-1"); + }, fo, "code", null, true, "DEFAULT_EXPERIMENT"); }); QUnit.test("searchExperiments() with sorting by identifier", function(assert) { @@ -740,7 +740,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var criteria = new c.SampleSearchCriteria(); criteria.withOrOperator(); - criteria.withId().thatEquals(new c.SampleIdentifier("/PLATONIC/PLATE-1")); + criteria.withId().thatEquals(new c.SampleIdentifier("/PLATONIC/SCREENING-EXAMPLES/PLATE-1")); criteria.withId().thatEquals(new c.SampleIdentifier("/TEST/TEST-SAMPLE-1")); var fo = c.createSampleFetchOptions(); @@ -755,7 +755,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var criteria = new c.SampleSearchCriteria(); criteria.withOrOperator(); - criteria.withId().thatEquals(new c.SampleIdentifier("/PLATONIC/PLATE-1")); + criteria.withId().thatEquals(new c.SampleIdentifier("/PLATONIC/SCREENING-EXAMPLES/PLATE-1")); criteria.withId().thatEquals(new c.SampleIdentifier("/TEST/TEST-SAMPLE-1")); var fo = c.createSampleFetchOptions(); @@ -802,13 +802,13 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fSearch = function(facade) { var criteria = new c.SampleSearchCriteria(); - criteria.withIdentifier().thatEquals("/PLATONIC/PLATE-1"); + criteria.withIdentifier().thatEquals("/PLATONIC/SCREENING-EXAMPLES/PLATE-1"); return facade.searchSamples(criteria, c.createSampleFetchOptions()); } var fCheck = function(facade, samples) { c.assertEqual(samples.length, 1); - c.assertEqual(samples[0].getIdentifier(), "/PLATONIC/PLATE-1"); + c.assertEqual(samples[0].getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-1"); } testSearch(c, fSearch, fCheck); @@ -843,7 +843,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fCheck = function(facade, samples) { identifiers = c.extractIdentifiers(samples); c.assertEqual(identifiers.length, 4); - c.assertEqual(identifiers.toString(), "/PLATONIC/PLATE-1:A1,/PLATONIC/PLATE-2:A1,/TEST/PLATE-1A:A1,/TEST/PLATE-2:A1"); + c.assertEqual(identifiers.toString(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-1:A1,/PLATONIC/SCREENING-EXAMPLES/PLATE-2:A1,/TEST/TEST-PROJECT/PLATE-1A:A1,/TEST/TEST-PROJECT/PLATE-2:A1"); } testSearch(c, fSearch, fCheck); @@ -862,7 +862,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fCheck = function(facade, samples) { identifiers = c.extractIdentifiers(samples); c.assertEqual(identifiers.length, 1); - c.assertEqual(identifiers.toString(), "/TEST/TEST-SAMPLE-2-PARENT"); + c.assertEqual(identifiers.toString(), "/TEST/TEST-PROJECT/TEST-SAMPLE-2-PARENT"); } testSearch(c, fSearch, fCheck); @@ -881,7 +881,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fCheck = function(facade, samples) { identifiers = c.extractIdentifiers(samples); c.assertEqual(identifiers.length, 2); - c.assertEqual(identifiers.toString(), "/TEST/TEST-SAMPLE-2-CHILD-2,/TEST/TEST-SAMPLE-2-PARENT"); + c.assertEqual(identifiers.toString(), "/TEST/TEST-PROJECT/TEST-SAMPLE-2-CHILD-2,/TEST/TEST-PROJECT/TEST-SAMPLE-2-PARENT"); } testSearch(c, fSearch, fCheck); @@ -1700,7 +1700,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' if (samplePermId === "20130412140147735-20") { prepopulatedSamplesCount++; } - c.assertTrue(result.getObjectIdentifier().getIdentifier() === "/PLATONIC/PLATE-1" || + c.assertTrue(result.getObjectIdentifier().getIdentifier() === "/PLATONIC/SCREENING-EXAMPLES/PLATE-1" || result.getObjectIdentifier().getIdentifier().startsWith("/TEST/V3_SAMPLE_"), "ObjectIdentifier"); c.assertTrue(match === "Perm ID: " + samplePermId || @@ -1839,7 +1839,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fSearch = function(facade) { var criteria = new c.PluginSearchCriteria(); - criteria.withName().thatContains("e"); + criteria.withName().thatContains("Has"); criteria.withPluginType().thatEquals(c.PluginType.ENTITY_VALIDATION); var fo = c.createPluginFetchOptions(); fo.withScript(); @@ -1948,7 +1948,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' codes.push(vocabularies[i].getCode()); } codes.sort(); - c.assertEqual(codes.toString(), "AGILENT_KIT,KIT,SAMPLE_TYPE", "Vocabularies"); + c.assertEqual(codes.toString(), "$STORAGE.STORAGE_VALIDATION_LEVEL,AGILENT_KIT,KIT,SAMPLE_TYPE", "Vocabularies"); } testSearch(c, fSearch, fCheck); diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-update.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-update.js index 6043911644f..5ff2321363b 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-update.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-update.js @@ -368,7 +368,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' c.assertEqual(experiment.getType().getCode(), experimentTypeCode, "Type code"); c.assertEqual(experiment.getProject().getCode(), "TEST-PROJECT", "Project code"); c.assertEqual(experiment.getProject().getSpace().getCode(), "TEST", "Space code"); - c.assertEqual(experiment.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/PLATE-2", "Sample property"); + c.assertEqual(experiment.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-2", "Sample property"); c.assertEqual(experiment.getHistory()[0].getPropertyName(), propertyTypeCode, "Previous sample property name"); c.assertEqual(experiment.getHistory()[0].getPropertyValue(), "20130412140147735-20", "Previous sample property value"); } @@ -490,7 +490,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var c = new common(assert, openbis); var code = c.generateId("SAMPLE"); var parentId = new c.SampleIdentifier("/TEST/TEST-SAMPLE-1"); - var childId = new c.SampleIdentifier("/TEST/TEST-SAMPLE-2"); + var childId = new c.SampleIdentifier("/TEST/TEST-PROJECT/TEST-SAMPLE-2"); var fCreate = function(facade) { var creation = new c.SampleCreation(); @@ -577,7 +577,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' c.assertEqual(sample.getCode(), code, "Sample code"); c.assertEqual(sample.getType().getCode(), sampleTypeCode, "Type code"); c.assertEqual(sample.getSpace().getCode(), "TEST", "Space code"); - c.assertEqual(sample.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/PLATE-2", "Sample property"); + c.assertEqual(sample.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-2", "Sample property"); c.assertEqual(sample.getHistory()[0].getPropertyName(), propertyTypeCode, "Previous sample property name"); c.assertEqual(sample.getHistory()[0].getPropertyValue(), "20130412140147735-20", "Previous sample property value"); } @@ -775,7 +775,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', ' var fCheck = function(dataSet) { c.assertEqual(dataSet.getCode(), code, "Data set code"); c.assertEqual(dataSet.getType().getCode(), dataSetTypeCode, "Type code"); - c.assertEqual(dataSet.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/PLATE-2", "Sample property"); + c.assertEqual(dataSet.getSampleProperties()[propertyTypeCode].getIdentifier().getIdentifier(), "/PLATONIC/SCREENING-EXAMPLES/PLATE-2", "Sample property"); c.assertEqual(dataSet.getHistory()[0].getPropertyName(), propertyTypeCode, "Previous sample property name"); c.assertEqual(dataSet.getHistory()[0].getPropertyValue(), "20130412140147735-20", "Previous sample property value"); } -- GitLab