-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
- Loading branch information
1 parent
e06a6f2
commit cb0d2b7
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'); | ||
}); | ||
}); |