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

Fixin tests harder

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-04-06 12:54:45 +03:00
parent d0078519cb
commit 303160161c
3 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@ describe("Lens integration tests", () => {
it('shows "add cluster"', async () => { it('shows "add cluster"', async () => {
await app.electron.ipcRenderer.send("test-menu-item-click", "File", "Add Cluster"); await app.electron.ipcRenderer.send("test-menu-item-click", "File", "Add Cluster");
await app.client.waitUntilTextExists("h2", "Add Cluster"); await app.client.waitUntilTextExists("h2", "Add Clusters from Kubeconfig");
}); });
describe("preferences page", () => { describe("preferences page", () => {
@ -44,17 +44,17 @@ describe("Lens integration tests", () => {
const appName: string = process.platform === "darwin" ? "Lens" : "File"; const appName: string = process.platform === "darwin" ? "Lens" : "File";
await app.electron.ipcRenderer.send("test-menu-item-click", appName, "Preferences"); await app.electron.ipcRenderer.send("test-menu-item-click", appName, "Preferences");
await app.client.waitUntilTextExists(".PageLayout h2", "Application"); await app.client.waitUntilTextExists("[data-testid=application-header]", "APPLICATION");
}); });
it("shows all tabs and their contents", async () => { it("shows all tabs and their contents", async () => {
await app.client.click("[data-testid=application-tab]"); await app.client.click("[data-testid=application-tab]");
await app.client.click("[data-testid=proxy-tab]"); await app.client.click("[data-testid=proxy-tab]");
await app.client.waitUntilTextExists(".PageLayout h2", "Proxy"); await app.client.waitUntilTextExists("[data-testid=proxy-header]", "PROXY");
await app.client.click("[data-testid=kube-tab]"); await app.client.click("[data-testid=kube-tab]");
await app.client.waitUntilTextExists(".PageLayout h2", "Kubernetes"); await app.client.waitUntilTextExists("[data-testid=kubernetes-header]", "KUBERNETES");
await app.client.click("[data-testid=telemetry-tab]"); await app.client.click("[data-testid=telemetry-tab]");
await app.client.waitUntilTextExists(".PageLayout h2", "Telemetry"); await app.client.waitUntilTextExists("[data-testid=telemetry-header]", "TELEMETRY");
}); });
it("ensures helm repos", async () => { it("ensures helm repos", async () => {

View File

@ -80,7 +80,7 @@ export async function appStart() {
export async function clickWhatsNew(app: Application) { export async function clickWhatsNew(app: Application) {
await app.client.waitUntilTextExists("h1", "What's new?"); await app.client.waitUntilTextExists("h1", "What's new?");
await app.client.click("button.primary"); await app.client.click("button.primary");
await app.client.waitUntilTextExists("h2", "default"); await app.client.waitUntilTextExists("h5", "Clusters");
} }
export async function clickWelcomeNotification(app: Application) { export async function clickWelcomeNotification(app: Application) {
@ -89,7 +89,7 @@ export async function clickWelcomeNotification(app: Application) {
if (itemsText === "0 item") { if (itemsText === "0 item") {
// welcome notification should be present, dismiss it // welcome notification should be present, dismiss it
await app.client.waitUntilTextExists("div.message", "Welcome!"); await app.client.waitUntilTextExists("div.message", "Welcome!");
await app.client.click("i.Icon.close"); await app.client.click(".notification i.Icon.close");
} }
} }

View File

@ -114,7 +114,7 @@ export class Preferences extends React.Component {
> >
{this.activeTab == Pages.Application && ( {this.activeTab == Pages.Application && (
<section id="application"> <section id="application">
<h2>Application</h2> <h2 data-testid="application-header">Application</h2>
<section id="appearance"> <section id="appearance">
<SubTitle title="Theme"/> <SubTitle title="Theme"/>
<Select <Select
@ -158,7 +158,7 @@ export class Preferences extends React.Component {
{this.activeTab == Pages.Proxy && ( {this.activeTab == Pages.Proxy && (
<section id="proxy"> <section id="proxy">
<section> <section>
<h2>Proxy</h2> <h2 data-testid="proxy-header">Proxy</h2>
<SubTitle title="HTTP Proxy"/> <SubTitle title="HTTP Proxy"/>
<Input <Input
theme="round-black" theme="round-black"
@ -198,7 +198,7 @@ export class Preferences extends React.Component {
{this.activeTab == Pages.Kubernetes && ( {this.activeTab == Pages.Kubernetes && (
<section id="kubernetes"> <section id="kubernetes">
<section id="kubectl"> <section id="kubectl">
<h2>Kubernetes</h2> <h2 data-testid="kubernetes-header">Kubernetes</h2>
<KubectlBinaries preferences={preferences}/> <KubectlBinaries preferences={preferences}/>
</section> </section>
<hr/> <hr/>
@ -211,7 +211,7 @@ export class Preferences extends React.Component {
{this.activeTab == Pages.Telemetry && ( {this.activeTab == Pages.Telemetry && (
<section id="telemetry"> <section id="telemetry">
<h2>Telemetry</h2> <h2 data-testid="telemetry-header">Telemetry</h2>
{telemetryExtensions.map(this.renderExtension)} {telemetryExtensions.map(this.renderExtension)}
</section> </section>
)} )}