From 1ac43dc43031f9c51c7f49c3028f155618146fee Mon Sep 17 00:00:00 2001 From: valentinogiardino Date: Sat, 1 Mar 2025 18:43:19 -0300 Subject: [PATCH] #31402 karate tests adjustments --- .../test/java/graphql/ftm/newContent.feature | 4 +-- .../graphql/ftm/newUrlMapContentType.feature | 30 ++----------------- .../src/test/java/graphql/ftm/setup.feature | 7 ++--- .../graphql/ftm/CheckingTimeMachine.feature | 4 +++ 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/test-karate/src/test/java/graphql/ftm/newContent.feature b/test-karate/src/test/java/graphql/ftm/newContent.feature index 45b889fe50d..6f962a35411 100644 --- a/test-karate/src/test/java/graphql/ftm/newContent.feature +++ b/test-karate/src/test/java/graphql/ftm/newContent.feature @@ -8,14 +8,14 @@ Background: * def title = __arg.title * def publishDate = __arg.publishDate * def expiresOn = __arg.expiresOn - * def action = __arg.action ? __arg.action : 'PUBLISH' * def urlTitle = __arg.urlTitle + * def action = __arg.action ? __arg.action : 'PUBLISH' # Default to PUBLISH if action is not provided Given url baseUrl + '/api/v1/workflow/actions/default/fire/' + action + '?indexPolicy=WAIT_FOR' And headers commonHeaders - * def requestPayload = buildContentRequestPayload (contentTypeId, title, publishDate, expiresOn, urlTitle) + * def requestPayload = buildContentRequestPayload (contentTypeId, title, publishDate, expiresOn, null, urlTitle) And request requestPayload When method POST diff --git a/test-karate/src/test/java/graphql/ftm/newUrlMapContentType.feature b/test-karate/src/test/java/graphql/ftm/newUrlMapContentType.feature index 9cfcd5e27d1..79db4d852f1 100644 --- a/test-karate/src/test/java/graphql/ftm/newUrlMapContentType.feature +++ b/test-karate/src/test/java/graphql/ftm/newUrlMapContentType.feature @@ -110,7 +110,7 @@ Feature: Create a Content Type with URL Map "required":true, "searchable":true, "sortOrder":2, - "unique":true, + "unique":false, "variable":"urlTitle" }, { @@ -252,31 +252,6 @@ Feature: Create a Content Type with URL Map "unique":false, "variable":"title" }, - { - "clazz":"com.dotcms.contenttype.model.field.ImmutableCustomField", - "contentTypeId":"d90434114b901620af330653e4d33f25", - "dataType":"LONG_TEXT", - "fieldType":"Custom-Field", - "fieldTypeLabel":"Custom Field", - "fieldVariables":[ - - ], - "fixed":false, - "forceIncludeInApi":false, - "iDate":1740706740000, - "id":"53e9ed7ffd1dd44dc1407f84c20270f8", - "indexed":false, - "listed":false, - "modDate":1740706749000, - "name":"URL Title", - "readOnly":false, - "required":false, - "searchable":false, - "sortOrder":3, - "unique":false, - "values":"#dotParse(\"/dA/0ec62ffd3666f23fc5228ef84a481b09\")", - "variable":"urlTitle" - }, { "clazz":"com.dotcms.contenttype.model.field.ImmutableDateTimeField", "contentTypeId":"d90434114b901620af330653e4d33f25", @@ -353,5 +328,4 @@ Feature: Create a Content Type with URL Map """ When method POST Then status 200 - And match response.entity[0].id != null - And match response.entity[0].variable == contentTypeVariable \ No newline at end of file + And match response.entity[0].id != null \ No newline at end of file diff --git a/test-karate/src/test/java/graphql/ftm/setup.feature b/test-karate/src/test/java/graphql/ftm/setup.feature index 2d4d5b98f8c..d17b37d6c11 100644 --- a/test-karate/src/test/java/graphql/ftm/setup.feature +++ b/test-karate/src/test/java/graphql/ftm/setup.feature @@ -90,10 +90,9 @@ Feature: Setting up the Future Time Machine Test # Create a couple of new pieces of content for the UrlMap Content Type * def createUrlMapContentPieceOneResult = callonce read('classpath:graphql/ftm/newContent.feature') { contentTypeId: '#(urlMapContentTypeId)', title: 'url-content-map-test-1-v1', urlTitle: 'url-content-map-test-1' } - * def urlMapContentPieceOne = createContentPieceOneResult.response.entity.results - * def urlMapContentPieceOneId = contentPieceOne.map(result => Object.keys(result)[0]) - * def urlMapContentPieceOneId = contentPieceOneId[0] - * def urlMapContentPieceOneUrl = contentPieceOneId[0]["urlMap"] + * def urlMapContentPieceOne = createUrlMapContentPieceOneResult.response.entity.results[0] + * def urlMapContentPieceOneId = karate.keysOf(urlMapContentPieceOne)[0] + * def urlMapContentPieceOneUrl = urlMapContentPieceOne[urlMapContentPieceOneId].urlMap # Create new version of the content for the UrlMap Content Type with future publishDate * def newUrlMapContentPiceOneVersion2 = callonce read('classpath:graphql/ftm/newContentVersion.feature') { contentTypeId: '#(urlMapContentTypeId)', identifier: '#(urlMapContentPieceOneId)', title: 'url-content-map-test-1-v2', publishDate: '#(formattedFutureDateTime)' } diff --git a/test-karate/src/test/java/tests/graphql/ftm/CheckingTimeMachine.feature b/test-karate/src/test/java/tests/graphql/ftm/CheckingTimeMachine.feature index 80a18678849..63cdb8dd76f 100644 --- a/test-karate/src/test/java/tests/graphql/ftm/CheckingTimeMachine.feature +++ b/test-karate/src/test/java/tests/graphql/ftm/CheckingTimeMachine.feature @@ -145,6 +145,8 @@ Feature: Test Time Machine functionality * def urlContentMap = response.entity.urlContentMap * def urlContentMapTitle = urlContentMap.title + * karate.log('urlContentMapTitle:', urlContentMapTitle) + # Expect the first version of the content to be displayed * match urlContentMapTitle contains URL_CONTENT_MAP_TITLE_V1 @@ -165,6 +167,8 @@ Feature: Test Time Machine functionality * def urlContentMap = response.entity.urlContentMap * def urlContentMapTitle = urlContentMap.title + * karate.log('urlContentMapTitle:', urlContentMapTitle) + # Expect the second version of the content to be displayed * match urlContentMapTitle contains URL_CONTENT_MAP_TITLE_V2