-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ feat: add Digital Ocean form handling and validation tests for phys…
…ical cluster creation
- Loading branch information
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import ms from "ms"; | ||
|
||
import { PhysicalCluster } from "../../utils/create-cluster/physical"; | ||
|
||
const CLUSTER_NAME = Cypress.env("CLUSTER_NAME"); | ||
const cloudProvider = Cypress.env("CLOUD_PROVIDER"); | ||
const MAX_TIME_TO_WAIT = Cypress.env("MAX_TIME_TO_WAIT"); | ||
const isDigitalOcean = cloudProvider === "do"; | ||
|
||
describe("Test to validate physical cluster creation on Digital Ocean", () => { | ||
const physicalCluster = new PhysicalCluster(); | ||
|
||
beforeEach(function () { | ||
if (!isDigitalOcean) { | ||
cy.log("This test is only for Digital Ocean"); | ||
|
||
this.skip(); | ||
} | ||
}); | ||
|
||
beforeEach(() => { | ||
const username = Cypress.env("USERNAME"); | ||
const password = Cypress.env("PASSWORD"); | ||
|
||
physicalCluster.login(username, password); | ||
}); | ||
|
||
it.skip("should create a physical cluster", async () => { | ||
physicalCluster.visitClusterPage(); | ||
|
||
physicalCluster.clickOnWorkloadClusterButton(); | ||
|
||
const region = physicalCluster.getRegion("digitalocean"); | ||
|
||
region.then((region) => { | ||
physicalCluster.filloutDigitalOceanForm({ | ||
name: CLUSTER_NAME, | ||
region: new RegExp(region, "i"), | ||
intanceSize: new RegExp("s-1vcpu-1gb", "i"), | ||
}); | ||
|
||
physicalCluster.clickOnCreateCluster(); | ||
|
||
cy.wait(2000); | ||
|
||
cy.findByRole("heading", { | ||
name: new RegExp(CLUSTER_NAME, "i"), | ||
timeout: Number(ms(MAX_TIME_TO_WAIT)), | ||
}).should("exist"); | ||
|
||
cy.contains("Provisioning").should("exist"); | ||
}); | ||
}); | ||
|
||
it("should validate the cluster is provisioning", () => { | ||
physicalCluster.visitClusterPage(); | ||
|
||
const provisioningButton = | ||
physicalCluster.getClusterProvisioningStatusButton(CLUSTER_NAME); | ||
|
||
provisioningButton.should("exist"); | ||
|
||
provisioningButton.within(() => { | ||
cy.findByText(/provisioning/i, { | ||
timeout: Number(ms(MAX_TIME_TO_WAIT)), | ||
}).should("exist"); | ||
}); | ||
}); | ||
|
||
it("should validate the cluster is provisioned", { retries: 3 }, () => { | ||
physicalCluster.visitClusterPage(); | ||
|
||
const provisioningButton = | ||
physicalCluster.getClusterProvisioningStatusButton(CLUSTER_NAME); | ||
|
||
provisioningButton.should("exist"); | ||
|
||
provisioningButton.within(() => { | ||
cy.findByText(/available/i, { | ||
timeout: Number(ms(MAX_TIME_TO_WAIT)), | ||
}).should("exist"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters