mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-06 20:47:26 +00:00
MINOR: revert param logic in search/list and introduce raw query param (#20244)
* fix: revert param logic in search/list and introduce raw query param * unskip the playwright test related to DQ --------- Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
parent
2c90a2fe6f
commit
dd3382aad8
@ -1355,9 +1355,11 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
|||||||
SearchListFilter searchListFilter,
|
SearchListFilter searchListFilter,
|
||||||
int limit,
|
int limit,
|
||||||
int offset,
|
int offset,
|
||||||
String q)
|
String q,
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return listFromSearchWithOffset(uriInfo, fields, searchListFilter, limit, offset, null, q);
|
return listFromSearchWithOffset(
|
||||||
|
uriInfo, fields, searchListFilter, limit, offset, null, q, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultList<T> listFromSearchWithOffset(
|
public ResultList<T> listFromSearchWithOffset(
|
||||||
@ -1367,7 +1369,8 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
|||||||
int limit,
|
int limit,
|
||||||
int offset,
|
int offset,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q)
|
String q,
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
List<T> entityList = new ArrayList<>();
|
List<T> entityList = new ArrayList<>();
|
||||||
Long total;
|
Long total;
|
||||||
@ -1375,7 +1378,7 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
|||||||
if (limit > 0) {
|
if (limit > 0) {
|
||||||
SearchResultListMapper results =
|
SearchResultListMapper results =
|
||||||
searchRepository.listWithOffset(
|
searchRepository.listWithOffset(
|
||||||
searchListFilter, limit, offset, entityType, searchSortFilter, q);
|
searchListFilter, limit, offset, entityType, searchSortFilter, q, queryString);
|
||||||
total = results.getTotal();
|
total = results.getTotal();
|
||||||
for (Map<String, Object> json : results.getResults()) {
|
for (Map<String, Object> json : results.getResults()) {
|
||||||
T entity = JsonUtils.readOrConvertValueLenient(json, entityClass);
|
T entity = JsonUtils.readOrConvertValueLenient(json, entityClass);
|
||||||
@ -1385,7 +1388,7 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
|||||||
} else {
|
} else {
|
||||||
SearchResultListMapper results =
|
SearchResultListMapper results =
|
||||||
searchRepository.listWithOffset(
|
searchRepository.listWithOffset(
|
||||||
searchListFilter, limit, offset, entityType, searchSortFilter, q);
|
searchListFilter, limit, offset, entityType, searchSortFilter, q, queryString);
|
||||||
total = results.getTotal();
|
total = results.getTotal();
|
||||||
return new ResultList<>(entityList, null, limit, total.intValue());
|
return new ResultList<>(entityList, null, limit, total.intValue());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -367,7 +367,8 @@ public abstract class EntityTimeSeriesRepository<T extends EntityTimeSeriesInter
|
|||||||
int limit,
|
int limit,
|
||||||
int offset,
|
int offset,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q)
|
String q,
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
List<T> entityList = new ArrayList<>();
|
List<T> entityList = new ArrayList<>();
|
||||||
long total;
|
long total;
|
||||||
@ -377,7 +378,7 @@ public abstract class EntityTimeSeriesRepository<T extends EntityTimeSeriesInter
|
|||||||
if (limit > 0) {
|
if (limit > 0) {
|
||||||
SearchResultListMapper results =
|
SearchResultListMapper results =
|
||||||
searchRepository.listWithOffset(
|
searchRepository.listWithOffset(
|
||||||
searchListFilter, limit, offset, entityType, searchSortFilter, q);
|
searchListFilter, limit, offset, entityType, searchSortFilter, q, queryString);
|
||||||
total = results.getTotal();
|
total = results.getTotal();
|
||||||
for (Map<String, Object> json : results.getResults()) {
|
for (Map<String, Object> json : results.getResults()) {
|
||||||
T entity = setFieldsInternal(JsonUtils.readOrConvertValue(json, entityClass), fields);
|
T entity = setFieldsInternal(JsonUtils.readOrConvertValue(json, entityClass), fields);
|
||||||
@ -389,7 +390,7 @@ public abstract class EntityTimeSeriesRepository<T extends EntityTimeSeriesInter
|
|||||||
} else {
|
} else {
|
||||||
SearchResultListMapper results =
|
SearchResultListMapper results =
|
||||||
searchRepository.listWithOffset(
|
searchRepository.listWithOffset(
|
||||||
searchListFilter, limit, offset, entityType, searchSortFilter, q);
|
searchListFilter, limit, offset, entityType, searchSortFilter, q, queryString);
|
||||||
total = results.getTotal();
|
total = results.getTotal();
|
||||||
return new ResultList<>(entityList, null, limit, (int) total);
|
return new ResultList<>(entityList, null, limit, (int) total);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,12 +195,13 @@ public abstract class EntityResource<T extends EntityInterface, K extends Entity
|
|||||||
int offset,
|
int offset,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q,
|
String q,
|
||||||
|
String queryString,
|
||||||
OperationContext operationContext,
|
OperationContext operationContext,
|
||||||
ResourceContextInterface resourceContext)
|
ResourceContextInterface resourceContext)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
authorizer.authorize(securityContext, operationContext, resourceContext);
|
authorizer.authorize(securityContext, operationContext, resourceContext);
|
||||||
return repository.listFromSearchWithOffset(
|
return repository.listFromSearchWithOffset(
|
||||||
uriInfo, fields, searchListFilter, limit, offset, searchSortFilter, q);
|
uriInfo, fields, searchListFilter, limit, offset, searchSortFilter, q, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T getInternal(
|
public T getInternal(
|
||||||
|
|||||||
@ -56,12 +56,13 @@ public abstract class EntityTimeSeriesResource<
|
|||||||
int offset,
|
int offset,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q,
|
String q,
|
||||||
|
String queryString,
|
||||||
OperationContext operationContext,
|
OperationContext operationContext,
|
||||||
ResourceContextInterface resourceContext)
|
ResourceContextInterface resourceContext)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
authorizer.authorize(securityContext, operationContext, resourceContext);
|
authorizer.authorize(securityContext, operationContext, resourceContext);
|
||||||
return repository.listFromSearchWithOffset(
|
return repository.listFromSearchWithOffset(
|
||||||
fields, searchListFilter, limit, offset, searchSortFilter, q);
|
fields, searchListFilter, limit, offset, searchSortFilter, q, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ResultList<T> listInternalFromSearch(
|
protected ResultList<T> listInternalFromSearch(
|
||||||
@ -72,12 +73,13 @@ public abstract class EntityTimeSeriesResource<
|
|||||||
int offset,
|
int offset,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q,
|
String q,
|
||||||
|
String queryString,
|
||||||
List<AuthRequest> authRequests,
|
List<AuthRequest> authRequests,
|
||||||
AuthorizationLogic authorizationLogic)
|
AuthorizationLogic authorizationLogic)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
authorizer.authorizeRequests(securityContext, authRequests, authorizationLogic);
|
authorizer.authorizeRequests(securityContext, authRequests, authorizationLogic);
|
||||||
return repository.listFromSearchWithOffset(
|
return repository.listFromSearchWithOffset(
|
||||||
fields, searchListFilter, limit, offset, searchSortFilter, q);
|
fields, searchListFilter, limit, offset, searchSortFilter, q, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultList<T> listLatestFromSearch(
|
public ResultList<T> listLatestFromSearch(
|
||||||
|
|||||||
@ -401,7 +401,12 @@ public class TestCaseResource extends EntityResource<TestCase, TestCaseRepositor
|
|||||||
description = "search query term to use in list",
|
description = "search query term to use in list",
|
||||||
schema = @Schema(type = "string"))
|
schema = @Schema(type = "string"))
|
||||||
@QueryParam("q")
|
@QueryParam("q")
|
||||||
String q)
|
String q,
|
||||||
|
@Parameter(
|
||||||
|
description = "raw elasticsearch query to use in list",
|
||||||
|
schema = @Schema(type = "string"))
|
||||||
|
@QueryParam("queryString")
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if ((startTimestamp == null && endTimestamp != null)
|
if ((startTimestamp == null && endTimestamp != null)
|
||||||
|| (startTimestamp != null && endTimestamp == null)) {
|
|| (startTimestamp != null && endTimestamp == null)) {
|
||||||
@ -471,6 +476,7 @@ public class TestCaseResource extends EntityResource<TestCase, TestCaseRepositor
|
|||||||
offset,
|
offset,
|
||||||
searchSortFilter,
|
searchSortFilter,
|
||||||
q,
|
q,
|
||||||
|
queryString,
|
||||||
operationContext,
|
operationContext,
|
||||||
resourceContextInterface);
|
resourceContextInterface);
|
||||||
return PIIMasker.getTestCases(tests, authorizer, securityContext);
|
return PIIMasker.getTestCases(tests, authorizer, securityContext);
|
||||||
|
|||||||
@ -304,7 +304,12 @@ public class TestCaseResultResource
|
|||||||
description = "search query term to use in list",
|
description = "search query term to use in list",
|
||||||
schema = @Schema(type = "string"))
|
schema = @Schema(type = "string"))
|
||||||
@QueryParam("q")
|
@QueryParam("q")
|
||||||
String q)
|
String q,
|
||||||
|
@Parameter(
|
||||||
|
description = "raw elasticsearch query to use in list",
|
||||||
|
schema = @Schema(type = "string"))
|
||||||
|
@QueryParam("queryString")
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (latest.equals("true") && (testSuiteId == null && entityFQN == null)) {
|
if (latest.equals("true") && (testSuiteId == null && entityFQN == null)) {
|
||||||
throw new IllegalArgumentException("latest=true requires testSuiteId");
|
throw new IllegalArgumentException("latest=true requires testSuiteId");
|
||||||
@ -345,6 +350,7 @@ public class TestCaseResultResource
|
|||||||
offset,
|
offset,
|
||||||
new SearchSortFilter("timestamp", "desc", null, null),
|
new SearchSortFilter("timestamp", "desc", null, null),
|
||||||
q,
|
q,
|
||||||
|
queryString,
|
||||||
authRequests,
|
authRequests,
|
||||||
AuthorizationLogic.ANY);
|
AuthorizationLogic.ANY);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -274,7 +274,12 @@ public class TestSuiteResource extends EntityResource<TestSuite, TestSuiteReposi
|
|||||||
description = "search query term to use in list",
|
description = "search query term to use in list",
|
||||||
schema = @Schema(type = "string"))
|
schema = @Schema(type = "string"))
|
||||||
@QueryParam("q")
|
@QueryParam("q")
|
||||||
String q)
|
String q,
|
||||||
|
@Parameter(
|
||||||
|
description = "raw elasticsearch query to use in list",
|
||||||
|
schema = @Schema(type = "string"))
|
||||||
|
@QueryParam("queryString")
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
SearchSortFilter searchSortFilter =
|
SearchSortFilter searchSortFilter =
|
||||||
new SearchSortFilter(sortField, sortType, sortNestedPath, sortNestedMode);
|
new SearchSortFilter(sortField, sortType, sortNestedPath, sortNestedMode);
|
||||||
@ -300,7 +305,7 @@ public class TestSuiteResource extends EntityResource<TestSuite, TestSuiteReposi
|
|||||||
List<AuthRequest> authRequests = getAuthRequestsForListOps();
|
List<AuthRequest> authRequests = getAuthRequestsForListOps();
|
||||||
authorizer.authorizeRequests(securityContext, authRequests, AuthorizationLogic.ANY);
|
authorizer.authorizeRequests(securityContext, authRequests, AuthorizationLogic.ANY);
|
||||||
return repository.listFromSearchWithOffset(
|
return repository.listFromSearchWithOffset(
|
||||||
uriInfo, fields, searchListFilter, limit, offset, searchSortFilter, q);
|
uriInfo, fields, searchListFilter, limit, offset, searchSortFilter, q, queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
|||||||
@ -187,7 +187,8 @@ public interface SearchClient {
|
|||||||
int offset,
|
int offset,
|
||||||
String index,
|
String index,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q)
|
String q,
|
||||||
|
String queryString)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
|
||||||
SearchResultListMapper listWithDeepPagination(
|
SearchResultListMapper listWithDeepPagination(
|
||||||
|
|||||||
@ -1019,6 +1019,18 @@ public class SearchRepository {
|
|||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q)
|
String q)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
return listWithOffset(filter, limit, offset, entityType, searchSortFilter, q, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SearchResultListMapper listWithOffset(
|
||||||
|
SearchListFilter filter,
|
||||||
|
int limit,
|
||||||
|
int offset,
|
||||||
|
String entityType,
|
||||||
|
SearchSortFilter searchSortFilter,
|
||||||
|
String q,
|
||||||
|
String queryString)
|
||||||
|
throws IOException {
|
||||||
IndexMapping index = entityIndexMap.get(entityType);
|
IndexMapping index = entityIndexMap.get(entityType);
|
||||||
return searchClient.listWithOffset(
|
return searchClient.listWithOffset(
|
||||||
filter.getCondition(entityType),
|
filter.getCondition(entityType),
|
||||||
@ -1026,7 +1038,8 @@ public class SearchRepository {
|
|||||||
offset,
|
offset,
|
||||||
index.getIndexName(clusterAlias),
|
index.getIndexName(clusterAlias),
|
||||||
searchSortFilter,
|
searchSortFilter,
|
||||||
q);
|
q,
|
||||||
|
queryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SearchResultListMapper listWithDeepPagination(
|
public SearchResultListMapper listWithDeepPagination(
|
||||||
|
|||||||
@ -733,16 +733,20 @@ public class ElasticSearchClient implements SearchClient {
|
|||||||
int offset,
|
int offset,
|
||||||
String index,
|
String index,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q)
|
String q,
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
if (!nullOrEmpty(q)) {
|
if (!nullOrEmpty(q)) {
|
||||||
XContentParser queryParser = createXContentParser(q);
|
searchSourceBuilder = getSearchSourceBuilder(index, q, offset, limit);
|
||||||
|
}
|
||||||
|
if (!nullOrEmpty(queryString)) {
|
||||||
|
XContentParser queryParser = createXContentParser(queryString);
|
||||||
searchSourceBuilder = SearchSourceBuilder.fromXContent(queryParser);
|
searchSourceBuilder = SearchSourceBuilder.fromXContent(queryParser);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> results = new ArrayList<>();
|
List<Map<String, Object>> results = new ArrayList<>();
|
||||||
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(q));
|
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(q) || !nullOrEmpty(queryString));
|
||||||
|
|
||||||
searchSourceBuilder.timeout(new TimeValue(30, TimeUnit.SECONDS));
|
searchSourceBuilder.timeout(new TimeValue(30, TimeUnit.SECONDS));
|
||||||
searchSourceBuilder.from(offset);
|
searchSourceBuilder.from(offset);
|
||||||
|
|||||||
@ -717,16 +717,20 @@ public class OpenSearchClient implements SearchClient {
|
|||||||
int offset,
|
int offset,
|
||||||
String index,
|
String index,
|
||||||
SearchSortFilter searchSortFilter,
|
SearchSortFilter searchSortFilter,
|
||||||
String q)
|
String q,
|
||||||
|
String queryString)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
if (!nullOrEmpty(q)) {
|
if (!nullOrEmpty(q)) {
|
||||||
XContentParser queryParser = createXContentParser(q);
|
searchSourceBuilder = getSearchSourceBuilder(index, q, offset, limit);
|
||||||
|
}
|
||||||
|
if (!nullOrEmpty(queryString)) {
|
||||||
|
XContentParser queryParser = createXContentParser(queryString);
|
||||||
searchSourceBuilder = SearchSourceBuilder.fromXContent(queryParser);
|
searchSourceBuilder = SearchSourceBuilder.fromXContent(queryParser);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> results = new ArrayList<>();
|
List<Map<String, Object>> results = new ArrayList<>();
|
||||||
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(q));
|
getSearchFilter(filter, searchSourceBuilder, !nullOrEmpty(q) || !nullOrEmpty(queryString));
|
||||||
|
|
||||||
searchSourceBuilder.timeout(new TimeValue(30, TimeUnit.SECONDS));
|
searchSourceBuilder.timeout(new TimeValue(30, TimeUnit.SECONDS));
|
||||||
searchSourceBuilder.from(offset);
|
searchSourceBuilder.from(offset);
|
||||||
|
|||||||
@ -953,7 +953,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
listEntitiesFromSearch(queryParams, testCasesNum, 0, ADMIN_AUTH_HEADERS);
|
listEntitiesFromSearch(queryParams, testCasesNum, 0, ADMIN_AUTH_HEADERS);
|
||||||
assertEquals(testCasesNum, allEntities.getData().size());
|
assertEquals(testCasesNum, allEntities.getData().size());
|
||||||
queryParams.put(
|
queryParams.put(
|
||||||
"q",
|
"queryString",
|
||||||
"%7B%22query%22%3A%20%7B%22term%22%3A%20%7B%22id%22%3A%20%22"
|
"%7B%22query%22%3A%20%7B%22term%22%3A%20%7B%22id%22%3A%20%22"
|
||||||
+ testCaseForEL.getId()
|
+ testCaseForEL.getId()
|
||||||
+ "%22%7D%7D%7D");
|
+ "%22%7D%7D%7D");
|
||||||
@ -965,6 +965,13 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
.allMatch(
|
.allMatch(
|
||||||
ts -> ts.getFullyQualifiedName().equals(testCaseForEL.getFullyQualifiedName())));
|
ts -> ts.getFullyQualifiedName().equals(testCaseForEL.getFullyQualifiedName())));
|
||||||
|
|
||||||
|
queryParams.clear();
|
||||||
|
queryParams.put("q", "test_getSimpleListFromSearchb");
|
||||||
|
allEntities = listEntitiesFromSearch(queryParams, testCasesNum, 0, ADMIN_AUTH_HEADERS);
|
||||||
|
// Note: Since the "name" field and its ngram variant are prioritized in the search query
|
||||||
|
// and the test case names are very similar, the fuzzy matching returns all test cases.
|
||||||
|
assertEquals(testCasesNum, allEntities.getData().size());
|
||||||
|
|
||||||
queryParams.clear();
|
queryParams.clear();
|
||||||
queryParams.put("entityLink", testCaseForEL.getEntityLink());
|
queryParams.put("entityLink", testCaseForEL.getEntityLink());
|
||||||
queryParams.put("includeAllTests", "true");
|
queryParams.put("includeAllTests", "true");
|
||||||
@ -3664,7 +3671,7 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
|
|
||||||
String id = testCaseResultResultList.getData().get(0).getId().toString();
|
String id = testCaseResultResultList.getData().get(0).getId().toString();
|
||||||
queryParams.put(
|
queryParams.put(
|
||||||
"q",
|
"queryString",
|
||||||
"%7B%22query%22%3A%20%7B%22term%22%3A%20%7B%22id.keyword%22%3A%20%22"
|
"%7B%22query%22%3A%20%7B%22term%22%3A%20%7B%22id.keyword%22%3A%20%22"
|
||||||
+ id
|
+ id
|
||||||
+ "%22%7D%7D%7D");
|
+ "%22%7D%7D%7D");
|
||||||
|
|||||||
@ -439,7 +439,7 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
|||||||
// 5. List test suite with a query
|
// 5. List test suite with a query
|
||||||
queryParams.clear();
|
queryParams.clear();
|
||||||
queryParams.put(
|
queryParams.put(
|
||||||
"q",
|
"queryString",
|
||||||
"%7B%22query%22%3A%20%7B%22term%22%3A%20%7B%22id%22%3A%20%22"
|
"%7B%22query%22%3A%20%7B%22term%22%3A%20%7B%22id%22%3A%20%22"
|
||||||
+ logicalTestSuite.getId()
|
+ logicalTestSuite.getId()
|
||||||
+ "%22%7D%7D%7D");
|
+ "%22%7D%7D%7D");
|
||||||
@ -449,6 +449,15 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
|||||||
queryTestSuites.getData().stream()
|
queryTestSuites.getData().stream()
|
||||||
.allMatch(
|
.allMatch(
|
||||||
ts -> ts.getFullyQualifiedName().equals(logicalTestSuite.getFullyQualifiedName())));
|
ts -> ts.getFullyQualifiedName().equals(logicalTestSuite.getFullyQualifiedName())));
|
||||||
|
|
||||||
|
queryParams.clear();
|
||||||
|
queryParams.put("q", logicalTestSuite.getFullyQualifiedName());
|
||||||
|
queryTestSuites = listEntitiesFromSearch(queryParams, 100, 0, ADMIN_AUTH_HEADERS);
|
||||||
|
Assertions.assertTrue(
|
||||||
|
queryTestSuites.getData().stream()
|
||||||
|
.allMatch(
|
||||||
|
ts -> ts.getFullyQualifiedName().equals(logicalTestSuite.getFullyQualifiedName())));
|
||||||
|
|
||||||
// 6. List test suites with a nested sort
|
// 6. List test suites with a nested sort
|
||||||
queryParams.clear();
|
queryParams.clear();
|
||||||
queryParams.put("fields", "tests");
|
queryParams.put("fields", "tests");
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import { getApiContext, redirectToHomePage, uuid } from '../../utils/common';
|
|||||||
// use the admin user to login
|
// use the admin user to login
|
||||||
test.use({ storageState: 'playwright/.auth/admin.json' });
|
test.use({ storageState: 'playwright/.auth/admin.json' });
|
||||||
|
|
||||||
test.skip(
|
test(
|
||||||
'TestSuite multi pipeline support',
|
'TestSuite multi pipeline support',
|
||||||
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
@ -185,7 +185,7 @@ test.skip(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.skip(
|
test(
|
||||||
"Edit the pipeline's test case",
|
"Edit the pipeline's test case",
|
||||||
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
|
|||||||
@ -322,7 +322,7 @@ test(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.skip(
|
test(
|
||||||
'TestCase with Array params value',
|
'TestCase with Array params value',
|
||||||
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
@ -639,10 +639,7 @@ test(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test.skip(
|
test('TestCase filters', PLAYWRIGHT_INGESTION_TAG_OBJ, async ({ page }) => {
|
||||||
'TestCase filters',
|
|
||||||
PLAYWRIGHT_INGESTION_TAG_OBJ,
|
|
||||||
async ({ page }) => {
|
|
||||||
test.setTimeout(360000);
|
test.setTimeout(360000);
|
||||||
|
|
||||||
const { apiContext, afterAction } = await getApiContext(page);
|
const { apiContext, afterAction } = await getApiContext(page);
|
||||||
@ -705,8 +702,7 @@ test.skip(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const testCaseResult = {
|
const testCaseResult = {
|
||||||
result:
|
result: 'Found min=10001, max=27809 vs. the expected min=90001, max=96162.',
|
||||||
'Found min=10001, max=27809 vs. the expected min=90001, max=96162.',
|
|
||||||
testCaseStatus: 'Failed',
|
testCaseStatus: 'Failed',
|
||||||
testResultValue: [
|
testResultValue: [
|
||||||
{
|
{
|
||||||
@ -793,9 +789,7 @@ test.skip(
|
|||||||
);
|
);
|
||||||
await searchTestCaseResponse;
|
await searchTestCaseResponse;
|
||||||
|
|
||||||
await expect(
|
await expect(page.locator(`[data-testid="${testCases[0]}"]`)).toBeVisible();
|
||||||
page.locator(`[data-testid="${testCases[0]}"]`)
|
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
// clear the search filter
|
// clear the search filter
|
||||||
const getTestCaseResponse = page.waitForResponse(
|
const getTestCaseResponse = page.waitForResponse(
|
||||||
@ -1001,9 +995,7 @@ test.skip(
|
|||||||
await page.click('[value="testPlatforms"]');
|
await page.click('[value="testPlatforms"]');
|
||||||
await page.waitForTimeout(200);
|
await page.waitForTimeout(200);
|
||||||
|
|
||||||
await expect(
|
await expect(page.getByTestId('platform-select-filter')).not.toBeVisible();
|
||||||
page.getByTestId('platform-select-filter')
|
|
||||||
).not.toBeVisible();
|
|
||||||
|
|
||||||
await page.reload();
|
await page.reload();
|
||||||
|
|
||||||
@ -1037,9 +1029,7 @@ test.skip(
|
|||||||
.fill(testCases[0]);
|
.fill(testCases[0]);
|
||||||
await searchTestCase;
|
await searchTestCase;
|
||||||
|
|
||||||
await expect(
|
await expect(page.locator(`[data-testid="${testCases[0]}"]`)).toBeVisible();
|
||||||
page.locator(`[data-testid="${testCases[0]}"]`)
|
|
||||||
).toBeVisible();
|
|
||||||
await expect(
|
await expect(
|
||||||
page.locator(`[data-testid="${testCases[1]}"]`)
|
page.locator(`[data-testid="${testCases[1]}"]`)
|
||||||
).not.toBeVisible();
|
).not.toBeVisible();
|
||||||
@ -1051,5 +1041,4 @@ test.skip(
|
|||||||
await domain.delete(apiContext);
|
await domain.delete(apiContext);
|
||||||
await afterAction();
|
await afterAction();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ test.beforeEach(async ({ page }) => {
|
|||||||
await redirectToHomePage(page);
|
await redirectToHomePage(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skip('Logical TestSuite', async ({ page }) => {
|
test('Logical TestSuite', async ({ page }) => {
|
||||||
test.slow();
|
test.slow();
|
||||||
|
|
||||||
const NEW_TEST_SUITE = {
|
const NEW_TEST_SUITE = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user