mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix integration tests not deselecting dropdown
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
0fedba5b66
commit
a77f3a2026
@ -6,39 +6,39 @@ jest.setTimeout(30000)
|
|||||||
|
|
||||||
const BACKSPACE = "\uE003"
|
const BACKSPACE = "\uE003"
|
||||||
|
|
||||||
|
async function clickWhatsNew(app: Application) {
|
||||||
|
await app.client.waitUntilTextExists("h1", "What's new")
|
||||||
|
await app.client.click("button.primary")
|
||||||
|
await app.client.waitUntilTextExists("h1", "Welcome")
|
||||||
|
}
|
||||||
|
|
||||||
|
async function addMinikubeCluster(app: Application) {
|
||||||
|
await app.client.click("div.add-cluster")
|
||||||
|
await app.client.waitUntilTextExists("div", "Select kubeconfig file")
|
||||||
|
await app.client.click("div.Select__control")
|
||||||
|
await app.client.waitUntilTextExists("div", "minikube")
|
||||||
|
await app.client.click("div.minikube")
|
||||||
|
await app.client.click("div.Select__control")
|
||||||
|
await app.client.click("button.primary")
|
||||||
|
}
|
||||||
|
|
||||||
|
async function waitForMinikubeDashboard(app: Application) {
|
||||||
|
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started")
|
||||||
|
await app.client.getWindowCount()
|
||||||
|
await app.client.waitForExist(`iframe[name="minikube"]`)
|
||||||
|
await app.client.frame("minikube")
|
||||||
|
await app.client.waitUntilTextExists("span.link-text", "Cluster")
|
||||||
|
}
|
||||||
|
|
||||||
describe("app start", () => {
|
describe("app start", () => {
|
||||||
let app: Application
|
let app: Application
|
||||||
const clickWhatsNew = async (app: Application) => {
|
|
||||||
await app.client.waitUntilTextExists("h1", "What's new")
|
|
||||||
await app.client.click("button.primary")
|
|
||||||
await app.client.waitUntilTextExists("h1", "Welcome")
|
|
||||||
}
|
|
||||||
|
|
||||||
const addMinikubeCluster = async (app: Application) => {
|
|
||||||
await app.client.click("div.add-cluster")
|
|
||||||
await app.client.waitUntilTextExists("div", "Select kubeconfig file")
|
|
||||||
await app.client.click("div.Select__control")
|
|
||||||
await app.client.waitUntilTextExists("div", "minikube")
|
|
||||||
await app.client.click("div.minikube")
|
|
||||||
await app.client.click("button.primary")
|
|
||||||
}
|
|
||||||
|
|
||||||
const waitForMinikubeDashboard = async (app: Application) => {
|
|
||||||
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started")
|
|
||||||
let windowCount = await app.client.getWindowCount()
|
|
||||||
await app.client.waitForExist(`iframe[name="minikube"]`)
|
|
||||||
await app.client.frame("minikube")
|
|
||||||
await app.client.waitUntilTextExists("span.link-text", "Cluster")
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
app = util.setup()
|
app = util.setup()
|
||||||
await app.start()
|
await app.start()
|
||||||
await app.client.waitUntilWindowLoaded()
|
await app.client.waitUntilWindowLoaded()
|
||||||
let windowCount = await app.client.getWindowCount()
|
// Wait for splash screen to be closed
|
||||||
while (windowCount > 1) { // Wait for splash screen to be closed
|
while (await app.client.getWindowCount() > 1);
|
||||||
windowCount = await app.client.getWindowCount()
|
|
||||||
}
|
|
||||||
await app.client.windowByIndex(0)
|
await app.client.windowByIndex(0)
|
||||||
await app.client.waitUntilWindowLoaded()
|
await app.client.waitUntilWindowLoaded()
|
||||||
}, 20000)
|
}, 20000)
|
||||||
@ -48,7 +48,7 @@ describe("app start", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('allows to add a cluster', async () => {
|
it('allows to add a cluster', async () => {
|
||||||
const status = spawnSync("minikube status", {shell: true})
|
const status = spawnSync("minikube status", { shell: true })
|
||||||
if (status.status !== 0) {
|
if (status.status !== 0) {
|
||||||
console.warn("minikube not running, skipping test")
|
console.warn("minikube not running, skipping test")
|
||||||
return
|
return
|
||||||
@ -61,7 +61,7 @@ describe("app start", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('allows to create a pod', async () => {
|
it('allows to create a pod', async () => {
|
||||||
const status = spawnSync("minikube status", {shell: true})
|
const status = spawnSync("minikube status", { shell: true })
|
||||||
if (status.status !== 0) {
|
if (status.status !== 0) {
|
||||||
console.warn("minikube not running, skipping test")
|
console.warn("minikube not running, skipping test")
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user