Skip to content

Commit

Permalink
Fix the failed cypress test for v1.4.0 string changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TachunLin authored and khushboo-rancher committed Nov 13, 2024
1 parent 5038deb commit b9d3752
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 223 deletions.
58 changes: 29 additions & 29 deletions cypress/constants/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export class Constants {
public timeout = { timeout: 10000, maxTimeout: 60000, uploadTimeout: 600000, downloadTimeout: 240000, provisionTimeout: 1500000};
public timeout = { timeout: 10000, maxTimeout: 60000, uploadTimeout: 600000, downloadTimeout: 240000, provisionTimeout: 1500000 };
public username = Cypress.env("username");
public password = Cypress.env("password");
public mockPassword = Cypress.env("mockPassword");
Expand Down Expand Up @@ -32,36 +32,36 @@ export class Constants {
}

export const PageUrl = {
setting: '/harvester/c/local/harvesterhci.io.setting',
virtualMachine: '/harvester/c/local/kubevirt.io.virtualmachine',
vmNetwork: '/harvester/c/local/harvesterhci.io.networkattachmentdefinition',
namespace: '/harvester/c/local/namespace',
volumeSnapshot: '/harvester/c/local/harvesterhci.io.volumesnapshot'
setting: '/harvester/c/local/harvesterhci.io.setting',
virtualMachine: '/harvester/c/local/kubevirt.io.virtualmachine',
vmNetwork: '/harvester/c/local/harvesterhci.io.networkattachmentdefinition',
namespace: '/harvester/c/local/namespace',
volumeSnapshot: '/harvester/c/local/harvesterhci.io.volumesnapshot'
}

export const MenuNav = {
dashboard: ['Dashboard', 'harvester/c/local/harvesterhci.io.dashboard', 'Harvester Cluster: local'],
Host: ['Hosts', 'harvester/c/local/harvesterhci.io.host', 'Hosts'],
dashboard: ['Dashboard', 'harvester/c/local/harvesterhci.io.dashboard', 'Harvester Cluster: local'],
Host: ['Hosts', 'harvester/c/local/harvesterhci.io.host', 'Hosts'],
virtaulmachine: ['Virtual Machines', 'harvester/c/local/kubevirt.io.virtualmachine', 'Virtual Machines'],
volume: ['Volumes', 'harvester/c/local/harvesterhci.io.volume', 'Volumes'],
Images: ['Images', 'harvester/c/local/harvesterhci.io.virtualmachineimage', 'Images'],
namespace: ['Namespaces', 'harvester/c/local/namespace', 'Namespaces'],
clusterNetwork: ['Cluster Networks/Configs', 'harvester/c/local/network.harvesterhci.io.clusternetwork', 'Cluster Networks/Configs', ['Networks']],
vmNetwork: ['VM Networks', 'harvester/c/local/harvesterhci.io.networkattachmentdefinition', 'VM 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']],
alertmanagerConfig: ['Alertmanager Configs', 'harvester/c/local/harvesterhci.io.monitoring.alertmanagerconfig', 'Alertmanager Configs', ['Monitoring & Logging', 'Monitoring']],
clusterFlow: ['Cluster Flow', 'harvester/c/local/harvesterhci.io.logging.clusterflow', 'Cluster Flows', ['Monitoring & Logging', 'Logging']],
clusterOutput: ['Cluster Output', 'harvester/c/local/harvesterhci.io.logging.clusteroutput', 'Cluster Outputs', ['Monitoring & Logging', 'Logging']],
flow: ['Flow', 'harvester/c/local/harvesterhci.io.logging.flow', 'Flows', ['Monitoring & Logging', 'Logging']],
Output: ['Output', 'harvester/c/local/harvesterhci.io.logging.output', 'Outputs', ['Monitoring & Logging', 'Logging']],
Template: ['Templates', 'harvester/c/local/harvesterhci.io.virtualmachinetemplateversion', 'Templates', ['Advanced']],
sshKey: ['SSH Keys', 'harvester/c/local/harvesterhci.io.keypair', 'SSH Keys', ['Advanced']],
cloudConfigTemplate: ['Cloud Config Templates', 'harvester/c/local/harvesterhci.io.cloudtemplate', 'Cloud Config Templates', ['Advanced']],
storageClass: ['Storage Classes', 'harvester/c/local/harvesterhci.io.storage', 'Storage Classes', ['Advanced']],
pciDevice: ['PCI Devices', 'harvester/c/local/devices.harvesterhci.io.pcidevice', 'PCI Devices', ['Advanced']],
addon: ['Addons', 'harvester/c/local/harvesterhci.io.addon', 'Addons', ['Advanced']],
secrets: ['Secrets', 'harvester/c/local/harvesterhci.io.secret', 'Secrets', ['Advanced']],
setting: ['Settings', 'harvester/c/local/harvesterhci.io.setting', 'Settings', ['Advanced']]
volume: ['Volumes', 'harvester/c/local/harvesterhci.io.volume', 'Volumes'],
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: ['Virtual Machine Networks', 'harvester/c/local/harvesterhci.io.networkattachmentdefinition', 'Virtual Machine Networks', ['Networks']],
vmBackup: ['Virtual Machine Backups', 'harvester/c/local/harvesterhci.io.virtualmachinebackup', 'Virtual Machine Backups', ['Backup and Snapshots']],
vmSnapshot: ['Virtual Machine Snapshots', 'harvester/c/local/harvesterhci.io.vmsnapshot', 'Virtual Machine Snapshots', ['Backup and Snapshots']],
volumeSnapshot: ['Volume Snapshots', 'harvester/c/local/harvesterhci.io.volumesnapshot', 'Volume Snapshots', ['Backup and Snapshots']],
alertmanagerConfig: ['Alertmanager Configurations', 'harvester/c/local/harvesterhci.io.monitoring.alertmanagerconfig', 'Alertmanager Configurations', ['Monitoring and Logging', 'Monitoring']],
clusterFlow: ['Cluster Flows', 'harvester/c/local/harvesterhci.io.logging.clusterflow', 'Cluster Flows', ['Monitoring and Logging', 'Logging']],
clusterOutput: ['Cluster Outputs', 'harvester/c/local/harvesterhci.io.logging.clusteroutput', 'Cluster Outputs', ['Monitoring and Logging', 'Logging']],
flow: ['Flows', 'harvester/c/local/harvesterhci.io.logging.flow', 'Flows', ['Monitoring and Logging', 'Logging']],
Output: ['Outputs', 'harvester/c/local/harvesterhci.io.logging.output', 'Outputs', ['Monitoring and Logging', 'Logging']],
Template: ['Templates', 'harvester/c/local/harvesterhci.io.virtualmachinetemplateversion', 'Templates', ['Advanced']],
sshKey: ['SSH Keys', 'harvester/c/local/harvesterhci.io.keypair', 'SSH Keys', ['Advanced']],
cloudConfigTemplate: ['Cloud Configuration Templates', 'harvester/c/local/harvesterhci.io.cloudtemplate', 'Cloud Configuration Templates', ['Advanced']],
storageClass: ['Storage Classes', 'harvester/c/local/harvesterhci.io.storage', 'Storage Classes', ['Advanced']],
pciDevice: ['PCI Devices', 'harvester/c/local/devices.harvesterhci.io.pcidevice', 'PCI Devices', ['Advanced']],
addon: ['Add-ons', 'harvester/c/local/harvesterhci.io.addon', 'Add-ons', ['Advanced']],
secrets: ['Secrets', 'harvester/c/local/harvesterhci.io.secret', 'Secrets', ['Advanced']],
setting: ['Settings', 'harvester/c/local/harvesterhci.io.setting', 'Settings', ['Advanced']]
}
2 changes: 1 addition & 1 deletion cypress/pageobjects/network.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class NetworkPage extends CruResourcePo {
}

vlan() {
return new LabeledInputPo('.labeled-input', `:contains("Vlan ID")`)
return new LabeledInputPo('.labeled-input', `:contains("VLAN ID")`)
}

clusterNetwork() {
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
Loading

0 comments on commit b9d3752

Please sign in to comment.