-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Junqiu Lei <[email protected]> (cherry picked from commit 34ba5be) Co-authored-by: Junqiu Lei <[email protected]>
- Loading branch information
1 parent
b937972
commit 35ff2e2
Showing
2 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
cypress/integration/plugins/custom-import-map-dashboards/7_enable_new_home_ui.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { BASE_PATH } from '../../../utils/constants'; | ||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
import { CURRENT_TENANT } from '../../../utils/commands'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('Add flights dataset saved object', () => { | ||
before(() => { | ||
CURRENT_TENANT.newTenant = 'global'; | ||
cy.deleteAllIndices(); | ||
miscUtils.addSampleData(); | ||
cy.wait(10000); | ||
|
||
// Enable the new home UI | ||
cy.visit(`${BASE_PATH}/app/settings`); | ||
cy.get( | ||
'[data-test-subj="advancedSetting-editField-home:useNewHomePage"]' | ||
).then(($switch) => { | ||
if ($switch.attr('aria-checked') === 'false') { | ||
cy.wrap($switch).click(); | ||
cy.get('[data-test-subj="advancedSetting-saveButton"]').click(); | ||
cy.get('button.euiButton--primary.euiButton--small', { | ||
timeout: 15000, | ||
}).click(); | ||
} else { | ||
cy.log('The switch is already on.'); | ||
} | ||
}); | ||
}); | ||
|
||
after(() => { | ||
miscUtils.removeSampleData(); | ||
// Disable the new home UI | ||
cy.visit(`${BASE_PATH}/app/settings`); | ||
cy.get( | ||
'[data-test-subj="advancedSetting-editField-home:useNewHomePage"]' | ||
).then(($switch) => { | ||
if ($switch.attr('aria-checked') === 'true') { | ||
cy.wrap($switch).click(); | ||
cy.get('[data-test-subj="advancedSetting-saveButton"]').click(); | ||
cy.get('button.euiButton--primary.euiButton--small', { | ||
timeout: 15000, | ||
}).click(); | ||
} else { | ||
cy.log('The switch is already off.'); | ||
} | ||
}); | ||
}); | ||
|
||
it('Verify component in maps listing page', () => { | ||
cy.visit(`${BASE_PATH}/app/maps-dashboards`); | ||
|
||
// Verify the presence of the headerRightControl component | ||
cy.get('[data-test-subj="headerRightControl"]').should('exist'); | ||
|
||
// Verify the presence of the maps createButton within the headerRightControl | ||
cy.get('[data-test-subj="headerRightControl"]') | ||
.find('[data-test-subj="createButton"]') | ||
.should('exist'); | ||
}); | ||
|
||
it('Verify component in maps visualization page', () => { | ||
cy.visit(`${BASE_PATH}/app/maps-dashboards/create`); | ||
|
||
// Verify the presence of the top-nav component | ||
cy.get('[data-test-subj="top-nav"]').should('exist'); | ||
|
||
// Verify the presence of the mapSaveButton inside the top-nav component | ||
cy.get('[data-test-subj="top-nav"]') | ||
.find('[data-test-subj="mapSaveButton"]') | ||
.should('exist'); | ||
}); | ||
}); |