-
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.
✅ test: test for validate the physical cluster on akamai creation was…
… added (#5) * ⬆️ chore: update Node.js version to v22.12.0 in .nvmrc * ♻️ feat: refactor physical cluster creation tests and introduce PhysicalCluster class * ✅ feat: update physical cluster creation tests to support Akamai and refactor form handling * ✅ test: test for create physical cluster on vultr was added * ✅ test: continue to add the test for vultr * ✅ feat: add Digital Ocean form handling and validation tests for physical cluster creation * ✅ test: enable physical cluster creation tests for Digital Ocean and VULTR * ♻️ refactor: update physical cluster creation tests to remove async and improve logging * 🔧 chore: update dependencies to latest versions in package.json and package-lock.json * 🔧 chore: update Dockerfile to use Bitnami Cypress image and optimize dependency installation * 🔧 chore: update Dockerfile to use cypress/included image * 🔧 chore: update Dockerfile to copy both package.json and package-lock.json * 🔧 chore: downgrade Cypress version to 13.17.0 and update imports for physical cluster utilities
- Loading branch information
Showing
14 changed files
with
661 additions
and
193 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 |
---|---|---|
@@ -1 +1 @@ | ||
v20.15.1 | ||
v20.18.1 |
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 |
---|---|---|
@@ -1,22 +1,16 @@ | ||
# Use the Cypress image as the base image | ||
FROM cypress/included:13.17.0 | ||
|
||
# Set the working directory | ||
WORKDIR /tests | ||
|
||
RUN apt-get update | ||
RUN apt install gh | ||
|
||
# Copy necessary files into the container | ||
COPY ./package.json . | ||
COPY ./package*.json . | ||
COPY ./cypress.config.ts . | ||
COPY ./cypress ./cypress | ||
COPY ./tsconfig.json . | ||
|
||
# Install dependencies | ||
RUN npm install | ||
RUN npm ci | ||
RUN find ./cypress -type f -name "*.sh" -exec chmod +x {} \; | ||
|
||
# Define the entrypoint for running Cypress tests | ||
ENTRYPOINT ["npx", "cypress", "run"] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import ms from "ms"; | ||
|
||
import { PhysicalCluster } from "../../utils/create-cluster"; | ||
|
||
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 isAkamai = cloudProvider === "akamai"; | ||
|
||
describe("Test to validate physical cluster creation on AKAMAI", () => { | ||
const physicalCluster = new PhysicalCluster(); | ||
|
||
beforeEach(function () { | ||
if (!isAkamai) { | ||
cy.log("This test is only for AKAMAI"); | ||
|
||
this.skip(); | ||
} | ||
}); | ||
|
||
beforeEach(() => { | ||
const username = Cypress.env("USERNAME"); | ||
const password = Cypress.env("PASSWORD"); | ||
|
||
physicalCluster.login(username, password); | ||
}); | ||
|
||
it("should create a physical cluster", () => { | ||
physicalCluster.visitClusterPage(); | ||
|
||
physicalCluster.clickOnWorkloadClusterButton(); | ||
|
||
const region = physicalCluster.getRegion(cloudProvider); | ||
|
||
region.then((region) => { | ||
physicalCluster.filloutAkamaiForm({ | ||
name: CLUSTER_NAME, | ||
region: new RegExp(region, "i"), | ||
intanceSize: new RegExp("g6-standard-6", "i"), | ||
}); | ||
|
||
physicalCluster.clickOnCreateCluster(); | ||
|
||
cy.wait(2_000); | ||
|
||
cy.findByRole("heading", { | ||
name: new RegExp(CLUSTER_NAME, "i"), | ||
timeout: Number(ms(MAX_TIME_TO_WAIT)), | ||
}).should("exist"); | ||
|
||
cy.contains(/provisioning/i).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
Oops, something went wrong.