reverting integration tests refactoring / fixing tests to current branch

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-03-10 14:14:46 +02:00
1 parent 25e5122a3f
commit 55fa8bd743
10 files changed
+526 -433

No files matched your search

-7
View File
@@ -1,7 +0,0 @@
// Common utils for integration tests
export const BACKSPACE = "\uE003";
export * from "./utils";
export * from "./minikube";
export * from "./selectors";
-7
View File
@@ -1,6 +1,5 @@
import { spawnSync } from "child_process";
import { Application } from "spectron";
import { clickWhatsNew } from "./utils";
export function minikubeReady(testNamespace: string): boolean {
// determine if minikube is running
@@ -58,9 +57,3 @@ export async function waitForMinikubeDashboard(app: Application) {
await app.client.frame("minikube");
await app.client.waitUntilTextExists("span.link-text", "Cluster");
}
export async function addClusterAndOpen(app: Application) {
await clickWhatsNew(app);
await addMinikubeCluster(app);
await waitForMinikubeDashboard(app);
}
-13
View File
@@ -1,13 +0,0 @@
// CSS-selectors for searching elements to interact in tests
export function getMainMenuSelectors(itemId: string) {
const baseSelector = `.Sidebar [data-test-id="${itemId}"]`;
return {
sidebarItemRoot: baseSelector,
expandIcon: `${baseSelector} .expand-icon`,
pageLink(href: string) {
return `${baseSelector} a[href^="/${href}"]`;
}
};
}
+2 -21
View File
@@ -37,7 +37,7 @@ export async function appStart() {
await app.start();
// Wait for splash screen to be closed
while (await app.client.getWindowCount() > 1) ;
while (await app.client.getWindowCount() > 1);
await app.client.windowByIndex(0);
await app.client.waitUntilWindowLoaded();
@@ -71,7 +71,7 @@ type HelmRepository = {
url: string;
};
export async function listHelmRepositories(retries = 0): Promise<HelmRepository[]> {
export async function listHelmRepositories(retries = 0): Promise<HelmRepository[]>{
if (retries < 5) {
try {
const { stdout: reposJson } = await promiseExec("helm repo list -o json");
@@ -86,22 +86,3 @@ export async function listHelmRepositories(retries = 0): Promise<HelmRepository[
return [];
}
export function setupAppLifecycle(onStart?: (app: Application) => void, timeoutMs?: number) {
const runtime = {
app: null as Application,
};
beforeAll(async () => {
runtime.app = await appStart();
await onStart?.(runtime.app);
}, timeoutMs);
afterAll(async () => {
if (runtime.app?.isRunning()) {
await tearDown(runtime.app);
}
});
return runtime;
}