mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Catalog & Hotbar - initial groundwork (#2418)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
e18a041b13
commit
99a464c61d
109 files changed
+1604
-2612
No files matched your search
@@ -26,6 +26,7 @@ describe("Lens cluster pages", () => {
|
||||
const addCluster = async () => {
|
||||
await utils.clickWhatsNew(app);
|
||||
await utils.clickWelcomeNotification(app);
|
||||
await app.client.waitUntilTextExists("div", "Catalog");
|
||||
await addMinikubeCluster(app);
|
||||
await waitForMinikubeDashboard(app);
|
||||
await app.client.click('a[href="/nodes"]');
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
import { Application } from "spectron";
|
||||
import * as utils from "../helpers/utils";
|
||||
import { addMinikubeCluster, minikubeReady } from "../helpers/minikube";
|
||||
import { exec } from "child_process";
|
||||
import * as util from "util";
|
||||
|
||||
export const promiseExec = util.promisify(exec);
|
||||
|
||||
jest.setTimeout(60000);
|
||||
|
||||
describe("Lens integration tests", () => {
|
||||
let app: Application;
|
||||
const ready = minikubeReady("workspace-int-tests");
|
||||
|
||||
utils.describeIf(ready)("workspaces", () => {
|
||||
utils.beforeAllWrapped(async () => {
|
||||
app = await utils.appStart();
|
||||
await utils.clickWhatsNew(app);
|
||||
});
|
||||
|
||||
utils.afterAllWrapped(async () => {
|
||||
if (app?.isRunning()) {
|
||||
return utils.tearDown(app);
|
||||
}
|
||||
});
|
||||
|
||||
const switchToWorkspace = async (name: string) => {
|
||||
await app.client.click("[data-test-id=current-workspace]");
|
||||
await app.client.keys(name);
|
||||
await app.client.keys("Enter");
|
||||
await app.client.waitUntilTextExists("[data-test-id=current-workspace-name]", name);
|
||||
};
|
||||
|
||||
const createWorkspace = async (name: string) => {
|
||||
await app.client.click("[data-test-id=current-workspace]");
|
||||
await app.client.keys("add workspace");
|
||||
await app.client.keys("Enter");
|
||||
await app.client.keys(name);
|
||||
await app.client.keys("Enter");
|
||||
await app.client.waitUntilTextExists("[data-test-id=current-workspace-name]", name);
|
||||
};
|
||||
|
||||
it("creates new workspace", async () => {
|
||||
const name = "test-workspace";
|
||||
|
||||
await createWorkspace(name);
|
||||
await app.client.waitUntilTextExists("[data-test-id=current-workspace-name]", name);
|
||||
});
|
||||
|
||||
it("edits current workspaces", async () => {
|
||||
await createWorkspace("to-be-edited");
|
||||
await app.client.click("[data-test-id=current-workspace]");
|
||||
await app.client.keys("edit current workspace");
|
||||
await app.client.keys("Enter");
|
||||
await app.client.keys("edited-workspace");
|
||||
await app.client.keys("Enter");
|
||||
await app.client.waitUntilTextExists("[data-test-id=current-workspace-name]", "edited-workspace");
|
||||
});
|
||||
|
||||
it("adds cluster in default workspace", async () => {
|
||||
await switchToWorkspace("default");
|
||||
await addMinikubeCluster(app);
|
||||
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started");
|
||||
await app.client.waitForExist(`iframe[name="minikube"]`);
|
||||
await app.client.waitForVisible(".ClustersMenu .ClusterIcon.active");
|
||||
});
|
||||
|
||||
it("adds cluster in test-workspace", async () => {
|
||||
await switchToWorkspace("test-workspace");
|
||||
await addMinikubeCluster(app);
|
||||
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started");
|
||||
await app.client.waitForExist(`iframe[name="minikube"]`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -49,6 +49,8 @@ export async function addMinikubeCluster(app: Application) {
|
||||
} // 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
|
||||
await app.client.waitUntilTextExists("div.TableCell", "minikube");
|
||||
await app.client.click("div.TableRow");
|
||||
}
|
||||
|
||||
export async function waitForMinikubeDashboard(app: Application) {
|
||||
|
||||
@@ -80,7 +80,7 @@ export async function appStart() {
|
||||
export async function clickWhatsNew(app: Application) {
|
||||
await app.client.waitUntilTextExists("h1", "What's new?");
|
||||
await app.client.click("button.primary");
|
||||
await app.client.waitUntilTextExists("h5", "Clusters");
|
||||
await app.client.waitUntilTextExists("div", "Catalog");
|
||||
}
|
||||
|
||||
export async function clickWelcomeNotification(app: Application) {
|
||||
|
||||
Reference in new issue
Block a user