diff --git a/model/savedSearchModel.js b/model/savedSearchModel.js index a4b76fc..c51f397 100644 --- a/model/savedSearchModel.js +++ b/model/savedSearchModel.js @@ -55,6 +55,13 @@ class savedSearchModel { savedSearchAction.pressSaveReport(payload.sendReport.type, payload.sendReport.selector) } + createNewSavedSearch(payload){ + return savedSearchAPI.createTableAndPolulate(payload); + } + + createYamlFile(payload){ + return savedSearchAPI.createYamlFile(payload); + } } export default new savedSearchModel(); diff --git a/pages/savedSearchAPI.js b/pages/savedSearchAPI.js index c10371a..889caa6 100644 --- a/pages/savedSearchAPI.js +++ b/pages/savedSearchAPI.js @@ -44,6 +44,46 @@ class SavedSearchAPI { }); }); } + /* payload must be in this format + payload = { + "yaml_file_name": "name_savedSearch.yaml", + "saved_search_ids": ID_SAVED_SEARCH + } + add `SAVED_SEARCH_ADVANCED_CONFIGURATION_ENDPOINT_ENABLED=true` variable in the .env file before use this method + */ + createTableAndPolulate(payload){ + return cy.window().then(win => { + return win.ProcessMaker.apiClient.post( + `/saved-searches/advanced-configurations/`, + payload + ).then(response => { + return response.data + }); + }); + } + + /* payload must be in this format + payload = { + "saved_search_id": 620, + "yaml_file_name": "qa_ss620.yaml", + "creation_schedule":{ + "date":"2026-10-08", + "time":"14:00", + "timezone":"UTC" + } + } + add `SAVED_SEARCH_ADVANCED_CONFIGURATION_ENDPOINT_ENABLED=true` variable in the .env file before use this method + */ + createYamlFile(payload){ + return cy.window().then(win => { + return win.ProcessMaker.apiClient.post( + `/saved-searches/advanced-configurations/yaml-files`, + payload + ).then(response => { + return response.data + }); + }); + } } export default new SavedSearchAPI(); \ No newline at end of file