1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fixing integration tests

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-04-05 14:17:15 +03:00
parent c1ce7a0bbb
commit 1aa91f4b23
2 changed files with 18 additions and 7 deletions

View File

@ -44,7 +44,17 @@ describe("Lens integration tests", () => {
const appName: string = process.platform === "darwin" ? "Lens" : "File";
await app.electron.ipcRenderer.send("test-menu-item-click", appName, "Preferences");
await app.client.waitUntilTextExists("h2", "Preferences");
await app.client.waitUntilTextExists(".PageLayout h2", "Application");
});
it("shows all tabs and their contents", async () => {
await app.client.click("[data-testid=application-tab]");
await app.client.click("[data-testid=proxy-tab]");
await app.client.waitUntilTextExists(".PageLayout h2", "Proxy");
await app.client.click("[data-testid=kube-tab]");
await app.client.waitUntilTextExists(".PageLayout h2", "Kubernetes");
await app.client.click("[data-testid=telemetry-tab]");
await app.client.waitUntilTextExists(".PageLayout h2", "Telemetry");
});
it("ensures helm repos", async () => {
@ -54,7 +64,8 @@ describe("Lens integration tests", () => {
fail("Lens failed to add Bitnami repository");
}
await app.client.waitUntilTextExists("div.repos #message-bitnami", repos[0].name); // wait for the helm-cli to fetch the repo(s)
await app.client.click("[data-testid=kube-tab]");
await app.client.waitUntilTextExists("div.repos .repoName", repos[0].name); // wait for the helm-cli to fetch the repo(s)
await app.client.click("#HelmRepoSelect"); // click the repo select to activate the drop-down
await app.client.waitUntilTextExists("div.Select__option", ""); // wait for at least one option to appear (any text)
});

View File

@ -65,12 +65,12 @@ export class Preferences extends React.Component {
return (
<Tabs className="flex column" scrollable={false} onChange={this.onTabChange} value={this.activeTab}>
<div className="header">Preferences</div>
<Tab value={Pages.Application} label="Application"/>
<Tab value={Pages.Proxy} label="Proxy"/>
<Tab value={Pages.Kubernetes} label="Kubernetes"/>
<Tab value={Pages.Telemetry} label="Telemetry"/>
<Tab value={Pages.Application} label="Application" data-testid="application-tab"/>
<Tab value={Pages.Proxy} label="Proxy" data-testid="proxy-tab"/>
<Tab value={Pages.Kubernetes} label="Kubernetes" data-testid="kube-tab"/>
<Tab value={Pages.Telemetry} label="Telemetry" data-testid="telemetry-tab"/>
{extensions.length > 0 &&
<Tab value={Pages.Extensions} label="Extensions"/>
<Tab value={Pages.Extensions} label="Extensions" data-testid="extensions-tab"/>
}
</Tabs>
);