Skip to content

Commit 179ca7a

Browse files
authored
fix: use lightweight way to flesh tenant settings (#1314)
* fix: use lightweight way to flesh tenant settings Signed-off-by: SuZhou-Joe <[email protected]> * fix: use lightweight way to flesh tenant settings Signed-off-by: SuZhou-Joe <[email protected]> --------- Signed-off-by: SuZhou-Joe <[email protected]>
1 parent f74fdfd commit 179ca7a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

cypress/utils/commands.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,3 @@ Cypress.Commands.add('loadSampleData', (type) => {
587587
url: `${BASE_PATH}/api/sample_data/${type}`,
588588
});
589589
});
590-
591-
Cypress.Commands.add('fleshTenantSettings', () => {
592-
if (Cypress.env('SECURITY_ENABLED')) {
593-
localStorage.setItem('home:newThemeModal:show', 'false');
594-
localStorage.setItem('home:welcome:show', 'false');
595-
// Go to the home page to flesh the tenant settings
596-
cy.visit(`/app/home`);
597-
cy.waitForLoader();
598-
}
599-
});

cypress/utils/dashboards/commands.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import './vis_builder/commands';
77
import './vis_type_table/commands';
88
import './vis-augmenter/commands';
99
import './data_explorer/commands';
10+
import { BASE_PATH } from '../base_constants';
11+
import { CURRENT_TENANT } from '../commands';
1012

1113
Cypress.Commands.add('waitForLoader', () => {
1214
const opts = { log: false };
@@ -117,3 +119,14 @@ Cypress.Commands.add('setTopNavDate', (start, end, submit = true) => {
117119
Cypress.Commands.add('updateTopNav', (options) => {
118120
cy.getElementByTestId('querySubmitButton', options).click({ force: true });
119121
});
122+
123+
Cypress.Commands.add('fleshTenantSettings', () => {
124+
if (Cypress.env('SECURITY_ENABLED')) {
125+
// Use xhr request is good enough to flesh tenant
126+
cy.request({
127+
url: `${BASE_PATH}/app/home?security_tenant=${CURRENT_TENANT.defaultTenant}`,
128+
method: 'GET',
129+
failOnStatusCode: false,
130+
});
131+
}
132+
});

0 commit comments

Comments
 (0)