Skip to content

Commit

Permalink
Merge pull request rancher#12354 from codyrancher/e2e-4
Browse files Browse the repository at this point in the history
Enabling several E2E tests that were disabled for the vue3 migration
  • Loading branch information
codyrancher authored Oct 28, 2024
2 parents 8662b03 + c54464e commit 456fc9a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
6 changes: 4 additions & 2 deletions cypress/e2e/tests/pages/fleet/gitrepo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { HeaderPo } from '@/cypress/e2e/po/components/header.po';
const fakeProvClusterId = 'some-fake-cluster-id';
const fakeMgmtClusterId = 'some-fake-mgmt-id';

describe.skip('[Vue3 Skip]: Git Repo', { testIsolation: 'off', tags: ['@fleet', '@adminUser'] }, () => {
describe('Git Repo', { testIsolation: 'off', tags: ['@fleet', '@adminUser'] }, () => {
describe('Create', () => {
const listPage = new FleetGitRepoListPagePo();
const gitRepoCreatePage = new GitRepoCreatePo('_');
Expand Down Expand Up @@ -108,7 +108,9 @@ describe.skip('[Vue3 Skip]: Git Repo', { testIsolation: 'off', tags: ['@fleet',
prefPage.languageDropdownMenu().toggle();
prefPage.languageDropdownMenu().isOpened();

cy.intercept('PUT', 'v1/userpreferences/*').as(`prefUpdateZhHans`);
cy.intercept({
method: 'PUT', url: 'v1/userpreferences/*', times: 1
}).as(`prefUpdateZhHans`);
prefPage.languageDropdownMenu().clickOption(2);
cy.wait('@prefUpdateZhHans').then(({ response }) => {
expect(response?.statusCode).to.eq(200);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/tests/pages/generic/diagnostic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from 'path';

const downloadsFolder = Cypress.config('downloadsFolder');

describe.skip('[Vue3 Skip]: Diagnostics Page', { tags: ['@generic', '@adminUser'] }, () => {
describe('Diagnostics Page', { tags: ['@generic', '@adminUser'] }, () => {
beforeEach(() => {
cy.login();
});
Expand Down
35 changes: 18 additions & 17 deletions cypress/e2e/tests/pages/global-settings/settings-p2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const accountPage = new AccountPagePo();
const clusterList = new ClusterManagerListPagePo();
const burgerMenu = new BurgerMenuPo();
const settingsOrginal = [];
let removeServerUrl = false;
const removeServerUrl = false;

describe('Settings', { testIsolation: 'off' }, () => {
before(() => {
Expand Down Expand Up @@ -224,9 +224,10 @@ describe('Settings', { testIsolation: 'off' }, () => {
settingsPage.settingsValue('ui-offline-preferred').contains(settings['ui-offline-preferred'].original);
});

it.skip('[Vue3 Skip]: can update ui-brand', { tags: ['@globalSettings', '@adminUser'] }, () => {
const rancherLogo = '/img/rancher-logo.66cf5910.svg';
const suseRancherLogo = '/img/rancher-logo.055089a3.svg';
it('can update ui-brand', { tags: ['@globalSettings', '@adminUser'] }, () => {
// We probably want a better way to distinguish between rancher and suse logos. I'm doing this as part of the vue3 migration and trying to keep things as similar as possible.
const rancherLogoWidth = 142;
const suseRancherLogoWidth = 82;

// Update setting
SettingsPagePo.navTo();
Expand All @@ -243,15 +244,17 @@ describe('Settings', { testIsolation: 'off' }, () => {

// Check logos in top-level navigation header for updated logo
BurgerMenuPo.toggle();
burgerMenu.brandLogoImage().should('be.visible').then((el) => {
expect(el).to.have.attr('src').includes(suseRancherLogo);
});
burgerMenu.brandLogoImage()
.should('be.visible')
.invoke('outerWidth').then((str) => parseInt(str))
.should('eq', suseRancherLogoWidth);
BurgerMenuPo.toggle();

HomePagePo.navTo();
burgerMenu.headerBrandLogoImage().should('be.visible').then((el) => {
expect(el).to.have.attr('src').includes(suseRancherLogo);
});
burgerMenu.headerBrandLogoImage()
.should('be.visible')
.invoke('outerWidth').then((str) => parseInt(str))
.should('eq', suseRancherLogoWidth);
BurgerMenuPo.toggle();

// Reset
Expand All @@ -269,14 +272,12 @@ describe('Settings', { testIsolation: 'off' }, () => {

// Check logos in top-level navigation header for updated logo
HomePagePo.navTo();
burgerMenu.headerBrandLogoImage().should('be.visible').then((el) => {
expect(el).to.have.attr('src').includes(rancherLogo);
});
burgerMenu.headerBrandLogoImage().should('be.visible').invoke('outerWidth').then((str) => parseInt(str))
.should('eq', rancherLogoWidth);

BurgerMenuPo.toggle();
burgerMenu.brandLogoImage().should('be.visible').then((el) => {
expect(el).to.have.attr('src').includes(rancherLogo);
});
burgerMenu.brandLogoImage().should('be.visible').invoke('outerWidth').then((str) => parseInt(str))
.should('eq', rancherLogoWidth);
});

it('can update cluster-template-enforcement', { tags: ['@globalSettings', '@adminUser'] }, () => {
Expand Down Expand Up @@ -434,7 +435,7 @@ describe('Settings', { testIsolation: 'off' }, () => {
settingsPage.settingsValue('k3s-based-upgrader-uninstall-concurrency').contains(settings['k3s-based-upgrader-uninstall-concurrency'].original);
});

it.skip('[Vue3 Skip]: can update system-default-registry', { tags: ['@globalSettings', '@adminUser'] }, () => {
it('can update system-default-registry', { tags: ['@globalSettings', '@adminUser'] }, () => {
// Update setting
SettingsPagePo.navTo();
settingsPage.editSettingsByLabel('system-default-registry');
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/tests/pages/manager/repositories.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('Cluster Management Helm Repositories', { testIsolation: 'off', tags: [
cy.contains(`${ this.repoName }ssh`).should('not.exist');
});

it.skip('[Vue3 Skip]: can create an oci repository with basic auth', function() {
it('can create an oci repository with basic auth', function() {
ChartRepositoriesPagePo.navTo();
repositoriesPage.waitForPage();
repositoriesPage.waitForGoTo('/v1/catalog.cattle.io.clusterrepos?exclude=metadata.managedFields');
Expand Down
1 change: 1 addition & 0 deletions shell/pages/diagnostic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export default {
'linode',
'targetRoute', // contains circular references, isn't useful (added later to store)
'$router', // also contains a circular reference to $store, not useful for diagnostics
'$route', // also contains a circular reference to $store, not useful for diagnostics
];
const clearListsKeys = [
Expand Down

0 comments on commit 456fc9a

Please sign in to comment.