From 21dca08ea3fee4517f11e62ebdcf700ff6555f3c Mon Sep 17 00:00:00 2001 From: SumelRattan-eGov Date: Fri, 27 Jan 2023 12:13:17 +0530 Subject: [PATCH 1/2] filestore-metadata-tag-automation-script --- api-automation/envYaml/common/common.yaml | 3 ++ .../pretests/fileStoreMetadataPretest.feature | 48 ++++++++++++++++++ .../pretests/fileStoreTagPretest.feature | 50 +++++++++++++++++++ .../tests/FileStoreMetadata.feature | 18 +++++++ .../core-services/tests/FileStoreTag.feature | 18 +++++++ api-automation/src/test/java/karate-config.js | 6 +++ .../pretests/fileStoreMetadataPretest.feature | 48 ++++++++++++++++++ .../pretests/fileStoreTagPretest.feature | 50 +++++++++++++++++++ .../tests/FileStoreMetadata.feature | 18 +++++++ .../core-services/tests/FileStoreTag.feature | 18 +++++++ .../target/test-classes/karate-config.js | 6 +++ 11 files changed, 283 insertions(+) create mode 100644 api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature create mode 100644 api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature create mode 100644 api-automation/src/test/java/com/egov/core-services/tests/FileStoreMetadata.feature create mode 100644 api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature create mode 100644 api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature create mode 100644 api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature create mode 100644 api-automation/target/test-classes/com/egov/core-services/tests/FileStoreMetadata.feature create mode 100644 api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature diff --git a/api-automation/envYaml/common/common.yaml b/api-automation/envYaml/common/common.yaml index 8f46eb0..7de7a26 100644 --- a/api-automation/envYaml/common/common.yaml +++ b/api-automation/envYaml/common/common.yaml @@ -16,6 +16,8 @@ endPoints: fileStore: create: filestore/v1/files getFileId: filestore/v1/files/url + getMetadataId: filestore/v1/files/metadata + getFileTag: filestore/v1/files/tag citizen: create: user/users/_createnovalidate @@ -76,6 +78,7 @@ endPoints: pdfService: create: pdf-service/v1/_create? createNoSave: pdf-service/v1/_createnosave? + bulk: pdf-service/v1/_getBulkPdfRecordsDetails user: updateProfile: user/profile/_update diff --git a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature new file mode 100644 index 0000000..61cf2c5 --- /dev/null +++ b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature @@ -0,0 +1,48 @@ +Feature: Filestore Metadata API call + Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileContentTypeHeader = 'multipart/form-data;boundary=----WebKitFormBoundaryBDVBPRx02pZ7ePhq' + * def fileContentType = 'application/pdf' + * def commonConstants = read('../../common-services/constants/genericConstants.yaml') + * def module = commonConstants.parameters.module[0] + * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + + # calling upload single document file pretest + * call read('../../core-services/pretests/fileStoreCreate.feature@uploadDocumentsSuccessfully') + + * def getFileId = filecreateResponseBody.files[0].fileStoreId + + @getFilestoreMetadataSuccessfully + Scenario: get the filestore metadata successfully + * def getFileIdParam = + """ + { + tenantId: '#(tenantId)', + fileStoreIds: '#(fileStoreId)' + } + + """ + Given url fileStoreMetadata + And params getFileIdParam + When method get + Then status 200 + And def fileStoreMetadataResponseHeader = responseHeaders + And def fileStoreMetadataResponseBody = response + + @getFilestoreMetadataInvalidTenantId + Scenario: get the filestore metadata error + * def getFileIdParam = + """ + { + tenantId: '#(tenantId)', + fileStoreIds: '#(getFileIds)' + } + + """ + Given url fileStoreMetadata + And params getFileIdParam + When method get + Then status 400 + And def fileStoreMetadataResponseHeader = responseHeaders + And def fileStoreMetadataResponseBody = response \ No newline at end of file diff --git a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature new file mode 100644 index 0000000..8c4bf27 --- /dev/null +++ b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature @@ -0,0 +1,50 @@ +Feature: Filestore Tag API call + Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileContentTypeHeader = 'multipart/form-data;boundary=----WebKitFormBoundaryBDVBPRx02pZ7ePhq' + * def fileContentType = 'application/pdf' + * def commonConstants = read('../../common-services/constants/genericConstants.yaml') + * def module = commonConstants.parameters.module[0] + * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + + # calling upload single document file pretest + * call read('../../core-services/pretests/fileStoreCreate.feature@uploadDocumentsSuccessfully') + + * def getFileId = filecreateResponseBody.files[0].fileStoreId + + @getFilestoreTagSuccessfully + Scenario: get the filestore tag successfull + * def getFileIdParam = + """ + + { + tenantId: '#(tenantId)', + tag: '#(tag)' + } + + """ + Given url fileStoreTag + And param getFileIdParam + When method get + Then status 200 + And def fileStoreTagResponseHeader = responseHeaders + And def fileStoreTagResponseBody = response + + @getFilestoreIncorrectTag + Scenario: get the filestore incorrect tag + * def getFileIdParam = + """ + + { + tenantId: '#(tenantId)', + tag: '#(tag)' + } + + """ + Given url fileStoreTag + And param getFileIdParam + When method get + Then status 400 + And def fileStoreTagResponseHeader = responseHeaders + And def fileStoreTagResponseBody = response \ No newline at end of file diff --git a/api-automation/src/test/java/com/egov/core-services/tests/FileStoreMetadata.feature b/api-automation/src/test/java/com/egov/core-services/tests/FileStoreMetadata.feature new file mode 100644 index 0000000..27c485a --- /dev/null +++ b/api-automation/src/test/java/com/egov/core-services/tests/FileStoreMetadata.feature @@ -0,0 +1,18 @@ +Feature: File store Metadata +Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + + @Filestore_Metadata_01 @coreServices @regression @positive @fileStore + Scenario: Filestore metadata successfull + #Calling filestore metadata preset + * call read('../../core-services/pretests/fileStoreMetadataPretest.feature@getFilestoreMetadataSuccessfully') + + * match fileStoreMetadataResponseBody == '#present' + + @Filestore_Metadata_02 @coreServices @regression @negative @fileStore + Scenario: Filestore metadata invalid TenantId + #Calling filestore metadata preset + * call read('../../core-services/pretests/fileStoreMetadataPretest.feature@getFilestoreMetadataInvalidTenantId') + + * assert.fileStoreMetadataResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid \ No newline at end of file diff --git a/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature b/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature new file mode 100644 index 0000000..68fc900 --- /dev/null +++ b/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature @@ -0,0 +1,18 @@ +Feature: File store Tag + Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + +@FileStore_Tag_01 @coreServices @regression @positive @filestore + Scenario: Filestore tag successfull + #Calling tag preset + * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreTagSuccessfully') + + * match fileStoreTagResponseBody == '#present' + + @FileStore_Tag_02 @coreServices @regression @negative @filestore + Scenario: Filestore incorrect tag + #Calling tag preset + * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreIncorrectTag') + + * assert.fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid \ No newline at end of file diff --git a/api-automation/src/test/java/karate-config.js b/api-automation/src/test/java/karate-config.js index b0e1469..ec50103 100644 --- a/api-automation/src/test/java/karate-config.js +++ b/api-automation/src/test/java/karate-config.js @@ -121,6 +121,12 @@ function fn() { //Get file id config.fileStoreGet = envProps.host + path.endPoints.fileStore.getFileId; + //Get file metadata + config.fileStoreMetadata = envProps.host + path.endPoints.fileStore.getMetadataId; + + //Get file tag + config.fileStoreTag = envProps.host + path.endPoints.fileStore.getFileTag; + //Search location config.searchloc = envProps.host + path.endPoints.location.search; diff --git a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature new file mode 100644 index 0000000..61cf2c5 --- /dev/null +++ b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature @@ -0,0 +1,48 @@ +Feature: Filestore Metadata API call + Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileContentTypeHeader = 'multipart/form-data;boundary=----WebKitFormBoundaryBDVBPRx02pZ7ePhq' + * def fileContentType = 'application/pdf' + * def commonConstants = read('../../common-services/constants/genericConstants.yaml') + * def module = commonConstants.parameters.module[0] + * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + + # calling upload single document file pretest + * call read('../../core-services/pretests/fileStoreCreate.feature@uploadDocumentsSuccessfully') + + * def getFileId = filecreateResponseBody.files[0].fileStoreId + + @getFilestoreMetadataSuccessfully + Scenario: get the filestore metadata successfully + * def getFileIdParam = + """ + { + tenantId: '#(tenantId)', + fileStoreIds: '#(fileStoreId)' + } + + """ + Given url fileStoreMetadata + And params getFileIdParam + When method get + Then status 200 + And def fileStoreMetadataResponseHeader = responseHeaders + And def fileStoreMetadataResponseBody = response + + @getFilestoreMetadataInvalidTenantId + Scenario: get the filestore metadata error + * def getFileIdParam = + """ + { + tenantId: '#(tenantId)', + fileStoreIds: '#(getFileIds)' + } + + """ + Given url fileStoreMetadata + And params getFileIdParam + When method get + Then status 400 + And def fileStoreMetadataResponseHeader = responseHeaders + And def fileStoreMetadataResponseBody = response \ No newline at end of file diff --git a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature new file mode 100644 index 0000000..8c4bf27 --- /dev/null +++ b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature @@ -0,0 +1,50 @@ +Feature: Filestore Tag API call + Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileContentTypeHeader = 'multipart/form-data;boundary=----WebKitFormBoundaryBDVBPRx02pZ7ePhq' + * def fileContentType = 'application/pdf' + * def commonConstants = read('../../common-services/constants/genericConstants.yaml') + * def module = commonConstants.parameters.module[0] + * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + + # calling upload single document file pretest + * call read('../../core-services/pretests/fileStoreCreate.feature@uploadDocumentsSuccessfully') + + * def getFileId = filecreateResponseBody.files[0].fileStoreId + + @getFilestoreTagSuccessfully + Scenario: get the filestore tag successfull + * def getFileIdParam = + """ + + { + tenantId: '#(tenantId)', + tag: '#(tag)' + } + + """ + Given url fileStoreTag + And param getFileIdParam + When method get + Then status 200 + And def fileStoreTagResponseHeader = responseHeaders + And def fileStoreTagResponseBody = response + + @getFilestoreIncorrectTag + Scenario: get the filestore incorrect tag + * def getFileIdParam = + """ + + { + tenantId: '#(tenantId)', + tag: '#(tag)' + } + + """ + Given url fileStoreTag + And param getFileIdParam + When method get + Then status 400 + And def fileStoreTagResponseHeader = responseHeaders + And def fileStoreTagResponseBody = response \ No newline at end of file diff --git a/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreMetadata.feature b/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreMetadata.feature new file mode 100644 index 0000000..27c485a --- /dev/null +++ b/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreMetadata.feature @@ -0,0 +1,18 @@ +Feature: File store Metadata +Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + + @Filestore_Metadata_01 @coreServices @regression @positive @fileStore + Scenario: Filestore metadata successfull + #Calling filestore metadata preset + * call read('../../core-services/pretests/fileStoreMetadataPretest.feature@getFilestoreMetadataSuccessfully') + + * match fileStoreMetadataResponseBody == '#present' + + @Filestore_Metadata_02 @coreServices @regression @negative @fileStore + Scenario: Filestore metadata invalid TenantId + #Calling filestore metadata preset + * call read('../../core-services/pretests/fileStoreMetadataPretest.feature@getFilestoreMetadataInvalidTenantId') + + * assert.fileStoreMetadataResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid \ No newline at end of file diff --git a/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature b/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature new file mode 100644 index 0000000..68fc900 --- /dev/null +++ b/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature @@ -0,0 +1,18 @@ +Feature: File store Tag + Background: + * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') + * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') + +@FileStore_Tag_01 @coreServices @regression @positive @filestore + Scenario: Filestore tag successfull + #Calling tag preset + * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreTagSuccessfully') + + * match fileStoreTagResponseBody == '#present' + + @FileStore_Tag_02 @coreServices @regression @negative @filestore + Scenario: Filestore incorrect tag + #Calling tag preset + * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreIncorrectTag') + + * assert.fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid \ No newline at end of file diff --git a/api-automation/target/test-classes/karate-config.js b/api-automation/target/test-classes/karate-config.js index b0e1469..ec50103 100644 --- a/api-automation/target/test-classes/karate-config.js +++ b/api-automation/target/test-classes/karate-config.js @@ -121,6 +121,12 @@ function fn() { //Get file id config.fileStoreGet = envProps.host + path.endPoints.fileStore.getFileId; + //Get file metadata + config.fileStoreMetadata = envProps.host + path.endPoints.fileStore.getMetadataId; + + //Get file tag + config.fileStoreTag = envProps.host + path.endPoints.fileStore.getFileTag; + //Search location config.searchloc = envProps.host + path.endPoints.location.search; From b51d2471210d133a14c80081535373e36f63897b Mon Sep 17 00:00:00 2001 From: SumelRattan-eGov Date: Wed, 1 Mar 2023 14:59:48 +0530 Subject: [PATCH 2/2] updated-tag-test-cases --- .../constants/genericConstants.yaml | 3 + .../core-services/constants/fileStore.yaml | 1 + .../pretests/fileStoreCreate.feature | 6 ++ .../pretests/fileStoreMetadataPretest.feature | 1 - .../pretests/fileStoreTagPretest.feature | 58 +++++++++++-------- .../core-services/tests/FileStoreTag.feature | 11 +++- .../constants/genericConstants.yaml | 3 + .../core-services/constants/fileStore.yaml | 1 + .../pretests/fileStoreCreate.feature | 6 ++ .../pretests/fileStoreMetadataPretest.feature | 1 - .../pretests/fileStoreTagPretest.feature | 58 +++++++++++-------- .../core-services/tests/FileStoreTag.feature | 11 +++- 12 files changed, 104 insertions(+), 56 deletions(-) diff --git a/api-automation/src/test/java/com/egov/common-services/constants/genericConstants.yaml b/api-automation/src/test/java/com/egov/common-services/constants/genericConstants.yaml index 7836298..b1ccb53 100644 --- a/api-automation/src/test/java/com/egov/common-services/constants/genericConstants.yaml +++ b/api-automation/src/test/java/com/egov/common-services/constants/genericConstants.yaml @@ -20,6 +20,9 @@ parameters: # to upload file on fire-noc module module: - fire-noc + # tag for filestore + tag: + - 00041-2017-QR # type for userOtp type: - register diff --git a/api-automation/src/test/java/com/egov/core-services/constants/fileStore.yaml b/api-automation/src/test/java/com/egov/core-services/constants/fileStore.yaml index 93f1694..7b1d5f2 100644 --- a/api-automation/src/test/java/com/egov/core-services/constants/fileStore.yaml +++ b/api-automation/src/test/java/com/egov/core-services/constants/fileStore.yaml @@ -2,3 +2,4 @@ errorMessages: noTenantid: Required String parameter 'tenantId' is not present noFilestoreId: Required List parameter 'fileStoreIds' is not present + noTag: Required String parameter 'tag' is not present diff --git a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreCreate.feature b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreCreate.feature index 395fec4..614a9c7 100644 --- a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreCreate.feature +++ b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreCreate.feature @@ -6,6 +6,7 @@ Feature: FileStore create API call * def fileContentType = 'application/pdf' * def commonConstants = read('../../common-services/constants/genericConstants.yaml') * def module = commonConstants.parameters.module[0] + * def tag = commonConstants.parameters.tag[0] * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') * def testData = '../../common-services/testData/dummyTestData.rtf' @@ -24,6 +25,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData3)' , filename: '#(filetestData3)', contentType: '#(fileContentType)'} And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 201 @@ -38,6 +40,7 @@ Feature: FileStore create API call And multipart file file = { read: '#(testData2)', filename: '#(filetestData2)', contentType: '#(fileContentType)' } And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 201 @@ -62,6 +65,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData)', filename: '#(filetestData)', contentType: '#(fileContentType)'} And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 400 @@ -74,6 +78,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData1)', filename: '#(filetestData1)', contentType: '#(fileContentType)'} And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 413 @@ -88,6 +93,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData3)', filename: '#(filetestData3)', contentType: '#(fileContentType)'} And multipart field tenantId = invalidTenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 201 diff --git a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature index 61cf2c5..0a0c957 100644 --- a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature +++ b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreMetadataPretest.feature @@ -38,7 +38,6 @@ Feature: Filestore Metadata API call tenantId: '#(tenantId)', fileStoreIds: '#(getFileIds)' } - """ Given url fileStoreMetadata And params getFileIdParam diff --git a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature index 8c4bf27..ae29d40 100644 --- a/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature +++ b/api-automation/src/test/java/com/egov/core-services/pretests/fileStoreTagPretest.feature @@ -1,50 +1,58 @@ Feature: Filestore Tag API call Background: * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') - * def fileContentTypeHeader = 'multipart/form-data;boundary=----WebKitFormBoundaryBDVBPRx02pZ7ePhq' - * def fileContentType = 'application/pdf' * def commonConstants = read('../../common-services/constants/genericConstants.yaml') * def module = commonConstants.parameters.module[0] + * def tag = commonConstants.parameters.tag[0] * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') # calling upload single document file pretest * call read('../../core-services/pretests/fileStoreCreate.feature@uploadDocumentsSuccessfully') - - * def getFileId = filecreateResponseBody.files[0].fileStoreId + @getFilestoreTagSuccessfully Scenario: get the filestore tag successfull - * def getFileIdParam = - """ - - { - tenantId: '#(tenantId)', - tag: '#(tag)' - } - - """ + * def getFileTagParam = + """ + { + tenantId: '#(tenantId)', + tag: '#(tag)' + } + """ Given url fileStoreTag - And param getFileIdParam + And params getFileTagParam When method get Then status 200 And def fileStoreTagResponseHeader = responseHeaders And def fileStoreTagResponseBody = response @getFilestoreIncorrectTag + Scenario: get the filestore incorrect tenantId + * def getFileTagParam = + """ + { + tag: '#(tag)' + } + """ + Given url fileStoreTag + And params getFileTagParam + When method get + Then status 400 + And def fileStoreTagResponseHeader = responseHeaders + And def fileStoreTagResponseBody = response + + @getFilestoreIncorrectTagError Scenario: get the filestore incorrect tag - * def getFileIdParam = - """ - - { - tenantId: '#(tenantId)', - tag: '#(tag)' - } - - """ + * def getFileTagParam = + """ + { + tenantId: '#(tenantId)' + } + """ Given url fileStoreTag - And param getFileIdParam + And params getFileTagParam When method get Then status 400 And def fileStoreTagResponseHeader = responseHeaders - And def fileStoreTagResponseBody = response \ No newline at end of file + And def fileStoreTagResponseBody = response \ No newline at end of file diff --git a/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature b/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature index 68fc900..1b4273d 100644 --- a/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature +++ b/api-automation/src/test/java/com/egov/core-services/tests/FileStoreTag.feature @@ -11,8 +11,15 @@ Feature: File store Tag * match fileStoreTagResponseBody == '#present' @FileStore_Tag_02 @coreServices @regression @negative @filestore - Scenario: Filestore incorrect tag + Scenario: Filestore incorrect tenantId #Calling tag preset * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreIncorrectTag') - * assert.fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid \ No newline at end of file + * assert fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid + + @FileStore_Tag_03 @coreServices @regression @negative @filestore + Scenario: Filestore incorrect tag + #Calling tag preset + * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreIncorrectTagError') + + * assert fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTag \ No newline at end of file diff --git a/api-automation/target/test-classes/com/egov/common-services/constants/genericConstants.yaml b/api-automation/target/test-classes/com/egov/common-services/constants/genericConstants.yaml index 7836298..b1ccb53 100644 --- a/api-automation/target/test-classes/com/egov/common-services/constants/genericConstants.yaml +++ b/api-automation/target/test-classes/com/egov/common-services/constants/genericConstants.yaml @@ -20,6 +20,9 @@ parameters: # to upload file on fire-noc module module: - fire-noc + # tag for filestore + tag: + - 00041-2017-QR # type for userOtp type: - register diff --git a/api-automation/target/test-classes/com/egov/core-services/constants/fileStore.yaml b/api-automation/target/test-classes/com/egov/core-services/constants/fileStore.yaml index 93f1694..7b1d5f2 100644 --- a/api-automation/target/test-classes/com/egov/core-services/constants/fileStore.yaml +++ b/api-automation/target/test-classes/com/egov/core-services/constants/fileStore.yaml @@ -2,3 +2,4 @@ errorMessages: noTenantid: Required String parameter 'tenantId' is not present noFilestoreId: Required List parameter 'fileStoreIds' is not present + noTag: Required String parameter 'tag' is not present diff --git a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreCreate.feature b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreCreate.feature index 395fec4..614a9c7 100644 --- a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreCreate.feature +++ b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreCreate.feature @@ -6,6 +6,7 @@ Feature: FileStore create API call * def fileContentType = 'application/pdf' * def commonConstants = read('../../common-services/constants/genericConstants.yaml') * def module = commonConstants.parameters.module[0] + * def tag = commonConstants.parameters.tag[0] * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') * def testData = '../../common-services/testData/dummyTestData.rtf' @@ -24,6 +25,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData3)' , filename: '#(filetestData3)', contentType: '#(fileContentType)'} And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 201 @@ -38,6 +40,7 @@ Feature: FileStore create API call And multipart file file = { read: '#(testData2)', filename: '#(filetestData2)', contentType: '#(fileContentType)' } And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 201 @@ -62,6 +65,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData)', filename: '#(filetestData)', contentType: '#(fileContentType)'} And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 400 @@ -74,6 +78,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData1)', filename: '#(filetestData1)', contentType: '#(fileContentType)'} And multipart field tenantId = tenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 413 @@ -88,6 +93,7 @@ Feature: FileStore create API call And multipart file file = {read: '#(testData3)', filename: '#(filetestData3)', contentType: '#(fileContentType)'} And multipart field tenantId = invalidTenantId And multipart field module = module + And multipart field tag = tag And header Content-Type = fileContentTypeHeader When method post Then status 201 diff --git a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature index 61cf2c5..0a0c957 100644 --- a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature +++ b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreMetadataPretest.feature @@ -38,7 +38,6 @@ Feature: Filestore Metadata API call tenantId: '#(tenantId)', fileStoreIds: '#(getFileIds)' } - """ Given url fileStoreMetadata And params getFileIdParam diff --git a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature index 8c4bf27..ae29d40 100644 --- a/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature +++ b/api-automation/target/test-classes/com/egov/core-services/pretests/fileStoreTagPretest.feature @@ -1,50 +1,58 @@ Feature: Filestore Tag API call Background: * def jsUtils = read('classpath:com/egov/utils/jsUtils.js') - * def fileContentTypeHeader = 'multipart/form-data;boundary=----WebKitFormBoundaryBDVBPRx02pZ7ePhq' - * def fileContentType = 'application/pdf' * def commonConstants = read('../../common-services/constants/genericConstants.yaml') * def module = commonConstants.parameters.module[0] + * def tag = commonConstants.parameters.tag[0] * def invalidTenantId = commonConstants.invalidParameters.invalidTenantId * def fileStoreConst = read('../../core-services/constants/fileStore.yaml') # calling upload single document file pretest * call read('../../core-services/pretests/fileStoreCreate.feature@uploadDocumentsSuccessfully') - - * def getFileId = filecreateResponseBody.files[0].fileStoreId + @getFilestoreTagSuccessfully Scenario: get the filestore tag successfull - * def getFileIdParam = - """ - - { - tenantId: '#(tenantId)', - tag: '#(tag)' - } - - """ + * def getFileTagParam = + """ + { + tenantId: '#(tenantId)', + tag: '#(tag)' + } + """ Given url fileStoreTag - And param getFileIdParam + And params getFileTagParam When method get Then status 200 And def fileStoreTagResponseHeader = responseHeaders And def fileStoreTagResponseBody = response @getFilestoreIncorrectTag + Scenario: get the filestore incorrect tenantId + * def getFileTagParam = + """ + { + tag: '#(tag)' + } + """ + Given url fileStoreTag + And params getFileTagParam + When method get + Then status 400 + And def fileStoreTagResponseHeader = responseHeaders + And def fileStoreTagResponseBody = response + + @getFilestoreIncorrectTagError Scenario: get the filestore incorrect tag - * def getFileIdParam = - """ - - { - tenantId: '#(tenantId)', - tag: '#(tag)' - } - - """ + * def getFileTagParam = + """ + { + tenantId: '#(tenantId)' + } + """ Given url fileStoreTag - And param getFileIdParam + And params getFileTagParam When method get Then status 400 And def fileStoreTagResponseHeader = responseHeaders - And def fileStoreTagResponseBody = response \ No newline at end of file + And def fileStoreTagResponseBody = response \ No newline at end of file diff --git a/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature b/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature index 68fc900..1b4273d 100644 --- a/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature +++ b/api-automation/target/test-classes/com/egov/core-services/tests/FileStoreTag.feature @@ -11,8 +11,15 @@ Feature: File store Tag * match fileStoreTagResponseBody == '#present' @FileStore_Tag_02 @coreServices @regression @negative @filestore - Scenario: Filestore incorrect tag + Scenario: Filestore incorrect tenantId #Calling tag preset * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreIncorrectTag') - * assert.fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid \ No newline at end of file + * assert fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTenantid + + @FileStore_Tag_03 @coreServices @regression @negative @filestore + Scenario: Filestore incorrect tag + #Calling tag preset + * call read('../../core-services/pretests/fileStoreTagPretest.feature@getFilestoreIncorrectTagError') + + * assert fileStoreTagResponseBody.Errors[0].message == fileStoreConst.errorMessages.noTag \ No newline at end of file