Skip to content

Commit

Permalink
Update for more UI string changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TachunLin committed Oct 4, 2024
1 parent d4e2751 commit faa5615
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cypress/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 Machine Networks', 'harvester/c/local/harvesterhci.io.networkattachmentdefinition', 'Virtual Machine 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']],
Expand Down
18 changes: 9 additions & 9 deletions cypress/pageobjects/support.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]';

Expand All @@ -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")
Expand All @@ -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)
}
});
Expand All @@ -85,7 +85,7 @@ export class SupportPage {
this.visitSupportPage();

}

private validateSupportPage() {
cy.url().should('contain', constants.supportPage);
}
Expand Down
18 changes: 9 additions & 9 deletions cypress/pageobjects/virtualmachine.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -474,16 +474,16 @@ export class VmsPage extends CruResourcePo {
}) {
this.clickTab('nodeScheduling');

const rulesRadio = new RadioButtonPo('.radio-group', ':contains("Run VM on node(s) matching scheduling rules")')
const specificRadio = new RadioButtonPo('.radio-group', ':contains("Run VM on specific node")')
const rulesRadio = new RadioButtonPo('.radio-group', ':contains("Run virtual machine on node(s) matching scheduling rules")')
const specificRadio = new RadioButtonPo('.radio-group', ':contains("Run virtual machine on specific node - (Live migration is not supported)")')
const nodeNameSelector = new LabeledSelectPo('.labeled-select', `:contains("Node Name")`)

switch (radio) {
case 'rules':
rulesRadio.input('Run VM on node(s) matching scheduling rules')
rulesRadio.input('Run virtual machine on node(s) matching scheduling rules')
break;
case 'specific':
specificRadio.input('Run VM on specific node')
specificRadio.input('Run virtual machine on specific node - (Live migration is not supported)')

nodeNameSelector.select({
selector: '.vs__dropdown-menu',
Expand Down
4 changes: 2 additions & 2 deletions cypress/testcases/storageclasses/storageclasses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 })
Expand Down
24 changes: 12 additions & 12 deletions cypress/testcases/volume/volumes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 });
Expand Down Expand Up @@ -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');

Expand All @@ -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
Expand All @@ -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", () => {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit faa5615

Please sign in to comment.