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

Reinstate e2e tests that rely on server-version setting #11468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
49 changes: 24 additions & 25 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,35 @@ describe('About Page', { testIsolation: 'off', tags: ['@generic', '@adminUser',
});
});

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

// 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');
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);
});
});
});

describe('CLI Downloads', () => {
// workaround to make the following CLI tests work https://github.com/cypress-io/cypress/issues/8089#issuecomment-1585159023
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/tests/pages/generic/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ 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.');
// reinstate when server-version issue is corrected https://github.com/rancher/rancher/issues/46152
// homePage.whatsNewBannerLink().contains(`What's new in ${ rancherVersion }`);
homePage.whatsNewBannerLink().contains(`What's new in ${ rancherVersion }`);

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