mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
test cluster add using minikube
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
90537f0637
commit
84872bd864
@ -121,7 +121,7 @@ jobs:
|
||||
displayName: Lint
|
||||
- script: make test
|
||||
displayName: Run tests
|
||||
- script: sudo apt-get update && sudo apt-get install libgconf-2-4 -y
|
||||
- script: sudo apt-get update && sudo apt-get install libgconf-2-4 -y && sudo snap install -y minikube && sudo minikube start --vm-driver=none
|
||||
displayName: Install integration test dependencies
|
||||
- script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux
|
||||
displayName: Run integration tests
|
||||
|
||||
@ -1,8 +1,18 @@
|
||||
import { Application } from "spectron"
|
||||
import * as util from "../helpers/utils"
|
||||
import { spawnSync } from "child_process"
|
||||
import { stat } from "fs"
|
||||
|
||||
jest.setTimeout(20000)
|
||||
|
||||
describe("app start", () => {
|
||||
let app: Application
|
||||
const clickWhatsNew = async (app: Application) => {
|
||||
await app.client.waitUntilTextExists("h1", "What's new")
|
||||
await app.client.click("button.btn-primary")
|
||||
await app.client.waitUntilTextExists("h1", "Welcome")
|
||||
}
|
||||
|
||||
beforeEach(async () => {
|
||||
app = util.setup()
|
||||
await app.start()
|
||||
@ -11,10 +21,31 @@ describe("app start", () => {
|
||||
await app.client.waitUntilWindowLoaded()
|
||||
}, 20000)
|
||||
|
||||
it('starts with whats new flow', async () => {
|
||||
await app.client.waitUntilTextExists("h1", "What's new")
|
||||
it('shows "whats new"', async () => {
|
||||
await clickWhatsNew(app)
|
||||
})
|
||||
|
||||
it('allows to add a cluster', async () => {
|
||||
const status = spawnSync("minikube status", {shell: true})
|
||||
if (status.status !== 0) {
|
||||
console.warn("skipping test")
|
||||
return
|
||||
}
|
||||
await clickWhatsNew(app)
|
||||
await app.client.click("a#add-cluster")
|
||||
await app.client.waitUntilTextExists("legend", "Choose config:")
|
||||
await app.client.selectByVisibleText("select#kubecontext-select", "minikube (new)")
|
||||
await app.client.click("button.btn-primary")
|
||||
await app.client.waitUntilTextExists("h1", "Welcome")
|
||||
await app.client.waitUntilTextExists("pre.auth-output", "Authentication proxy started")
|
||||
let windowCount = await app.client.getWindowCount()
|
||||
// wait for webview to appear on window count
|
||||
while (windowCount == 1) {
|
||||
windowCount = await app.client.getWindowCount()
|
||||
}
|
||||
await app.client.windowByIndex(windowCount - 1)
|
||||
await app.client.waitUntilTextExists("span.link-text", "Cluster")
|
||||
await app.client.click('a[href="/nodes"]')
|
||||
await app.client.waitUntilTextExists("div.TableCell", "minikube")
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
label="Choose config:"
|
||||
>
|
||||
<b-form-select
|
||||
id="kubecontext-select"
|
||||
v-model="kubecontext"
|
||||
:options="contextNames"
|
||||
@change="onSelect($event)"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user