From d9460debf36cda3b8050a004480da77bbeed9ccd Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 10 May 2024 10:31:52 +0800 Subject: [PATCH] fix: defaultTenant does not take effect (#1318) Signed-off-by: SuZhou-Joe --- cypress/utils/commands.js | 11 +++++++++++ cypress/utils/dashboards/commands.js | 13 ------------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/cypress/utils/commands.js b/cypress/utils/commands.js index edcc9cf3f..4ee15662c 100644 --- a/cypress/utils/commands.js +++ b/cypress/utils/commands.js @@ -587,3 +587,14 @@ Cypress.Commands.add('loadSampleData', (type) => { url: `${BASE_PATH}/api/sample_data/${type}`, }); }); + +Cypress.Commands.add('fleshTenantSettings', () => { + if (Cypress.env('SECURITY_ENABLED')) { + // Use xhr request is good enough to flesh tenant + cy.request({ + url: `${BASE_PATH}/app/home?security_tenant=${CURRENT_TENANT.defaultTenant}`, + method: 'GET', + failOnStatusCode: false, + }); + } +}); diff --git a/cypress/utils/dashboards/commands.js b/cypress/utils/dashboards/commands.js index 38d32be8c..4be5cca40 100644 --- a/cypress/utils/dashboards/commands.js +++ b/cypress/utils/dashboards/commands.js @@ -7,8 +7,6 @@ import './vis_builder/commands'; import './vis_type_table/commands'; import './vis-augmenter/commands'; import './data_explorer/commands'; -import { BASE_PATH } from '../base_constants'; -import { CURRENT_TENANT } from '../commands'; Cypress.Commands.add('waitForLoader', () => { const opts = { log: false }; @@ -119,14 +117,3 @@ Cypress.Commands.add('setTopNavDate', (start, end, submit = true) => { Cypress.Commands.add('updateTopNav', (options) => { cy.getElementByTestId('querySubmitButton', options).click({ force: true }); }); - -Cypress.Commands.add('fleshTenantSettings', () => { - if (Cypress.env('SECURITY_ENABLED')) { - // Use xhr request is good enough to flesh tenant - cy.request({ - url: `${BASE_PATH}/app/home?security_tenant=${CURRENT_TENANT.defaultTenant}`, - method: 'GET', - failOnStatusCode: false, - }); - } -});