Skip to content

Commit

Permalink
Disable e2e tests that rely on the server-version setting (#11440)
Browse files Browse the repository at this point in the history
* disable e2e tests that use server-version setting: download image lists and release notes link text check

* add link to backend issue blocking tests

* fix about.spec test comment

* fix lint
  • Loading branch information
mantis-toboggan-md committed Jul 15, 2024
1 parent 102f1e6 commit 206ad94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
50 changes: 26 additions & 24 deletions cypress/e2e/tests/pages/generic/about.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import HomePagePo from '@/cypress/e2e/po/pages/home.po';
import AboutPagePo from '@/cypress/e2e/po/pages/about.po';
import DiagnosticsPagePo from '@/cypress/e2e/po/pages/diagnostics.po';
import * as path from 'path';
// import * as path from 'path';

const aboutPage = new AboutPagePo();
const downloadsFolder = Cypress.config('downloadsFolder');
// const downloadsFolder = Cypress.config('downloadsFolder');

describe('About Page', { testIsolation: 'off', tags: ['@generic', '@adminUser', '@standardUser'] }, () => {
before(() => {
Expand Down Expand Up @@ -80,36 +80,38 @@ describe('About Page', { testIsolation: 'off', tags: ['@generic', '@adminUser',
});
});

describe('Image List', () => {
before(() => {
aboutPage.goTo();
});
// describe('Image List', () => {
// before(() => {
// aboutPage.goTo();
// });

it('can download Linux Image List', () => {
// Download txt and verify file exists
const downloadedFilename = path.join(downloadsFolder, 'rancher-linux-images.txt');
// reinstate when server-version issue is corrected https://github.com/rancher/rancher/issues/46152
// it('can download Linux Image List', () => {
// // Download txt and verify file exists
// const downloadedFilename = path.join(downloadsFolder, 'rancher-linux-images.txt');

aboutPage.getLinuxDownloadLink().click();
// aboutPage.getLinuxDownloadLink().click();

cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
const rancherVersion = resp.body['value'];
// cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
// const rancherVersion = resp.body['value'];

cy.readFile(downloadedFilename).should('contain', rancherVersion);
});
});
// cy.readFile(downloadedFilename).should('contain', rancherVersion);
// });
// });

it('can download Windows Image List', () => {
const downloadedFilename = path.join(downloadsFolder, 'rancher-windows-images.txt');
// it('can download Windows Image List', () => {
// const downloadedFilename = path.join(downloadsFolder, 'rancher-windows-images.txt');

aboutPage.getWindowsDownloadLink().click();
cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
const rancherVersion = resp.body['value'];
// aboutPage.getWindowsDownloadLink().click();
// cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
// const rancherVersion = resp.body['value'];

cy.readFile(downloadedFilename).should('contain', rancherVersion);
});
});
});
// cy.readFile(downloadedFilename).should('contain', rancherVersion);
// });
// });
// });

// reinstate when server-version issue is corrected https://github.com/rancher/rancher/issues/46152
// Removed given https://github.com/rancher/rancher/issues/46068
// Re-instate given https://github.com/rancher/dashboard/issues/11387
// describe('CLI Downloads', () => {
Expand Down
5 changes: 3 additions & 2 deletions cypress/e2e/tests/pages/generic/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ describe('Home Page', () => {
homePage.restoreAndWait();

cy.getRancherResource('v1', 'management.cattle.io.settings', 'server-version').then((resp: Cypress.Response<any>) => {
const rancherVersion = resp.body['value'].split('-', 1)[0].slice(1);
// const rancherVersion = resp.body['value'].split('-', 1)[0].slice(1);

homePage.changelog().self().contains('Learn more about the improvements and new capabilities in this version.');
homePage.whatsNewBannerLink().contains(`What's new in ${ rancherVersion }`);
// reinstate when server-version issue is corrected https://github.com/rancher/rancher/issues/46152
// homePage.whatsNewBannerLink().contains(`What's new in ${ rancherVersion }`);

homePage.whatsNewBannerLink().invoke('attr', 'href').then((releaseNotesUrl) => {
cy.request(releaseNotesUrl).then((res) => {
Expand Down

0 comments on commit 206ad94

Please sign in to comment.