e2e cleanup (#2951)

* reduce the code

* reduce code

* reduce code

* reduce code

* cleanup tests

* more readable code

* cleanup code

* fix code

* even more cleanup

* remove some deprecated apis

* code fixes

* cleanup files

* more files switching to user actions
This commit is contained in:
Denys Vuika
2023-02-01 23:22:37 +00:00
committed by GitHub
parent a325deaf1a
commit 567882e864
42 changed files with 628 additions and 926 deletions

View File

@@ -35,7 +35,7 @@ export class SearchApi extends RepoApi {
super(username, password);
}
async queryRecentFiles(username: string) {
private async queryRecentFiles(username: string) {
const data = {
query: {
query: '*',
@@ -66,7 +66,7 @@ export class SearchApi extends RepoApi {
}
}
async queryNodesNames(searchTerm: string) {
private async queryNodesNames(searchTerm: string) {
const data = {
query: {
query: `cm:name:\"${searchTerm}*\"`,
@@ -84,33 +84,6 @@ export class SearchApi extends RepoApi {
}
}
async getSearchByTermTotalItems(searchTerm: string): Promise<number> {
try {
return (await this.queryNodesNames(searchTerm)).list.pagination.totalItems;
} catch (error) {
this.handleError(`SearchApi getSearchByTermTotalItems : catch : `, error);
return -1;
}
}
async queryNodesExactNames(searchTerm: string) {
const data = {
query: {
query: `cm:name:\"${searchTerm}\"`,
language: 'afts'
},
filterQueries: [{ query: `+TYPE:'cm:folder' OR +TYPE:'cm:content'` }]
};
try {
await this.apiAuth();
return this.searchApi.search(data);
} catch (error) {
this.handleError(`SearchApi queryNodesExactNames : catch : `, error);
return null;
}
}
async waitForApi(username: string, data: { expect: number }) {
try {
const recentFiles = async () => {
@@ -134,7 +107,7 @@ export class SearchApi extends RepoApi {
const apiCall = async () => {
try {
return await this.getSearchByTermTotalItems(searchTerm);
return (await this.queryNodesNames(searchTerm)).list.pagination.totalItems;
} catch (error) {
return 0;
}