mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* basic workspace overview Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * css tweaks for landing page as a PageLayout Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * address review comments Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * more review comment addressing, added overview to workspace command palette Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * added back the landing page startup hint Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * refactoring as per review comments Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * added original landing page back only for default workspace with no clusters Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * Workspace overview layout tweaks (#2302) * tweaks workspace overview layout Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * cluster settings on top Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * header logo for add cluster page Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * tweak landing page Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * combine left menu icons Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * always show bottom status bar Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * tweak Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * integration test fixes Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * change cluster menu Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * first attempt to fix integration test Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * lint Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * get selectors right for integration test Signed-off-by: Jim Ehrismann <jehrismann@miranits.com> Co-authored-by: Jim Ehrismann <jehrismann@mirantis.com> Co-authored-by: Jim Ehrismann <jehrismann@miranits.com> * address review comments, and rebased to master Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> Co-authored-by: Jim Ehrismann <jehrismann@miranits.com>
60 lines
2.0 KiB
TypeScript
60 lines
2.0 KiB
TypeScript
import { spawnSync } from "child_process";
|
|
import { Application } from "spectron";
|
|
|
|
export function minikubeReady(testNamespace: string): boolean {
|
|
// determine if minikube is running
|
|
{
|
|
const { status } = spawnSync("minikube status", { shell: true });
|
|
|
|
if (status !== 0) {
|
|
console.warn("minikube not running");
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Remove TEST_NAMESPACE if it already exists
|
|
{
|
|
const { status } = spawnSync(`minikube kubectl -- get namespace ${testNamespace}`, { shell: true });
|
|
|
|
if (status === 0) {
|
|
console.warn(`Removing existing ${testNamespace} namespace`);
|
|
|
|
const { status, stdout, stderr } = spawnSync(
|
|
`minikube kubectl -- delete namespace ${testNamespace}`,
|
|
{ shell: true },
|
|
);
|
|
|
|
if (status !== 0) {
|
|
console.warn(`Error removing ${testNamespace} namespace: ${stderr.toString()}`);
|
|
|
|
return false;
|
|
}
|
|
|
|
console.log(stdout.toString());
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
export async function addMinikubeCluster(app: Application) {
|
|
await app.client.click("button.add-button");
|
|
await app.client.waitUntilTextExists("div", "Select kubeconfig file");
|
|
await app.client.click("div.Select__control"); // show the context drop-down list
|
|
await app.client.waitUntilTextExists("div", "minikube");
|
|
|
|
if (!await app.client.$("button.primary").isEnabled()) {
|
|
await app.client.click("div.minikube"); // select minikube context
|
|
} // else the only context, which must be 'minikube', is automatically selected
|
|
await app.client.click("div.Select__control"); // hide the context drop-down list (it might be obscuring the Add cluster(s) button)
|
|
await app.client.click("button.primary"); // add minikube cluster
|
|
}
|
|
|
|
export async function waitForMinikubeDashboard(app: Application) {
|
|
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started");
|
|
await app.client.waitForExist(`iframe[name="minikube"]`);
|
|
await app.client.frame("minikube");
|
|
await app.client.waitUntilTextExists("span.link-text", "Cluster");
|
|
}
|