Merge branch 'master' into electron-11.4.3

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-06-09 09:44:54 +03:00
commit 99cbba4021
1156 files changed
+40007 -11252

No files matched your search

+27 -18
View File
@@ -1,5 +1,25 @@
/**
* Copyright (c) 2021 OpenLens Authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { spawnSync } from "child_process";
import { Application } from "spectron";
import type { Application } from "spectron";
export function minikubeReady(testNamespace: string): boolean {
// determine if minikube is running
@@ -38,25 +58,14 @@ export function minikubeReady(testNamespace: string): boolean {
return true;
}
export async function addMinikubeCluster(app: Application) {
await (await app.client.$("button.MuiSpeedDial-fab")).waitForDisplayed();
await app.client.moveToElement("button.MuiSpeedDial-fab");
await (await app.client.$(`button[title="Add from kubeconfig"]`)).waitForDisplayed();
await app.client.elementClick(`button[title="Add from kubeconfig"]`);
await app.client.waitUntilTextExists("div", "Select kubeconfig file");
await app.client.elementClick("div.Select__control"); // show the context drop-down list
await app.client.waitUntilTextExists("div", "minikube");
if (!await app.client.isElementEnabled("button.primary")) {
await app.client.elementClick("div.minikube"); // select minikube context
} // else the only context, which must be 'minikube', is automatically selected
await app.client.elementClick("div.Select__control"); // hide the context drop-down list (it might be obscuring the Add cluster(s) button)
await app.client.elementClick("button.primary"); // add minikube cluster
export async function waitForMinikubeDashboard(app: Application) {
await app.client.waitUntilTextExists("div.TableCell", "minikube");
await (await app.client.$(".Input.SearchInput input")).waitForExist();
await (await app.client.$(".Input.SearchInput input")).setValue("minikube");
await app.client.waitUntilTextExists("div.TableCell", "minikube");
await app.client.elementClick("div.TableRow");
}
export async function waitForMinikubeDashboard(app: Application) {
await app.client.waitUntilTextExists("div.drawer-title-text", "KubernetesCluster: minikube");
await app.client.elementClick("div.EntityIcon div.HotbarIcon div div.MuiAvatar-root");
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started");
await (await app.client.$(`iframe[name="minikube"]`)).waitForDisplayed();
await (await app.client.$("iframe[name=minikube]")).waitForExist();
+26
View File
@@ -1,3 +1,23 @@
/**
* Copyright (c) 2021 OpenLens Authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { Application } from "spectron";
import * as util from "util";
import { exec } from "child_process";
@@ -72,6 +92,7 @@ export async function appStart() {
while (await startedApp.client.getWindowCount() > 1);
await startedApp.client.windowByIndex(0);
await startedApp.client.waitUntilWindowLoaded();
await showCatalog(app);
return startedApp;
}
@@ -92,6 +113,11 @@ export async function clickWelcomeNotification(app: Application) {
}
}
export async function showCatalog(app: Application) {
await app.client.waitUntilTextExists("[data-test-id=catalog-link]", "Catalog");
await app.client.elementClick("[data-test-id=catalog-link]");
}
type AsyncPidGetter = () => Promise<number>;
export async function tearDown(app: Application) {