Skip to content

Commit

Permalink
VM template download URL examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lkladnit committed Nov 25, 2021
1 parent de66045 commit bc21c52
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { TEMPLATE } from '../../utils/const';
import { ProvisionSource } from '../../utils/const/provisionSource';
import * as wizardView from '../../views/selector-wizard';
import { wizard } from '../../views/wizard';

describe('Import URL examples', () => {
before(() => {
cy.Login();
cy.visitVMsList();
});

after(() => {
cy.visit('/');
});

it('ID(CNV-7509) Examples of Import URLs for VM templates', () => {
for (const [key, value] of Object.entries(TEMPLATE)) {
if (key !== 'DEFAULT') {
wizard.vm.open();
cy.get('.pf-c-card')
.contains(value.os)
.should('exist')
.click();
cy.get(wizardView.next)
.should('not.be.disabled')
.click();
cy.get('body').then(($body) => {
if ($body.find('.ReactModal__Overlay').length > 0) {
cy.get('#confirm-action').click();
}
});
cy.get(wizardView.imageSourceDropdown).click();
cy.get(wizardView.selectMenu)
.contains(ProvisionSource.URL.getDescription())
.click({ force: true });
cy.get('.pf-c-form__helper-text')
.contains('Example: ')
.within(() => {
cy.get('a').should('have.attr', 'href', value.exampleImgUrl);
});
cy.get(wizardView.imageSourceDropdown).click();
cy.get(wizardView.selectMenu)
.contains(ProvisionSource.REGISTRY.getDescription())
.click({ force: true });
if (value.exampleRegUrl) {
cy.get('.pf-c-form__helper-text')
.contains('Example: ')
.contains(value.exampleRegUrl)
.should('exist');
cy.get('button')
.contains('Cancel')
.click();
}
}
}
});
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as urls from '../../../src/utils/strings';

export const OS_IMAGES_NS = Cypress.env('DOWNSTREAM')
? 'openshift-virtualization-os-images'
: 'kubevirt-os-images';
Expand Down Expand Up @@ -127,61 +129,106 @@ export const TEMPLATE = {
metadataName: 'rhel6-server-small',
os: 'Red Hat Enterprise Linux 6.0 or higher',
supportLevel: 'Full',
exampleImgUrl: urls.RHEL_IMAGE_LINK,
exampleRegUrl: urls.FEDORA_EXAMPLE_CONTAINER,
},
RHEL7: {
name: 'Red Hat Enterprise Linux 7.0+ VM',
dvName: 'rhel7',
metadataName: 'rhel7-server-small',
os: 'Red Hat Enterprise Linux 7.0 or higher',
supportLevel: 'Full',
exampleImgUrl: urls.RHEL_IMAGE_LINK,
exampleRegUrl: urls.RHEL7_EXAMPLE_CONTAINER,
},
RHEL8: {
name: 'Red Hat Enterprise Linux 8.0+ VM',
dvName: 'rhel8',
metadataName: 'rhel8-server-small',
os: 'Red Hat Enterprise Linux 8.0 or higher',
supportLevel: 'Full',
exampleImgUrl: urls.RHEL_IMAGE_LINK,
exampleRegUrl: urls.RHEL8_EXAMPLE_CONTAINER,
},
RHEL9: {
name: 'Red Hat Enterprise Linux 9.0 Alpha VM',
dvName: 'rhel9',
metadataName: 'rhel9-server-small',
os: 'Red Hat Enterprise Linux 9.0 or higher',
supportLevel: 'Limited',
exampleImgUrl: urls.RHEL_IMAGE_LINK,
exampleRegUrl: urls.FEDORA_EXAMPLE_CONTAINER,
},
FEDORA: {
name: 'Fedora 32+ VM',
dvName: 'fedora',
metadataName: 'fedora-server-small',
os: 'Fedora 32 or higher',
supportLevel: 'Community',
exampleImgUrl: urls.FEDORA_IMAGE_LINK,
exampleRegUrl: urls.FEDORA_EXAMPLE_CONTAINER,
},
CENTOS7: {
name: 'CentOS 7.0+ VM',
dvName: 'centos7',
metadataName: 'centos7-server-small',
os: 'CentOS 7 or higher',
supportLevel: 'Community',
exampleImgUrl: urls.CENTOS_IMAGE_LINK,
exampleRegUrl: urls.CENTOS7_EXAMPLE_CONTAINER,
},
CENTOS8: {
name: 'CentOS 8.0+ VM',
dvName: 'centos8',
metadataName: 'centos8-server-small',
os: 'CentOS 8 or higher',
supportLevel: 'Community',
exampleImgUrl: urls.CENTOS_IMAGE_LINK,
exampleRegUrl: urls.CENTOS8_EXAMPLE_CONTAINER,
},
WIN10: {
name: 'Microsoft Windows 10 VM',
dvName: 'win10',
metadataName: 'windows10-desktop-medium',
os: 'Microsoft Windows 10',
supportLevel: 'Full',
exampleImgUrl: urls.WINDOWS_IMAGE_LINK,
exampleRegUrl: '',
},
WIN2K12R2: {
name: 'Microsoft Windows Server 2012 R2 VM',
dvName: 'win2k12r2',
metadataName: 'windows2k12r2-server-medium',
os: 'Microsoft Windows Server 2012 R2',
supportLevel: 'Full',
exampleImgUrl: urls.WINDOWS_IMAGE_LINK,
exampleRegUrl: '',
},
WIN2K16: {
name: 'Microsoft Windows Server 2016 VM',
dvName: 'win2k16',
metadataName: 'windows2k16-server-medium',
os: 'Microsoft Windows Server 2016',
supportLevel: 'Full',
exampleImgUrl: urls.WINDOWS_IMAGE_LINK,
exampleRegUrl: '',
},
WIN2K19: {
name: 'Microsoft Windows Server 2019 VM',
dvName: 'win2k19',
metadataName: 'windows2k19-server-medium',
os: 'Microsoft Windows Server 2019',
supportLevel: 'Full',
exampleImgUrl: urls.WINDOWS_IMAGE_LINK,
exampleRegUrl: '',
},
DEFAULT: {
name: 'vm-template-example',
dvName: 'vm-template-example',
metadataName: 'vm-template-example',
os: 'Red Hat Enterprise Linux 8.0 or higher',
supportLevel: 'Full',
exampleImgUrl: urls.RHEL_IMAGE_LINK,
exampleRegUrl: urls.FEDORA_EXAMPLE_CONTAINER,
},
};

0 comments on commit bc21c52

Please sign in to comment.