Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.17] [Maps plugin] Skip new home UI test if disabled in OSD #1589

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ import { CURRENT_TENANT } from '../../../utils/commands';

const miscUtils = new MiscUtils(cy);

describe('Add flights dataset saved object', () => {
before(() => {
describe('Add flights dataset saved object', function () {
before(function () {
CURRENT_TENANT.newTenant = 'global';
cy.deleteAllIndices();
miscUtils.addSampleData();
cy.wait(10000);

// Enable the new home UI
// Enable the new home UI if possible
cy.visit(`${BASE_PATH}/app/settings`);
cy.get(
'[data-test-subj="advancedSetting-editField-home:useNewHomePage"]'
).then(($switch) => {
if ($switch.attr('aria-checked') === 'false') {
if ($switch.attr('disabled') === 'disabled') {
cy.log('Switch is disabled and cannot be changed.');
this.skip(); // Skip all tests in this suite
} else 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', {
Expand All @@ -35,12 +38,14 @@ describe('Add flights dataset saved object', () => {

after(() => {
miscUtils.removeSampleData();
// Disable the new home UI
// Disable the new home UI if possible
cy.visit(`${BASE_PATH}/app/settings`);
cy.get(
'[data-test-subj="advancedSetting-editField-home:useNewHomePage"]'
).then(($switch) => {
if ($switch.attr('aria-checked') === 'true') {
if ($switch.attr('disabled') === 'disabled') {
cy.log('Switch is disabled and cannot be changed.');
} else 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', {
Expand Down
Loading