From b6ad783e43be04c8a3a3f5bb394d8e1a049c63d3 Mon Sep 17 00:00:00 2001 From: davidtclin Date: Mon, 30 Sep 2024 16:26:29 +0800 Subject: [PATCH] Update for more UI string changes --- cypress/constants/constants.ts | 2 +- cypress/pageobjects/support.po.ts | 18 +++++++------- cypress/pageobjects/virtualmachine.po.ts | 10 ++++---- .../storageclasses/storageclasses.spec.ts | 4 ++-- cypress/testcases/volume/volumes.spec.ts | 24 +++++++++---------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cypress/constants/constants.ts b/cypress/constants/constants.ts index b052b0830..bdf93c333 100644 --- a/cypress/constants/constants.ts +++ b/cypress/constants/constants.ts @@ -47,7 +47,7 @@ export const MenuNav = { Images: ['Images', 'harvester/c/local/harvesterhci.io.virtualmachineimage', 'Images'], namespace: ['Namespaces', 'harvester/c/local/namespace', 'Namespaces'], clusterNetwork: ['Cluster Network Configuration', 'harvester/c/local/network.harvesterhci.io.clusternetwork', 'Cluster Network Configuration', ['Networks']], - vmNetwork: ['VM Networks', 'harvester/c/local/harvesterhci.io.networkattachmentdefinition', 'VM Networks', ['Networks']], + vmNetwork: ['Virtual Machines Networks', 'harvester/c/local/harvesterhci.io.networkattachmentdefinition', 'Virtual Machines Networks', ['Networks']], vmBackup: ['VM Backups', 'harvester/c/local/harvesterhci.io.virtualmachinebackup', 'VM Backups', ['Backup & Snapshot']], vmSnapshot: ['VM Snapshots', 'harvester/c/local/harvesterhci.io.vmsnapshot', 'VM Snapshots', ['Backup & Snapshot']], volumeSnapshot: ['Volume Snapshots', 'harvester/c/local/harvesterhci.io.volumesnapshot', 'Volume Snapshots', ['Backup & Snapshot']], diff --git a/cypress/pageobjects/support.po.ts b/cypress/pageobjects/support.po.ts index 95482f897..f111253e1 100644 --- a/cypress/pageobjects/support.po.ts +++ b/cypress/pageobjects/support.po.ts @@ -6,7 +6,7 @@ import Dashboard from "@/pageobjects/dashboard.po"; const constants = new Constants(); export class SupportPage { - private supportBundleButton = 'Generate Support Bundle'; + private supportBundleButton = 'Generate a Support Bundle'; private supportBundleInput = 'textarea' private generateButton = '[type="submit"]'; @@ -31,23 +31,23 @@ export class SupportPage { } public get generateSupportBundleBtn(): CypressChainable { - return cy.get("main button").contains("Generate Support Bundle") + return cy.get("main button").contains("Generate a Support Bundle") } public visit() { cy.url().then(url => { - if(!url.includes(constants.dashboardUrl)) { + if (!url.includes(constants.dashboardUrl)) { cy.login(); } Dashboard.nav.SupportLink.click() - cy.get("main h1").should("contain","Harvester Support") + cy.get("main h1").should("contain", "Harvester Support") cy.url().should("contain", constants.supportPage) }) } - public inputSupportBundle(description?:string, issueURL?:string): CypressChainable { + public inputSupportBundle(description?: string, issueURL?: string): CypressChainable { return cy.get("main .bundleModal").as("generateView").then($el => { - if(description) cy.wrap($el).get("textarea").type(description) + if (description) cy.wrap($el).get("textarea").type(description) if (issueURL) cy.wrap($el).get("input").type(issueURL) cy.wrap($el).get(".footer button").contains("Close").as("closeBtn") @@ -61,13 +61,13 @@ export class SupportPage { }); // this.validateSupportPage(); } - + public generateSupportBundle(description: string) { // cy.task('deleteDownloadsFolder'); this.visitSupportPage(); cy.get('.btn').contains(this.supportBundleButton).click(); cy.get(this.supportBundleInput).each(($elem, index) => { - if(index == 1) { + if (index == 1) { cy.wrap($elem).type(description) } }); @@ -85,7 +85,7 @@ export class SupportPage { this.visitSupportPage(); } - + private validateSupportPage() { cy.url().should('contain', constants.supportPage); } diff --git a/cypress/pageobjects/virtualmachine.po.ts b/cypress/pageobjects/virtualmachine.po.ts index 26e6e7883..507e27598 100755 --- a/cypress/pageobjects/virtualmachine.po.ts +++ b/cypress/pageobjects/virtualmachine.po.ts @@ -100,9 +100,9 @@ export class VmsPage extends CruResourcePo { selectSchedulingType({ type = 'any' }: { type: string }) { const map: any = { - any: 'Run VM on any available node', - specific: 'Run VM on specific node - (Live migration is not supported)', - rules: 'Run VM on node(s) matching scheduling rules' + any: 'Run virtual machine on any available node', + specific: 'Run virtual machine on specific node - (Live migration is not supported))', + rules: 'Run virtual machine on node(s) matching scheduling rules' } this.clickTab('nodeScheduling'); @@ -152,8 +152,8 @@ export class VmsPage extends CruResourcePo { } clickVMSnapshotAction(name: string, snapshotName: string) { - this.clickAction(name, 'Take VM Snapshot'); - cy.get('.v--modal-box .card-title').find('h4').contains('Take VM Snapshot'); + this.clickAction(name, 'Take Virtual Machine Snapshot'); + cy.get('.v--modal-box .card-title').find('h4').contains('Take Virtual Machine Snapshot'); new LabeledInputPo('.v--modal-box .labeled-input', `:contains("Name *")`).input(snapshotName) cy.get('.v--modal-box button').contains('Create').click(); diff --git a/cypress/testcases/storageclasses/storageclasses.spec.ts b/cypress/testcases/storageclasses/storageclasses.spec.ts index 67c74623d..05209cb43 100644 --- a/cypress/testcases/storageclasses/storageclasses.spec.ts +++ b/cypress/testcases/storageclasses/storageclasses.spec.ts @@ -42,7 +42,7 @@ describe('Create a storage class with all the required values', () => { migratable: 'No', reclaimPolicy: 'Retain the volume for manual cleanup', allowVolumeExpansion: 'Disabled', - volumeBindingMode: 'Bind and provision a persistent volume once a VM using the PersistentVolumeClaim is created', + volumeBindingMode: 'Bind and provision a persistent volume once a virtual machine using the PersistentVolumeClaim is created', } storageClasses.create(value); @@ -54,7 +54,7 @@ describe('Create a storage class with all the required values', () => { migratable: 'false', reclaimPolicy: 'Retain', allowVolumeExpansion: false, - volumeBindingMode: 'WaitForFirstConsumer', + volumeBindingMode: 'WaitForFirstConsumer', }); storageClasses.delete({ name: NAME }) diff --git a/cypress/testcases/volume/volumes.spec.ts b/cypress/testcases/volume/volumes.spec.ts index f710ee492..5b9d21869 100755 --- a/cypress/testcases/volume/volumes.spec.ts +++ b/cypress/testcases/volume/volumes.spec.ts @@ -44,7 +44,7 @@ describe("Create image from Volume", () => { vms.save(); // check VM state - vms.checkState({name: VM_NAME}); + vms.checkState({ name: VM_NAME }); // // export IMAGE image.exportImage(VM_NAME, IMAGE_NAME, namespace); @@ -63,7 +63,7 @@ describe("Create image from Volume", () => { vms.save(); // check VM state - vms.checkState({name: ANOTHER_VM_NAME}); + vms.checkState({ name: ANOTHER_VM_NAME }); // delete VM vms.delete(namespace, ANOTHER_VM_NAME); @@ -104,7 +104,7 @@ describe("Create volume root disk VM Image Form", () => { // create VOLUME volumes.goToCreate(); volumes.setNameNsDescription(VOLUME_NAME, namespace); - volumes.setBasics({source: 'VM Image', image: imageEnv.name, size: '10'}); + volumes.setBasics({ source: 'Virtual Machine Image', image: imageEnv.name, size: '10' }); volumes.save(); // check state @@ -156,7 +156,7 @@ describe("Delete volume that was attached to VM but now is not", () => { const volumeName = vm.spec?.template?.spec?.volumes?.[0]?.persistentVolumeClaim?.claimName || ''; // check VM state - vms.checkState({name: VM_NAME}); + vms.checkState({ name: VM_NAME }); // delete VM vms.delete(namespace, VM_NAME, VM_NAME, { removeRootDisk: false }); @@ -202,13 +202,13 @@ describe("Support Volume Hot Unplug", () => { // create VOLUME volumes.goToCreate(); volumes.setNameNsDescription(VOLUME_NAME_1, namespace); - volumes.setBasics({size: '4'}); + volumes.setBasics({ size: '4' }); volumes.save(); volumes.censorInColumn(VOLUME_NAME_1, 3, namespace, 4, 'Ready'); volumes.goToCreate(); volumes.setNameNsDescription(VOLUME_NAME_2, namespace); - volumes.setBasics({size: '4'}); + volumes.setBasics({ size: '4' }); volumes.save(); volumes.censorInColumn(VOLUME_NAME_2, 3, namespace, 4, 'Ready'); @@ -221,10 +221,10 @@ describe("Support Volume Hot Unplug", () => { vms.save(); // check VM state - vms.checkState({name: VM_NAME}); + vms.checkState({ name: VM_NAME }); vms.plugVolume(VM_NAME, [VOLUME_NAME_1, VOLUME_NAME_2], namespace); - vms.unplugVolume(VM_NAME, [1,2], namespace); + vms.unplugVolume(VM_NAME, [1, 2], namespace); vms.plugVolume(VM_NAME, [VOLUME_NAME_1, VOLUME_NAME_2], namespace); // delete VM @@ -245,7 +245,7 @@ describe("Support Volume Hot Unplug", () => { * Expected Results * 1. Disk should be resized */ - describe("Edit volume increase size via form", () => { +describe("Edit volume increase size via form", () => { const VM_NAME = generateName("vm-e2e-1"); it("Edit volume increase size via form", () => { @@ -277,12 +277,12 @@ describe("Support Volume Hot Unplug", () => { // check VM state vms.clickAction(VM_NAME, 'Stop'); vms.searchClear(); - vms.checkState({name: VM_NAME, state: 'Off'}); + vms.checkState({ name: VM_NAME, state: 'Off' }); volumes.goToEdit(volumeName); - volumes.setBasics({size: '5'}); + volumes.setBasics({ size: '5' }); volumes.update(`${namespace}/${volumeName}`); - + // check VOLUME state volumes.censorInColumn(volumeName, 3, namespace, 4, 'In-use', 2);