From a14c59d8cc0bbe4acacdbd6db5fd5d010e1826b2 Mon Sep 17 00:00:00 2001
From: Anan <ananzh@amazon.com>
Date: Mon, 8 Apr 2024 16:09:58 -0700
Subject: [PATCH 1/3] a

Signed-off-by: Anan <ananzh@amazon.com>
---
 .../common/dashboard_sample_data_spec.js      |   5 +-
 .../apps/vis_type_table/basic.spec.js         |   2 +
 .../apps/vis_type_table/data.spec.js          |   2 +
 .../apps/vis_type_table/embed.spec.js         |   2 +
 .../apps/vis_type_table/options.spec.js       |   2 +
 .../apps/vis_type_table/split.spec.js         | 756 +++++++++---------
 .../1_create_datasource.spec.js               |   2 +
 .../2_datasource_table.spec.js                |   2 +
 .../3_update_datasource.spec.js               |   2 +
 9 files changed, 396 insertions(+), 379 deletions(-)

diff --git a/cypress/integration/common/dashboard_sample_data_spec.js b/cypress/integration/common/dashboard_sample_data_spec.js
index 7d7afa310..1ff84814e 100644
--- a/cypress/integration/common/dashboard_sample_data_spec.js
+++ b/cypress/integration/common/dashboard_sample_data_spec.js
@@ -7,6 +7,7 @@ import {
   CommonUI,
   MiscUtils,
 } from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
+import { CURRENT_TENANT } from '../../utils/commands';
 
 /**
  * dashboard_sample_data test suite description:
@@ -22,7 +23,9 @@ export function dashboardSanityTests() {
   const path = baseURL.pathname.replace(/\/$/, '');
 
   describe('dashboard sample data validation', () => {
-    before(() => {});
+    before(() => {
+      CURRENT_TENANT.newTenant = 'global';
+    });
 
     after(() => {});
 
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/basic.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/basic.spec.js
index f2d822d23..3c03693b2 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/basic.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/basic.spec.js
@@ -13,6 +13,7 @@ import {
   TABLE_VIS_APP_PATH,
   TABLE_VIS_TYPE,
 } from '../../../../../utils/constants';
+import { CURRENT_TENANT } from '../../../../../utils/commands';
 
 /**
  * Basic test suite description:
@@ -25,6 +26,7 @@ import {
 
 describe('table visualization basic functions', () => {
   before(() => {
+    CURRENT_TENANT.newTenant = 'global';
     cy.deleteIndex(TABLE_INDEX_ID);
     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
     cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/data.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/data.spec.js
index 7f3f8aa54..b49940a09 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/data.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/data.spec.js
@@ -16,6 +16,7 @@ import {
   TABLE_INDEX_END_TIME,
   toTestId,
 } from '../../../../../utils/constants';
+import { CURRENT_TENANT } from '../../../../../utils/commands';
 
 const commonUI = new CommonUI(cy);
 
@@ -24,6 +25,7 @@ const commonUI = new CommonUI(cy);
 
 describe('table visualization data', () => {
   before(() => {
+    CURRENT_TENANT.newTenant = 'global';
     cy.deleteIndex(TABLE_INDEX_ID);
     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
     cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js
index 071a5b67f..d188cdf0e 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js
@@ -16,6 +16,7 @@ import {
   TABLE_INDEX_END_TIME,
   toTestId,
 } from '../../../../../utils/constants';
+import { CURRENT_TENANT } from '../../../../../utils/commands';
 
 const commonUI = new CommonUI(cy);
 
@@ -56,6 +57,7 @@ describe('table visualization in embedded mode', () => {
   };
 
   before(() => {
+    CURRENT_TENANT.newTenant = 'global';
     cy.deleteIndex(TABLE_INDEX_ID);
     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
     cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/options.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/options.spec.js
index e7b9575e6..c3ec93848 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/options.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/options.spec.js
@@ -15,9 +15,11 @@ import {
   TABLE_INDEX_END_TIME,
   toTestId,
 } from '../../../../../utils/constants';
+import { CURRENT_TENANT } from '../../../../../utils/commands';
 
 describe('Table visualization options', () => {
   before(() => {
+    CURRENT_TENANT.newTenant = 'global';
     cy.deleteIndex(TABLE_INDEX_ID);
     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
     cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js
index ec4c10dc8..802311f49 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js
@@ -3,392 +3,392 @@
  * SPDX-License-Identifier: Apache-2.0
  */
 
-import {
-  BASE_PATH,
-  TABLE_INDEX_ID,
-  TABLE_PATH_INDEX_DATA,
-  TABLE_INDEX_PATTERN,
-  TABLE_PATH_SO_DATA,
-  TABLE_BASIC_VIS_TITLE,
-  TABLE_VIS_APP_PATH,
-  TABLE_INDEX_START_TIME,
-  TABLE_INDEX_END_TIME,
-  toTestId,
-} from '../../../../../utils/constants';
+// import {
+//   BASE_PATH,
+//   TABLE_INDEX_ID,
+//   TABLE_PATH_INDEX_DATA,
+//   TABLE_INDEX_PATTERN,
+//   TABLE_PATH_SO_DATA,
+//   TABLE_BASIC_VIS_TITLE,
+//   TABLE_VIS_APP_PATH,
+//   TABLE_INDEX_START_TIME,
+//   TABLE_INDEX_END_TIME,
+//   toTestId,
+// } from '../../../../../utils/constants';
 
 // TODO: https://github.com/opensearch-project/opensearch-dashboards-functional-test/issues/699
-describe.skip('Split table', () => {
-  const expectDataInitial = [
-    [
-      'Cat',
-      '10,045',
-      '1',
-      'Cat',
-      '10,096',
-      '1',
-      'Hawk',
-      '17,505',
-      '1',
-      'Hawk',
-      '17,644',
-      '1',
-    ],
-    [
-      'Dog',
-      '12,518',
-      '1',
-      'Dog',
-      '12,520',
-      '1',
-      'Cat',
-      '10,195',
-      '1',
-      'Cat',
-      '10,217',
-      '1',
-    ],
-    [
-      'Hawk',
-      '17,529',
-      '1',
-      'Hawk',
-      '17,597',
-      '1',
-      'Rabbit',
-      '15,015',
-      '1',
-      'Rabbit',
-      '15,194',
-      '1',
-    ],
-  ];
+// describe.skip('Split table', () => {
+//   const expectDataInitial = [
+//     [
+//       'Cat',
+//       '10,045',
+//       '1',
+//       'Cat',
+//       '10,096',
+//       '1',
+//       'Hawk',
+//       '17,505',
+//       '1',
+//       'Hawk',
+//       '17,644',
+//       '1',
+//     ],
+//     [
+//       'Dog',
+//       '12,518',
+//       '1',
+//       'Dog',
+//       '12,520',
+//       '1',
+//       'Cat',
+//       '10,195',
+//       '1',
+//       'Cat',
+//       '10,217',
+//       '1',
+//     ],
+//     [
+//       'Hawk',
+//       '17,529',
+//       '1',
+//       'Hawk',
+//       '17,597',
+//       '1',
+//       'Rabbit',
+//       '15,015',
+//       '1',
+//       'Rabbit',
+//       '15,194',
+//       '1',
+//     ],
+//   ];
 
-  before(() => {
-    cy.deleteIndex(TABLE_INDEX_ID);
-    cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
-    cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
-    cy.importSavedObjects(TABLE_PATH_SO_DATA);
-    // Load table visualization
-    cy.visit(`${BASE_PATH}/app/visualize`);
-    cy.get('input[type="search"]').type(`${TABLE_BASIC_VIS_TITLE}{enter}`);
-    cy.get('.euiBasicTable-loading').should('not.exist'); // wait for the loading to stop
-    cy.getElementByTestId(
-      `visListingTitleLink-${toTestId(TABLE_BASIC_VIS_TITLE)}`
-    )
-      .should('exist')
-      .click();
-    cy.url().should('contain', TABLE_VIS_APP_PATH);
-    cy.setTopNavDate(TABLE_INDEX_START_TIME, TABLE_INDEX_END_TIME);
-    cy.waitForLoader();
-  });
+//   before(() => {
+//     cy.deleteIndex(TABLE_INDEX_ID);
+//     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
+//     cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
+//     cy.importSavedObjects(TABLE_PATH_SO_DATA);
+//     // Load table visualization
+//     cy.visit(`${BASE_PATH}/app/visualize`);
+//     cy.get('input[type="search"]').type(`${TABLE_BASIC_VIS_TITLE}{enter}`);
+//     cy.get('.euiBasicTable-loading').should('not.exist'); // wait for the loading to stop
+//     cy.getElementByTestId(
+//       `visListingTitleLink-${toTestId(TABLE_BASIC_VIS_TITLE)}`
+//     )
+//       .should('exist')
+//       .click();
+//     cy.url().should('contain', TABLE_VIS_APP_PATH);
+//     cy.setTopNavDate(TABLE_INDEX_START_TIME, TABLE_INDEX_END_TIME);
+//     cy.waitForLoader();
+//   });
 
-  it('Should have a splitted table in rows', () => {
-    cy.tbAddBucketsAggregation();
-    cy.tbSplitTables();
-    cy.tbSplitTablesInRows();
-    cy.tbSetupTermsAggregation('age', 'Descending', '3', 2);
-    cy.waitForLoader();
-    cy.tbToggleOpenEditor(2, 'false');
-    cy.tbAddBucketsAggregation();
-    cy.tbSplitRows();
-    cy.tbSetupTermsAggregation('categories.keyword', 'Descending', '2', 3);
-    cy.waitForLoader();
-    cy.tbToggleOpenEditor(3, 'false');
-    cy.tbAddBucketsAggregation();
-    cy.tbSplitRows();
-    cy.tbSetupTermsAggregation('salary', 'Descending', '2', 4);
-    cy.tbToggleOpenEditor(4, 'false');
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataInitial);
-    });
-  });
+//   it('Should have a splitted table in rows', () => {
+//     cy.tbAddBucketsAggregation();
+//     cy.tbSplitTables();
+//     cy.tbSplitTablesInRows();
+//     cy.tbSetupTermsAggregation('age', 'Descending', '3', 2);
+//     cy.waitForLoader();
+//     cy.tbToggleOpenEditor(2, 'false');
+//     cy.tbAddBucketsAggregation();
+//     cy.tbSplitRows();
+//     cy.tbSetupTermsAggregation('categories.keyword', 'Descending', '2', 3);
+//     cy.waitForLoader();
+//     cy.tbToggleOpenEditor(3, 'false');
+//     cy.tbAddBucketsAggregation();
+//     cy.tbSplitRows();
+//     cy.tbSetupTermsAggregation('salary', 'Descending', '2', 4);
+//     cy.tbToggleOpenEditor(4, 'false');
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataInitial);
+//     });
+//   });
 
-  it('Should filter for value in all tables', () => {
-    const expectDataAfterFilter = [
-      ['Hawk', '17,591', '1', 'Hawk', '17,602', '1'],
-      ['Hawk', '17,544', '1', 'Hawk', '17,648', '1'],
-      ['Hawk', '17,503', '1', 'Hawk', '17,515', '1'],
-    ];
-    cy.tbClickTableCellAction(3, 2, 0, 'filter for');
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataAfterFilter);
-    });
-    cy.get('[aria-label="Delete"]').click();
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataInitial);
-    });
-    cy.tbClickTableCellAction(3, 2, 0, 'expand');
-    cy.tbClickFilterFromExpand('filter for');
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataAfterFilter);
-    });
-    cy.get('[aria-label="Delete"]').click();
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataInitial);
-    });
-  });
+//   it('Should filter for value in all tables', () => {
+//     const expectDataAfterFilter = [
+//       ['Hawk', '17,591', '1', 'Hawk', '17,602', '1'],
+//       ['Hawk', '17,544', '1', 'Hawk', '17,648', '1'],
+//       ['Hawk', '17,503', '1', 'Hawk', '17,515', '1'],
+//     ];
+//     cy.tbClickTableCellAction(3, 2, 0, 'filter for');
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataAfterFilter);
+//     });
+//     cy.get('[aria-label="Delete"]').click();
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataInitial);
+//     });
+//     cy.tbClickTableCellAction(3, 2, 0, 'expand');
+//     cy.tbClickFilterFromExpand('filter for');
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataAfterFilter);
+//     });
+//     cy.get('[aria-label="Delete"]').click();
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataInitial);
+//     });
+//   });
 
-  it('Should filter out value in all tables', () => {
-    const expectDataAfterFilter = [
-      [
-        'Dog',
-        '12,518',
-        '1',
-        'Dog',
-        '12,520',
-        '1',
-        'Cat',
-        '10,195',
-        '1',
-        'Cat',
-        '10,217',
-        '1',
-      ],
-      [
-        'Rabbit',
-        '15,032',
-        '1',
-        'Rabbit',
-        '15,044',
-        '1',
-        'Cat',
-        '10,007',
-        '1',
-        'Cat',
-        '10,085',
-        '1',
-      ],
-      [
-        'Cat',
-        '10,045',
-        '1',
-        'Cat',
-        '10,096',
-        '1',
-        'Rabbit',
-        '15,007',
-        '1',
-        'Rabbit',
-        '15,140',
-        '1',
-      ],
-    ];
-    cy.tbClickTableCellAction(3, 2, 0, 'filter out');
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataAfterFilter);
-    });
-    cy.get('[aria-label="Delete"]').click();
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataInitial);
-    });
-    cy.tbClickTableCellAction(3, 2, 0, 'expand');
-    cy.tbClickFilterFromExpand('filter out');
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataAfterFilter);
-    });
-    cy.get('[aria-label="Delete"]').click();
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectDataInitial);
-    });
-  });
+//   it('Should filter out value in all tables', () => {
+//     const expectDataAfterFilter = [
+//       [
+//         'Dog',
+//         '12,518',
+//         '1',
+//         'Dog',
+//         '12,520',
+//         '1',
+//         'Cat',
+//         '10,195',
+//         '1',
+//         'Cat',
+//         '10,217',
+//         '1',
+//       ],
+//       [
+//         'Rabbit',
+//         '15,032',
+//         '1',
+//         'Rabbit',
+//         '15,044',
+//         '1',
+//         'Cat',
+//         '10,007',
+//         '1',
+//         'Cat',
+//         '10,085',
+//         '1',
+//       ],
+//       [
+//         'Cat',
+//         '10,045',
+//         '1',
+//         'Cat',
+//         '10,096',
+//         '1',
+//         'Rabbit',
+//         '15,007',
+//         '1',
+//         'Rabbit',
+//         '15,140',
+//         '1',
+//       ],
+//     ];
+//     cy.tbClickTableCellAction(3, 2, 0, 'filter out');
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataAfterFilter);
+//     });
+//     cy.get('[aria-label="Delete"]').click();
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataInitial);
+//     });
+//     cy.tbClickTableCellAction(3, 2, 0, 'expand');
+//     cy.tbClickFilterFromExpand('filter out');
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataAfterFilter);
+//     });
+//     cy.get('[aria-label="Delete"]').click();
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectDataInitial);
+//     });
+//   });
 
-  it('Should show metrics for split bucket when using showMetricsAtAllLevels', () => {
-    const expectData = [
-      [
-        'Cat',
-        '41',
-        '10,045',
-        '1',
-        'Cat',
-        '41',
-        '10,096',
-        '1',
-        'Hawk',
-        '34',
-        '17,505',
-        '1',
-        'Hawk',
-        '34',
-        '17,644',
-        '1',
-      ],
-      [
-        'Dog',
-        '37',
-        '12,518',
-        '1',
-        'Dog',
-        '37',
-        '12,520',
-        '1',
-        'Cat',
-        '32',
-        '10,195',
-        '1',
-        'Cat',
-        '32',
-        '10,217',
-        '1',
-      ],
-      [
-        'Hawk',
-        '35',
-        '17,529',
-        '1',
-        'Hawk',
-        '35',
-        '17,597',
-        '1',
-        'Rabbit',
-        '35',
-        '15,015',
-        '1',
-        'Rabbit',
-        '35',
-        '15,194',
-        '1',
-      ],
-    ];
-    cy.tbOpenOptionsPanel();
-    cy.tbToggleOptionByName('showMetricsAtAllLevels', 'true');
-    cy.tbUpdateAggregationSettings();
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-      expect(data).to.deep.eq(expectData);
-    });
-  });
+//   it('Should show metrics for split bucket when using showMetricsAtAllLevels', () => {
+//     const expectData = [
+//       [
+//         'Cat',
+//         '41',
+//         '10,045',
+//         '1',
+//         'Cat',
+//         '41',
+//         '10,096',
+//         '1',
+//         'Hawk',
+//         '34',
+//         '17,505',
+//         '1',
+//         'Hawk',
+//         '34',
+//         '17,644',
+//         '1',
+//       ],
+//       [
+//         'Dog',
+//         '37',
+//         '12,518',
+//         '1',
+//         'Dog',
+//         '37',
+//         '12,520',
+//         '1',
+//         'Cat',
+//         '32',
+//         '10,195',
+//         '1',
+//         'Cat',
+//         '32',
+//         '10,217',
+//         '1',
+//       ],
+//       [
+//         'Hawk',
+//         '35',
+//         '17,529',
+//         '1',
+//         'Hawk',
+//         '35',
+//         '17,597',
+//         '1',
+//         'Rabbit',
+//         '35',
+//         '15,015',
+//         '1',
+//         'Rabbit',
+//         '35',
+//         '15,194',
+//         '1',
+//       ],
+//     ];
+//     cy.tbOpenOptionsPanel();
+//     cy.tbToggleOptionByName('showMetricsAtAllLevels', 'true');
+//     cy.tbUpdateAggregationSettings();
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+//       expect(data).to.deep.eq(expectData);
+//     });
+//   });
 
-  it('Should update a splitted table in columns', () => {
-    const expectData = [
-      [
-        'Cat',
-        '41',
-        '10,045',
-        '1',
-        'Cat',
-        '41',
-        '10,096',
-        '1',
-        'Hawk',
-        '34',
-        '17,505',
-        '1',
-        'Hawk',
-        '34',
-        '17,644',
-        '1',
-      ],
-      [
-        'Dog',
-        '37',
-        '12,518',
-        '1',
-        'Dog',
-        '37',
-        '12,520',
-        '1',
-        'Cat',
-        '32',
-        '10,195',
-        '1',
-        'Cat',
-        '32',
-        '10,217',
-        '1',
-      ],
-    ];
-    cy.tbOpenDataPanel();
-    cy.tbToggleOpenEditor(2, 'true');
-    cy.tbSplitTablesInColumns();
-    cy.tbSetupTermsAggregation('age', 'Descending', '2', 2);
-    cy.waitForLoader();
-    cy.get('[class="visTable"]').should('exist');
-    cy.tbGetAllTableDataFromVisualization(2).then((data) => {
-      expect(data).to.deep.eq(expectData);
-    });
-  });
+//   it('Should update a splitted table in columns', () => {
+//     const expectData = [
+//       [
+//         'Cat',
+//         '41',
+//         '10,045',
+//         '1',
+//         'Cat',
+//         '41',
+//         '10,096',
+//         '1',
+//         'Hawk',
+//         '34',
+//         '17,505',
+//         '1',
+//         'Hawk',
+//         '34',
+//         '17,644',
+//         '1',
+//       ],
+//       [
+//         'Dog',
+//         '37',
+//         '12,518',
+//         '1',
+//         'Dog',
+//         '37',
+//         '12,520',
+//         '1',
+//         'Cat',
+//         '32',
+//         '10,195',
+//         '1',
+//         'Cat',
+//         '32',
+//         '10,217',
+//         '1',
+//       ],
+//     ];
+//     cy.tbOpenDataPanel();
+//     cy.tbToggleOpenEditor(2, 'true');
+//     cy.tbSplitTablesInColumns();
+//     cy.tbSetupTermsAggregation('age', 'Descending', '2', 2);
+//     cy.waitForLoader();
+//     cy.get('[class="visTable"]').should('exist');
+//     cy.tbGetAllTableDataFromVisualization(2).then((data) => {
+//       expect(data).to.deep.eq(expectData);
+//     });
+//   });
 
-  it('Should sort column in all tables', () => {
-    const expectData = [
-      [
-        'Cat',
-        '41',
-        '10,045',
-        '1',
-        'Cat',
-        '41',
-        '10,096',
-        '1',
-        'Hawk',
-        '34',
-        '17,505',
-        '1',
-        'Hawk',
-        '34',
-        '17,644',
-        '1',
-      ],
-      [
-        'Cat',
-        '32',
-        '10,195',
-        '1',
-        'Cat',
-        '32',
-        '10,217',
-        '1',
-        'Dog',
-        '37',
-        '12,518',
-        '1',
-        'Dog',
-        '37',
-        '12,520',
-        '1',
-      ],
-    ];
-    cy.tbSelectSortColumn(1, 0, 'asc');
-    cy.waitForLoader();
-    cy.tbGetAllTableDataFromVisualization(2).then((data) => {
-      expect(data).to.deep.eq(expectData);
-    });
-  });
+//   it('Should sort column in all tables', () => {
+//     const expectData = [
+//       [
+//         'Cat',
+//         '41',
+//         '10,045',
+//         '1',
+//         'Cat',
+//         '41',
+//         '10,096',
+//         '1',
+//         'Hawk',
+//         '34',
+//         '17,505',
+//         '1',
+//         'Hawk',
+//         '34',
+//         '17,644',
+//         '1',
+//       ],
+//       [
+//         'Cat',
+//         '32',
+//         '10,195',
+//         '1',
+//         'Cat',
+//         '32',
+//         '10,217',
+//         '1',
+//         'Dog',
+//         '37',
+//         '12,518',
+//         '1',
+//         'Dog',
+//         '37',
+//         '12,520',
+//         '1',
+//       ],
+//     ];
+//     cy.tbSelectSortColumn(1, 0, 'asc');
+//     cy.waitForLoader();
+//     cy.tbGetAllTableDataFromVisualization(2).then((data) => {
+//       expect(data).to.deep.eq(expectData);
+//     });
+//   });
 
-  it('Should adjust column width in all tables', () => {
-    cy.tbGetColumnWidth(0, 1, 't0col0WidthBefore').then((first) => {
-      cy.tbGetColumnWidth(1, 1, 't1col0WidthBefore').then((second) => {
-        expect(second).to.eq(first);
-      });
-    });
-    cy.tbAdjustColumnWidth(4, 1, 1, -50);
-    cy.tbGetColumnWidth(0, 1, 't0col0WidthAfter').then((first) => {
-      cy.tbGetColumnWidth(1, 1, 't1col0WidthAfter').then((second) => {
-        expect(second).to.eq(first);
-      });
-    });
-    cy.get('@t0col0WidthAfter').then((after) => {
-      cy.get('@t0col0WidthBefore').then((before) => {
-        expect(before).equal(after + 50);
-      });
-    });
-    cy.get('@t1col0WidthAfter').then((after) => {
-      cy.get('@t1col0WidthBefore').then((before) => {
-        expect(before).equal(after + 50);
-      });
-    });
-  });
+//   it('Should adjust column width in all tables', () => {
+//     cy.tbGetColumnWidth(0, 1, 't0col0WidthBefore').then((first) => {
+//       cy.tbGetColumnWidth(1, 1, 't1col0WidthBefore').then((second) => {
+//         expect(second).to.eq(first);
+//       });
+//     });
+//     cy.tbAdjustColumnWidth(4, 1, 1, -50);
+//     cy.tbGetColumnWidth(0, 1, 't0col0WidthAfter').then((first) => {
+//       cy.tbGetColumnWidth(1, 1, 't1col0WidthAfter').then((second) => {
+//         expect(second).to.eq(first);
+//       });
+//     });
+//     cy.get('@t0col0WidthAfter').then((after) => {
+//       cy.get('@t0col0WidthBefore').then((before) => {
+//         expect(before).equal(after + 50);
+//       });
+//     });
+//     cy.get('@t1col0WidthAfter').then((after) => {
+//       cy.get('@t1col0WidthBefore').then((before) => {
+//         expect(before).equal(after + 50);
+//       });
+//     });
+//   });
 
-  after(() => {
-    cy.deleteIndex(TABLE_INDEX_ID);
-    cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
-  });
-});
+//   after(() => {
+//     cy.deleteIndex(TABLE_INDEX_ID);
+//     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
+//   });
+// });
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js
index ac5e50c03..cf29b81d5 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js
@@ -17,6 +17,7 @@ import {
   SERVICE_TYPE_OPENSEARCH,
   SERVICE_TYPE_OPENSEARCH_SERVERLESS,
 } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';
+import { CURRENT_TENANT } from '../../../../utils/commands';
 
 const miscUtils = new MiscUtils(cy);
 // Get environment variables
@@ -26,6 +27,7 @@ const password = Cypress.env('password');
 if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
   describe('Create datasources', () => {
     before(() => {
+      CURRENT_TENANT.newTenant = 'global';
       // Clean up before creating new data sources for testing
       cy.deleteAllDataSources();
     });
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js
index 1ad8ecdcd..de9b77941 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js
@@ -7,6 +7,7 @@ import {
   TIMEOUT_OPTS,
   OSD_TEST_DOMAIN_ENDPOINT_URL,
 } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';
+import { CURRENT_TENANT } from '../../../../utils/commands';
 
 const searchFieldIdentifier = 'input[type="search"]';
 const tableHeadIdentifier = 'thead > tr > th';
@@ -14,6 +15,7 @@ const tableHeadIdentifier = 'thead > tr > th';
 if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
   describe('Datasource Management: Table', () => {
     before(() => {
+      CURRENT_TENANT.newTenant = 'global';
       // Visit Data Sources OSD
       cy.visitDataSourcesListingPage();
     });
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js
index e525c6b17..fd0e69b47 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js
@@ -13,6 +13,7 @@ import {
   AUTH_TYPE_NO_AUTH,
   AUTH_TYPE_SIGV4,
 } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';
+import { CURRENT_TENANT } from '../../../../utils/commands';
 
 const passwordFieldIdentifier =
   'input[type="password"][data-test-subj="updateDataSourceFormPasswordField"]';
@@ -41,6 +42,7 @@ const clickOnTableRowTitleColumnByValue = (value) => {
 if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
   describe('Datasource Management: Update', () => {
     before(() => {
+      CURRENT_TENANT.newTenant = 'global';
       // Clean up before creating new data sources for testing
       cy.deleteAllDataSources();
       // Create

From 9ec295c97932ee95bff7c3e96bd88a25e0e1ff97 Mon Sep 17 00:00:00 2001
From: Anan <ananzh@amazon.com>
Date: Mon, 8 Apr 2024 16:30:58 -0700
Subject: [PATCH 2/3] remove comment out

Signed-off-by: Anan <ananzh@amazon.com>
---
 .../apps/vis_type_table/split.spec.js         | 756 +++++++++---------
 1 file changed, 378 insertions(+), 378 deletions(-)

diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js
index 802311f49..ec4c10dc8 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/split.spec.js
@@ -3,392 +3,392 @@
  * SPDX-License-Identifier: Apache-2.0
  */
 
-// import {
-//   BASE_PATH,
-//   TABLE_INDEX_ID,
-//   TABLE_PATH_INDEX_DATA,
-//   TABLE_INDEX_PATTERN,
-//   TABLE_PATH_SO_DATA,
-//   TABLE_BASIC_VIS_TITLE,
-//   TABLE_VIS_APP_PATH,
-//   TABLE_INDEX_START_TIME,
-//   TABLE_INDEX_END_TIME,
-//   toTestId,
-// } from '../../../../../utils/constants';
+import {
+  BASE_PATH,
+  TABLE_INDEX_ID,
+  TABLE_PATH_INDEX_DATA,
+  TABLE_INDEX_PATTERN,
+  TABLE_PATH_SO_DATA,
+  TABLE_BASIC_VIS_TITLE,
+  TABLE_VIS_APP_PATH,
+  TABLE_INDEX_START_TIME,
+  TABLE_INDEX_END_TIME,
+  toTestId,
+} from '../../../../../utils/constants';
 
 // TODO: https://github.com/opensearch-project/opensearch-dashboards-functional-test/issues/699
-// describe.skip('Split table', () => {
-//   const expectDataInitial = [
-//     [
-//       'Cat',
-//       '10,045',
-//       '1',
-//       'Cat',
-//       '10,096',
-//       '1',
-//       'Hawk',
-//       '17,505',
-//       '1',
-//       'Hawk',
-//       '17,644',
-//       '1',
-//     ],
-//     [
-//       'Dog',
-//       '12,518',
-//       '1',
-//       'Dog',
-//       '12,520',
-//       '1',
-//       'Cat',
-//       '10,195',
-//       '1',
-//       'Cat',
-//       '10,217',
-//       '1',
-//     ],
-//     [
-//       'Hawk',
-//       '17,529',
-//       '1',
-//       'Hawk',
-//       '17,597',
-//       '1',
-//       'Rabbit',
-//       '15,015',
-//       '1',
-//       'Rabbit',
-//       '15,194',
-//       '1',
-//     ],
-//   ];
+describe.skip('Split table', () => {
+  const expectDataInitial = [
+    [
+      'Cat',
+      '10,045',
+      '1',
+      'Cat',
+      '10,096',
+      '1',
+      'Hawk',
+      '17,505',
+      '1',
+      'Hawk',
+      '17,644',
+      '1',
+    ],
+    [
+      'Dog',
+      '12,518',
+      '1',
+      'Dog',
+      '12,520',
+      '1',
+      'Cat',
+      '10,195',
+      '1',
+      'Cat',
+      '10,217',
+      '1',
+    ],
+    [
+      'Hawk',
+      '17,529',
+      '1',
+      'Hawk',
+      '17,597',
+      '1',
+      'Rabbit',
+      '15,015',
+      '1',
+      'Rabbit',
+      '15,194',
+      '1',
+    ],
+  ];
 
-//   before(() => {
-//     cy.deleteIndex(TABLE_INDEX_ID);
-//     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
-//     cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
-//     cy.importSavedObjects(TABLE_PATH_SO_DATA);
-//     // Load table visualization
-//     cy.visit(`${BASE_PATH}/app/visualize`);
-//     cy.get('input[type="search"]').type(`${TABLE_BASIC_VIS_TITLE}{enter}`);
-//     cy.get('.euiBasicTable-loading').should('not.exist'); // wait for the loading to stop
-//     cy.getElementByTestId(
-//       `visListingTitleLink-${toTestId(TABLE_BASIC_VIS_TITLE)}`
-//     )
-//       .should('exist')
-//       .click();
-//     cy.url().should('contain', TABLE_VIS_APP_PATH);
-//     cy.setTopNavDate(TABLE_INDEX_START_TIME, TABLE_INDEX_END_TIME);
-//     cy.waitForLoader();
-//   });
+  before(() => {
+    cy.deleteIndex(TABLE_INDEX_ID);
+    cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
+    cy.bulkUploadDocs(TABLE_PATH_INDEX_DATA);
+    cy.importSavedObjects(TABLE_PATH_SO_DATA);
+    // Load table visualization
+    cy.visit(`${BASE_PATH}/app/visualize`);
+    cy.get('input[type="search"]').type(`${TABLE_BASIC_VIS_TITLE}{enter}`);
+    cy.get('.euiBasicTable-loading').should('not.exist'); // wait for the loading to stop
+    cy.getElementByTestId(
+      `visListingTitleLink-${toTestId(TABLE_BASIC_VIS_TITLE)}`
+    )
+      .should('exist')
+      .click();
+    cy.url().should('contain', TABLE_VIS_APP_PATH);
+    cy.setTopNavDate(TABLE_INDEX_START_TIME, TABLE_INDEX_END_TIME);
+    cy.waitForLoader();
+  });
 
-//   it('Should have a splitted table in rows', () => {
-//     cy.tbAddBucketsAggregation();
-//     cy.tbSplitTables();
-//     cy.tbSplitTablesInRows();
-//     cy.tbSetupTermsAggregation('age', 'Descending', '3', 2);
-//     cy.waitForLoader();
-//     cy.tbToggleOpenEditor(2, 'false');
-//     cy.tbAddBucketsAggregation();
-//     cy.tbSplitRows();
-//     cy.tbSetupTermsAggregation('categories.keyword', 'Descending', '2', 3);
-//     cy.waitForLoader();
-//     cy.tbToggleOpenEditor(3, 'false');
-//     cy.tbAddBucketsAggregation();
-//     cy.tbSplitRows();
-//     cy.tbSetupTermsAggregation('salary', 'Descending', '2', 4);
-//     cy.tbToggleOpenEditor(4, 'false');
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataInitial);
-//     });
-//   });
+  it('Should have a splitted table in rows', () => {
+    cy.tbAddBucketsAggregation();
+    cy.tbSplitTables();
+    cy.tbSplitTablesInRows();
+    cy.tbSetupTermsAggregation('age', 'Descending', '3', 2);
+    cy.waitForLoader();
+    cy.tbToggleOpenEditor(2, 'false');
+    cy.tbAddBucketsAggregation();
+    cy.tbSplitRows();
+    cy.tbSetupTermsAggregation('categories.keyword', 'Descending', '2', 3);
+    cy.waitForLoader();
+    cy.tbToggleOpenEditor(3, 'false');
+    cy.tbAddBucketsAggregation();
+    cy.tbSplitRows();
+    cy.tbSetupTermsAggregation('salary', 'Descending', '2', 4);
+    cy.tbToggleOpenEditor(4, 'false');
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataInitial);
+    });
+  });
 
-//   it('Should filter for value in all tables', () => {
-//     const expectDataAfterFilter = [
-//       ['Hawk', '17,591', '1', 'Hawk', '17,602', '1'],
-//       ['Hawk', '17,544', '1', 'Hawk', '17,648', '1'],
-//       ['Hawk', '17,503', '1', 'Hawk', '17,515', '1'],
-//     ];
-//     cy.tbClickTableCellAction(3, 2, 0, 'filter for');
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataAfterFilter);
-//     });
-//     cy.get('[aria-label="Delete"]').click();
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataInitial);
-//     });
-//     cy.tbClickTableCellAction(3, 2, 0, 'expand');
-//     cy.tbClickFilterFromExpand('filter for');
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataAfterFilter);
-//     });
-//     cy.get('[aria-label="Delete"]').click();
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataInitial);
-//     });
-//   });
+  it('Should filter for value in all tables', () => {
+    const expectDataAfterFilter = [
+      ['Hawk', '17,591', '1', 'Hawk', '17,602', '1'],
+      ['Hawk', '17,544', '1', 'Hawk', '17,648', '1'],
+      ['Hawk', '17,503', '1', 'Hawk', '17,515', '1'],
+    ];
+    cy.tbClickTableCellAction(3, 2, 0, 'filter for');
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataAfterFilter);
+    });
+    cy.get('[aria-label="Delete"]').click();
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataInitial);
+    });
+    cy.tbClickTableCellAction(3, 2, 0, 'expand');
+    cy.tbClickFilterFromExpand('filter for');
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataAfterFilter);
+    });
+    cy.get('[aria-label="Delete"]').click();
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataInitial);
+    });
+  });
 
-//   it('Should filter out value in all tables', () => {
-//     const expectDataAfterFilter = [
-//       [
-//         'Dog',
-//         '12,518',
-//         '1',
-//         'Dog',
-//         '12,520',
-//         '1',
-//         'Cat',
-//         '10,195',
-//         '1',
-//         'Cat',
-//         '10,217',
-//         '1',
-//       ],
-//       [
-//         'Rabbit',
-//         '15,032',
-//         '1',
-//         'Rabbit',
-//         '15,044',
-//         '1',
-//         'Cat',
-//         '10,007',
-//         '1',
-//         'Cat',
-//         '10,085',
-//         '1',
-//       ],
-//       [
-//         'Cat',
-//         '10,045',
-//         '1',
-//         'Cat',
-//         '10,096',
-//         '1',
-//         'Rabbit',
-//         '15,007',
-//         '1',
-//         'Rabbit',
-//         '15,140',
-//         '1',
-//       ],
-//     ];
-//     cy.tbClickTableCellAction(3, 2, 0, 'filter out');
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataAfterFilter);
-//     });
-//     cy.get('[aria-label="Delete"]').click();
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataInitial);
-//     });
-//     cy.tbClickTableCellAction(3, 2, 0, 'expand');
-//     cy.tbClickFilterFromExpand('filter out');
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataAfterFilter);
-//     });
-//     cy.get('[aria-label="Delete"]').click();
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectDataInitial);
-//     });
-//   });
+  it('Should filter out value in all tables', () => {
+    const expectDataAfterFilter = [
+      [
+        'Dog',
+        '12,518',
+        '1',
+        'Dog',
+        '12,520',
+        '1',
+        'Cat',
+        '10,195',
+        '1',
+        'Cat',
+        '10,217',
+        '1',
+      ],
+      [
+        'Rabbit',
+        '15,032',
+        '1',
+        'Rabbit',
+        '15,044',
+        '1',
+        'Cat',
+        '10,007',
+        '1',
+        'Cat',
+        '10,085',
+        '1',
+      ],
+      [
+        'Cat',
+        '10,045',
+        '1',
+        'Cat',
+        '10,096',
+        '1',
+        'Rabbit',
+        '15,007',
+        '1',
+        'Rabbit',
+        '15,140',
+        '1',
+      ],
+    ];
+    cy.tbClickTableCellAction(3, 2, 0, 'filter out');
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataAfterFilter);
+    });
+    cy.get('[aria-label="Delete"]').click();
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataInitial);
+    });
+    cy.tbClickTableCellAction(3, 2, 0, 'expand');
+    cy.tbClickFilterFromExpand('filter out');
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataAfterFilter);
+    });
+    cy.get('[aria-label="Delete"]').click();
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectDataInitial);
+    });
+  });
 
-//   it('Should show metrics for split bucket when using showMetricsAtAllLevels', () => {
-//     const expectData = [
-//       [
-//         'Cat',
-//         '41',
-//         '10,045',
-//         '1',
-//         'Cat',
-//         '41',
-//         '10,096',
-//         '1',
-//         'Hawk',
-//         '34',
-//         '17,505',
-//         '1',
-//         'Hawk',
-//         '34',
-//         '17,644',
-//         '1',
-//       ],
-//       [
-//         'Dog',
-//         '37',
-//         '12,518',
-//         '1',
-//         'Dog',
-//         '37',
-//         '12,520',
-//         '1',
-//         'Cat',
-//         '32',
-//         '10,195',
-//         '1',
-//         'Cat',
-//         '32',
-//         '10,217',
-//         '1',
-//       ],
-//       [
-//         'Hawk',
-//         '35',
-//         '17,529',
-//         '1',
-//         'Hawk',
-//         '35',
-//         '17,597',
-//         '1',
-//         'Rabbit',
-//         '35',
-//         '15,015',
-//         '1',
-//         'Rabbit',
-//         '35',
-//         '15,194',
-//         '1',
-//       ],
-//     ];
-//     cy.tbOpenOptionsPanel();
-//     cy.tbToggleOptionByName('showMetricsAtAllLevels', 'true');
-//     cy.tbUpdateAggregationSettings();
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(3).then((data) => {
-//       expect(data).to.deep.eq(expectData);
-//     });
-//   });
+  it('Should show metrics for split bucket when using showMetricsAtAllLevels', () => {
+    const expectData = [
+      [
+        'Cat',
+        '41',
+        '10,045',
+        '1',
+        'Cat',
+        '41',
+        '10,096',
+        '1',
+        'Hawk',
+        '34',
+        '17,505',
+        '1',
+        'Hawk',
+        '34',
+        '17,644',
+        '1',
+      ],
+      [
+        'Dog',
+        '37',
+        '12,518',
+        '1',
+        'Dog',
+        '37',
+        '12,520',
+        '1',
+        'Cat',
+        '32',
+        '10,195',
+        '1',
+        'Cat',
+        '32',
+        '10,217',
+        '1',
+      ],
+      [
+        'Hawk',
+        '35',
+        '17,529',
+        '1',
+        'Hawk',
+        '35',
+        '17,597',
+        '1',
+        'Rabbit',
+        '35',
+        '15,015',
+        '1',
+        'Rabbit',
+        '35',
+        '15,194',
+        '1',
+      ],
+    ];
+    cy.tbOpenOptionsPanel();
+    cy.tbToggleOptionByName('showMetricsAtAllLevels', 'true');
+    cy.tbUpdateAggregationSettings();
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(3).then((data) => {
+      expect(data).to.deep.eq(expectData);
+    });
+  });
 
-//   it('Should update a splitted table in columns', () => {
-//     const expectData = [
-//       [
-//         'Cat',
-//         '41',
-//         '10,045',
-//         '1',
-//         'Cat',
-//         '41',
-//         '10,096',
-//         '1',
-//         'Hawk',
-//         '34',
-//         '17,505',
-//         '1',
-//         'Hawk',
-//         '34',
-//         '17,644',
-//         '1',
-//       ],
-//       [
-//         'Dog',
-//         '37',
-//         '12,518',
-//         '1',
-//         'Dog',
-//         '37',
-//         '12,520',
-//         '1',
-//         'Cat',
-//         '32',
-//         '10,195',
-//         '1',
-//         'Cat',
-//         '32',
-//         '10,217',
-//         '1',
-//       ],
-//     ];
-//     cy.tbOpenDataPanel();
-//     cy.tbToggleOpenEditor(2, 'true');
-//     cy.tbSplitTablesInColumns();
-//     cy.tbSetupTermsAggregation('age', 'Descending', '2', 2);
-//     cy.waitForLoader();
-//     cy.get('[class="visTable"]').should('exist');
-//     cy.tbGetAllTableDataFromVisualization(2).then((data) => {
-//       expect(data).to.deep.eq(expectData);
-//     });
-//   });
+  it('Should update a splitted table in columns', () => {
+    const expectData = [
+      [
+        'Cat',
+        '41',
+        '10,045',
+        '1',
+        'Cat',
+        '41',
+        '10,096',
+        '1',
+        'Hawk',
+        '34',
+        '17,505',
+        '1',
+        'Hawk',
+        '34',
+        '17,644',
+        '1',
+      ],
+      [
+        'Dog',
+        '37',
+        '12,518',
+        '1',
+        'Dog',
+        '37',
+        '12,520',
+        '1',
+        'Cat',
+        '32',
+        '10,195',
+        '1',
+        'Cat',
+        '32',
+        '10,217',
+        '1',
+      ],
+    ];
+    cy.tbOpenDataPanel();
+    cy.tbToggleOpenEditor(2, 'true');
+    cy.tbSplitTablesInColumns();
+    cy.tbSetupTermsAggregation('age', 'Descending', '2', 2);
+    cy.waitForLoader();
+    cy.get('[class="visTable"]').should('exist');
+    cy.tbGetAllTableDataFromVisualization(2).then((data) => {
+      expect(data).to.deep.eq(expectData);
+    });
+  });
 
-//   it('Should sort column in all tables', () => {
-//     const expectData = [
-//       [
-//         'Cat',
-//         '41',
-//         '10,045',
-//         '1',
-//         'Cat',
-//         '41',
-//         '10,096',
-//         '1',
-//         'Hawk',
-//         '34',
-//         '17,505',
-//         '1',
-//         'Hawk',
-//         '34',
-//         '17,644',
-//         '1',
-//       ],
-//       [
-//         'Cat',
-//         '32',
-//         '10,195',
-//         '1',
-//         'Cat',
-//         '32',
-//         '10,217',
-//         '1',
-//         'Dog',
-//         '37',
-//         '12,518',
-//         '1',
-//         'Dog',
-//         '37',
-//         '12,520',
-//         '1',
-//       ],
-//     ];
-//     cy.tbSelectSortColumn(1, 0, 'asc');
-//     cy.waitForLoader();
-//     cy.tbGetAllTableDataFromVisualization(2).then((data) => {
-//       expect(data).to.deep.eq(expectData);
-//     });
-//   });
+  it('Should sort column in all tables', () => {
+    const expectData = [
+      [
+        'Cat',
+        '41',
+        '10,045',
+        '1',
+        'Cat',
+        '41',
+        '10,096',
+        '1',
+        'Hawk',
+        '34',
+        '17,505',
+        '1',
+        'Hawk',
+        '34',
+        '17,644',
+        '1',
+      ],
+      [
+        'Cat',
+        '32',
+        '10,195',
+        '1',
+        'Cat',
+        '32',
+        '10,217',
+        '1',
+        'Dog',
+        '37',
+        '12,518',
+        '1',
+        'Dog',
+        '37',
+        '12,520',
+        '1',
+      ],
+    ];
+    cy.tbSelectSortColumn(1, 0, 'asc');
+    cy.waitForLoader();
+    cy.tbGetAllTableDataFromVisualization(2).then((data) => {
+      expect(data).to.deep.eq(expectData);
+    });
+  });
 
-//   it('Should adjust column width in all tables', () => {
-//     cy.tbGetColumnWidth(0, 1, 't0col0WidthBefore').then((first) => {
-//       cy.tbGetColumnWidth(1, 1, 't1col0WidthBefore').then((second) => {
-//         expect(second).to.eq(first);
-//       });
-//     });
-//     cy.tbAdjustColumnWidth(4, 1, 1, -50);
-//     cy.tbGetColumnWidth(0, 1, 't0col0WidthAfter').then((first) => {
-//       cy.tbGetColumnWidth(1, 1, 't1col0WidthAfter').then((second) => {
-//         expect(second).to.eq(first);
-//       });
-//     });
-//     cy.get('@t0col0WidthAfter').then((after) => {
-//       cy.get('@t0col0WidthBefore').then((before) => {
-//         expect(before).equal(after + 50);
-//       });
-//     });
-//     cy.get('@t1col0WidthAfter').then((after) => {
-//       cy.get('@t1col0WidthBefore').then((before) => {
-//         expect(before).equal(after + 50);
-//       });
-//     });
-//   });
+  it('Should adjust column width in all tables', () => {
+    cy.tbGetColumnWidth(0, 1, 't0col0WidthBefore').then((first) => {
+      cy.tbGetColumnWidth(1, 1, 't1col0WidthBefore').then((second) => {
+        expect(second).to.eq(first);
+      });
+    });
+    cy.tbAdjustColumnWidth(4, 1, 1, -50);
+    cy.tbGetColumnWidth(0, 1, 't0col0WidthAfter').then((first) => {
+      cy.tbGetColumnWidth(1, 1, 't1col0WidthAfter').then((second) => {
+        expect(second).to.eq(first);
+      });
+    });
+    cy.get('@t0col0WidthAfter').then((after) => {
+      cy.get('@t0col0WidthBefore').then((before) => {
+        expect(before).equal(after + 50);
+      });
+    });
+    cy.get('@t1col0WidthAfter').then((after) => {
+      cy.get('@t1col0WidthBefore').then((before) => {
+        expect(before).equal(after + 50);
+      });
+    });
+  });
 
-//   after(() => {
-//     cy.deleteIndex(TABLE_INDEX_ID);
-//     cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
-//   });
-// });
+  after(() => {
+    cy.deleteIndex(TABLE_INDEX_ID);
+    cy.deleteIndexPattern(TABLE_INDEX_PATTERN);
+  });
+});

From dbaf1b0d2f3410825085536cb94b54c676acb1f0 Mon Sep 17 00:00:00 2001
From: Anan <ananzh@amazon.com>
Date: Mon, 8 Apr 2024 16:33:04 -0700
Subject: [PATCH 3/3] remove tenant fix for MD

Signed-off-by: Anan <ananzh@amazon.com>
---
 .../datasource-management-plugin/1_create_datasource.spec.js    | 2 --
 .../datasource-management-plugin/2_datasource_table.spec.js     | 2 --
 .../datasource-management-plugin/3_update_datasource.spec.js    | 2 --
 3 files changed, 6 deletions(-)

diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js
index cf29b81d5..ac5e50c03 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js
@@ -17,7 +17,6 @@ import {
   SERVICE_TYPE_OPENSEARCH,
   SERVICE_TYPE_OPENSEARCH_SERVERLESS,
 } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';
-import { CURRENT_TENANT } from '../../../../utils/commands';
 
 const miscUtils = new MiscUtils(cy);
 // Get environment variables
@@ -27,7 +26,6 @@ const password = Cypress.env('password');
 if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
   describe('Create datasources', () => {
     before(() => {
-      CURRENT_TENANT.newTenant = 'global';
       // Clean up before creating new data sources for testing
       cy.deleteAllDataSources();
     });
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js
index de9b77941..1ad8ecdcd 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/2_datasource_table.spec.js
@@ -7,7 +7,6 @@ import {
   TIMEOUT_OPTS,
   OSD_TEST_DOMAIN_ENDPOINT_URL,
 } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';
-import { CURRENT_TENANT } from '../../../../utils/commands';
 
 const searchFieldIdentifier = 'input[type="search"]';
 const tableHeadIdentifier = 'thead > tr > th';
@@ -15,7 +14,6 @@ const tableHeadIdentifier = 'thead > tr > th';
 if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
   describe('Datasource Management: Table', () => {
     before(() => {
-      CURRENT_TENANT.newTenant = 'global';
       // Visit Data Sources OSD
       cy.visitDataSourcesListingPage();
     });
diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js
index fd0e69b47..e525c6b17 100644
--- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js
+++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/3_update_datasource.spec.js
@@ -13,7 +13,6 @@ import {
   AUTH_TYPE_NO_AUTH,
   AUTH_TYPE_SIGV4,
 } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';
-import { CURRENT_TENANT } from '../../../../utils/commands';
 
 const passwordFieldIdentifier =
   'input[type="password"][data-test-subj="updateDataSourceFormPasswordField"]';
@@ -42,7 +41,6 @@ const clickOnTableRowTitleColumnByValue = (value) => {
 if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
   describe('Datasource Management: Update', () => {
     before(() => {
-      CURRENT_TENANT.newTenant = 'global';
       // Clean up before creating new data sources for testing
       cy.deleteAllDataSources();
       // Create