Skip to content

Commit

Permalink
fix failed cypress integ-testing (opensearch-project#106)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhongnan Su <szhongna@amazon.com>
  • Loading branch information
zhongnansu authored Jun 30, 2021
1 parent 4be9a4b commit 104523a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .cypress/integration/01-create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ describe('Cypress', () => {
// set report trigger to Schedule option
cy.get('[type="radio"]').check({ force: true });

// set source back to saved search for testing purpose
cy.get('#savedSearchReportSource').check({ force: true });

// create scheduled report definition
cy.get('#createNewReportDefinition').click({ force: true });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function ReportSettings(props: ReportSettingProps) {
reportDefinitionRequest.report_params.report_source = 'Dashboard';
reportDefinitionRequest.report_params.core_params.base_url =
getDashboardBaseUrlCreate(edit, editDefinitionId, fromInContext) +
dashboards[0].value;
dashboards[0]?.value;

// set params to visual report params after switch from saved search
handleDataToVisualReportSourceChange(reportDefinitionRequest);
Expand All @@ -172,7 +172,7 @@ export function ReportSettings(props: ReportSettingProps) {
reportDefinitionRequest.report_params.report_source = 'Visualization';
reportDefinitionRequest.report_params.core_params.base_url =
getVisualizationBaseUrlCreate(edit, editDefinitionId, fromInContext) +
visualizations[0].value;
visualizations[0]?.value;

// set params to visual report params after switch from saved search
handleDataToVisualReportSourceChange(reportDefinitionRequest);
Expand All @@ -181,17 +181,17 @@ export function ReportSettings(props: ReportSettingProps) {
reportDefinitionRequest.report_params.report_source = 'Saved search';
reportDefinitionRequest.report_params.core_params.base_url =
getSavedSearchBaseUrlCreate(edit, editDefinitionId, fromInContext) +
savedSearches[0].value;
savedSearches[0]?.value;
reportDefinitionRequest.report_params.core_params.saved_search_id =
savedSearches[0].value;
savedSearches[0]?.value;
reportDefinitionRequest.report_params.core_params.report_format = 'csv';
reportDefinitionRequest.report_params.core_params.limit = 10000;
reportDefinitionRequest.report_params.core_params.excel = true;
} else if (e === 'notebooksReportSource') {
reportDefinitionRequest.report_params.report_source = 'Notebook';
reportDefinitionRequest.report_params.core_params.base_url =
getNotebooksBaseUrlCreate(edit, editDefinitionId, fromInContext) +
notebooks[0].value;
notebooks[0]?.value;

// set params to visual report params after switch from saved search
handleDataToVisualReportSourceChange(reportDefinitionRequest);
Expand Down

0 comments on commit 104523a

Please sign in to comment.