diff --git a/cypress/tests/e2e/check-tab-yaml.cy.ts b/cypress/tests/e2e/check-tab-yaml.cy.ts index 99bde3638..4f44fb150 100644 --- a/cypress/tests/e2e/check-tab-yaml.cy.ts +++ b/cypress/tests/e2e/check-tab-yaml.cy.ts @@ -66,27 +66,56 @@ describe('Check all virtualization pages can be loaded', () => { tab.navigateToDiagnostics(); cy.contains('Status conditions').should('be.visible'); + tab.navigateToDiagnosticsGuestSystemLog(); + cy.contains('Guest system logs').should('be.visible'); + // sub-tabs in configuration tab tab.navigateToConfiguration(); cy.contains('Headless mode').should('be.visible'); - tab.navigateToStorage(); + tab.navigateToConfigurationStorage(); cy.contains('rootdisk').should('be.visible'); - tab.navigateToNetwork(); + tab.navigateToConfigurationNetwork(); cy.contains('Pod networking').should('be.visible'); - tab.navigateToScheduling(); + tab.navigateToConfigurationScheduling(); cy.contains('Scheduling and resource requirements').should('be.visible'); - tab.navigateToSSH(); + tab.navigateToConfigurationSSH(); cy.contains('SSH access').should('be.visible'); - tab.navigateToInitialRun(); + tab.navigateToConfigurationInitialRun(); cy.contains('Cloud-init').should('be.visible'); - tab.navigateToMetadata(); + tab.navigateToConfigurationMetadata(); + cy.contains('Annotations').should('be.visible'); + }); + + it('vmi tabs are loaded', () => { + tab.navigateToOverview(); + cy.contains('VirtualMachineInstance').should('be.visible'); + cy.byLegacyTestID(Example).click(); + cy.contains('Annotations').should('be.visible'); + + tab.navigateToYAML(); + cy.contains('Download').should('be.visible'); + + tab.navigateToScheduling(); + cy.contains('Tolerations').should('be.visible'); + + tab.navigateToEvents(); + cy.contains('event').should('be.visible'); + + tab.navigateToConsole(); + cy.contains('Guest login credentials').should('be.visible'); + + tab.navigateToNetworks(); + cy.contains('Pod networking').should('be.visible'); + + tab.navigateToDisks(); + cy.contains('rootdisk').should('be.visible'); }); }); @@ -106,19 +135,19 @@ describe('Check all virtualization pages can be loaded', () => { tab.navigateToYAML(); cy.contains('Download').should('be.visible'); - tab.navigateToTScheduling(); + tab.navigateToScheduling(); cy.contains('Tolerations').should('be.visible'); - tab.navigateToTNetworks(); + tab.navigateToNetworks(); cy.contains('Pod networking').should('be.visible'); - tab.navigateToTDisks(); + tab.navigateToDisks(); cy.contains('rootdisk').should('be.visible'); - tab.navigateToTScripts(); + tab.navigateToScripts(); cy.contains('Cloud-init').should('be.visible'); - tab.navigateToTParameters(); + tab.navigateToParameters(); cy.contains('DATA_SOURCE_NAME').should('be.visible'); }); @@ -134,19 +163,19 @@ describe('Check all virtualization pages can be loaded', () => { tab.navigateToYAML(); cy.contains('Download').should('be.visible'); - tab.navigateToTScheduling(); + tab.navigateToScheduling(); cy.contains('Tolerations').should('be.visible'); - tab.navigateToTNetworks(); + tab.navigateToNetworks(); cy.contains('Pod networking').should('be.visible'); - tab.navigateToTDisks(); + tab.navigateToDisks(); cy.contains('rootdisk').should('be.visible'); - tab.navigateToTScripts(); + tab.navigateToScripts(); cy.contains('Cloud-init').should('be.visible'); - tab.navigateToTParameters(); + tab.navigateToParameters(); cy.contains('CLOUD_USER_PASSWORD').should('be.visible'); }); }); diff --git a/cypress/views/tab.ts b/cypress/views/tab.ts index bc25f5761..c9867b544 100644 --- a/cypress/views/tab.ts +++ b/cypress/views/tab.ts @@ -1,118 +1,140 @@ -export enum vmTabs { - Configuration = 'horizontal-link-Configuration', - Console = 'horizontal-link-Console', - Diagnostics = 'horizontal-link-Diagnostics', - Disks = 'horizontal-link-Disks', - Environment = 'horizontal-link-Environment', - Events = 'horizontal-link-Events', - Metadata = 'horizontal-link-Metadata', - Metrics = 'horizontal-link-Metrics', - NetworkInterfaces = 'horizontal-link-Network interfaces', - Overview = 'horizontal-link-Overview', - Parameters = 'horizontal-link-Parameters', - Scheduling = 'horizontal-link-Scheduling', - Scripts = 'horizontal-link-Scripts', - Snapshots = 'horizontal-link-Snapshots', - YAML = 'horizontal-link-YAML', +export const configurationSubTab = (tabName: string) => + `[data-test-id="vm-configuration-${tabName}"]`; +export const diagnosticsSubTab = (tabName: string) => `[data-test-id="vm-diagnostics-${tabName}"]`; +export const horizontalLink = (tabName: string) => `[data-test-id="horizontal-link-${tabName}"]`; + +export enum tabName { + Configuration = 'Configuration', + Console = 'Console', + Diagnostics = 'Diagnostics', + Disks = 'Disks', + Environment = 'Environment', + Events = 'Events', + Metadata = 'Metadata', + Metrics = 'Metrics', + Migrations = 'Migrations', + NetworkInterfaces = 'Network interfaces', + Overview = 'Overview', + Parameters = 'Parameters', + Scheduling = 'Scheduling', + Scripts = 'Scripts', + Settings = 'Settings', + Snapshots = 'Snapshots', + TopConsumers = 'Top consumers', + YAML = 'YAML', } -export enum overviewTabs { - Migrations = 'horizontal-link-Migrations', - Settings = 'horizontal-link-Settings', - // virt overview tabs - TopConsumers = 'horizontal-link-Top consumers', +export enum subTabName { + Details = 'details', + GuestSystemLog = 'guest-system-log', + InitialRun = 'initial', + Metadata = 'metadata', + Network = 'network', + Scheduling = 'scheduling', + SSH = 'ssh', + StatusConditions = 'status-conditions', + Storage = 'storage', } -export const navigateToTab = (tab: string) => { - cy.byLegacyTestID(tab).should('be.visible'); - cy.byLegacyTestID(tab).click(); +export const navigateToTab = (name: string) => { + cy.get(horizontalLink(name)).should('be.visible'); + cy.get(horizontalLink(name)).click(); +}; + +export const navigateToConfigurationSubTab = (name: string) => { + navigateToTab(tabName.Configuration); + cy.get(configurationSubTab(name)).should('be.visible'); + cy.get(configurationSubTab(name)).click(); +}; + +export const navigateToDiagnosticsSubTab = (name: string) => { + navigateToTab(tabName.Diagnostics); + cy.get(diagnosticsSubTab(name)).should('be.visible'); + cy.get(diagnosticsSubTab(name)).click(); }; export const tab = { navigateToConfiguration: () => { - navigateToTab(vmTabs.Configuration); - }, - navigateToConsole: () => { - navigateToTab(vmTabs.Console); + navigateToTab(tabName.Configuration); }, // VM configuration sub-tabs - navigateToDetails: () => { - navigateToTab(vmTabs.Configuration); - cy.byButtonText('Details').click(); + navigateToConfigurationDetails: () => { + navigateToConfigurationSubTab(subTabName.Details); }, - navigateToDiagnostics: () => { - navigateToTab(vmTabs.Diagnostics); + navigateToConfigurationInitialRun: () => { + navigateToConfigurationSubTab(subTabName.InitialRun); }, - navigateToEvents: () => { - navigateToTab(vmTabs.Events); + navigateToConfigurationMetadata: () => { + navigateToConfigurationSubTab(subTabName.Metadata); }, - navigateToInitialRun: () => { - navigateToTab(vmTabs.Configuration); - cy.byButtonText('Initial run').click(); + navigateToConfigurationNetwork: () => { + navigateToConfigurationSubTab(subTabName.Network); }, - navigateToMetadata: () => { - navigateToTab(vmTabs.Configuration); - cy.byButtonText('Metadata').click(); + navigateToConfigurationScheduling: () => { + navigateToConfigurationSubTab(subTabName.Scheduling); }, - navigateToMetrics: () => { - navigateToTab(vmTabs.Metrics); + navigateToConfigurationSSH: () => { + navigateToConfigurationSubTab(subTabName.SSH); }, - navigateToMigrations: () => { - navigateToTab(overviewTabs.Migrations); + navigateToConfigurationStorage: () => { + navigateToConfigurationSubTab(subTabName.Storage); }, - navigateToNetwork: () => { - navigateToTab(vmTabs.Configuration); - cy.contains('.pf-v5-c-tabs__item-text', 'Network').click(); + navigateToConsole: () => { + navigateToTab(tabName.Console); }, - // VM tabs - navigateToOverview: () => { - navigateToTab(vmTabs.Overview); + navigateToDiagnostics: () => { + navigateToTab(tabName.Diagnostics); }, - navigateToScheduling: () => { - navigateToTab(vmTabs.Configuration); - cy.byButtonText('Scheduling').click(); + // VM diagnostics sub-tabs + navigateToDiagnosticsGuestSystemLog: () => { + navigateToDiagnosticsSubTab(subTabName.GuestSystemLog); }, - navigateToSettings: () => { - navigateToTab(overviewTabs.Settings); + navigateToDiagnosticsStatusConditions: () => { + navigateToDiagnosticsSubTab(subTabName.StatusConditions); }, - navigateToSnapshots: () => { - navigateToTab(vmTabs.Snapshots); + navigateToDisks: () => { + navigateToTab(tabName.Disks); }, - navigateToSSH: () => { - navigateToTab(vmTabs.Configuration); - cy.byButtonText('SSH').click(); + navigateToEnvironment: () => { + navigateToTab(tabName.Environment); }, - navigateToStorage: () => { - navigateToTab(vmTabs.Configuration); - cy.contains('.pf-v5-c-tabs__item-text', 'Storage').click(); + navigateToEvents: () => { + navigateToTab(tabName.Events); }, - // template's tabs and vm creation tabs - navigateToTDisks: () => { - navigateToTab(vmTabs.Disks); + navigateToMetadata: () => { + navigateToTab(tabName.Metadata); }, - navigateToTEnvironment: () => { - navigateToTab(vmTabs.Environment); + navigateToMetrics: () => { + navigateToTab(tabName.Metrics); }, - navigateToTMetadata: () => { - navigateToTab(vmTabs.Metadata); + navigateToMigrations: () => { + navigateToTab(tabName.Migrations); }, - navigateToTNetworks: () => { - navigateToTab(vmTabs.NetworkInterfaces); + navigateToNetworks: () => { + navigateToTab(tabName.NetworkInterfaces); }, - // virt overview tabs - navigateToTopConsumers: () => { - navigateToTab(overviewTabs.TopConsumers); + navigateToOverview: () => { + navigateToTab(tabName.Overview); }, - navigateToTParameters: () => { - navigateToTab(vmTabs.Parameters); + navigateToParameters: () => { + navigateToTab(tabName.Parameters); }, - navigateToTScheduling: () => { - navigateToTab(vmTabs.Scheduling); + navigateToScheduling: () => { + navigateToTab(tabName.Scheduling); + }, + navigateToScripts: () => { + navigateToTab(tabName.Scripts); + }, + navigateToSettings: () => { + navigateToTab(tabName.Settings); }, - navigateToTScripts: () => { - navigateToTab(vmTabs.Scripts); + navigateToSnapshots: () => { + navigateToTab(tabName.Snapshots); + }, + navigateToTopConsumers: () => { + navigateToTab(tabName.TopConsumers); }, navigateToYAML: () => { - navigateToTab(vmTabs.YAML); + navigateToTab(tabName.YAML); }, }; diff --git a/src/views/catalog/CustomizeInstanceType/tabs/configuration/CustomizeInstanceTypeConfigurationTab.tsx b/src/views/catalog/CustomizeInstanceType/tabs/configuration/CustomizeInstanceTypeConfigurationTab.tsx index 4947d3c82..78ffaa91b 100644 --- a/src/views/catalog/CustomizeInstanceType/tabs/configuration/CustomizeInstanceTypeConfigurationTab.tsx +++ b/src/views/catalog/CustomizeInstanceType/tabs/configuration/CustomizeInstanceTypeConfigurationTab.tsx @@ -53,6 +53,7 @@ const CustomizeInstanceTypeConfigurationTab: FC = () => { {tabs.map(({ Component, name, title }) => ( redirectTab(name)}