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

Enabling several E2E tests that were disabled for the vue3 migration #12354

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
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
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hashes were changing between both my localhost instance and the cypress tests. It didn't seem like we could rely on the hashes anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I could definitely see how the vue3 migration might be a scenario that could cause the hash to change. It's probably best that we don't rely on the hashes for the test.

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
Loading