Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: back button #1100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions tests/test-back-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use strict";
const test = require("tape");

const setup = require("./setup");

test("back button", async (t) => {
t.timeoutAfter(50e3);
setup.resetTestDataDir();
const app = setup.createApp();
try {
await setup.waitForLoad(app, t);
await app.client.windowByIndex(1); // Focus on webview
await (await app.client.$(".setting-input-value")).setValue(
"chat.zulip.org",
);
await (await app.client.$("#connect")).click();
await setup.wait(5000);
await app.client.windowByIndex(0); // Switch focus back to main win
await app.client.windowByIndex(1); // Switch focus back to org webview
await (await app.client.$("#id_username")).waitForExist();
await (await app.client.$("#id_username")).setValue(
"testzulipdesktop@gmail.com",
);
await (await app.client.$("#id_password")).setValue("testzulipdesktop");
await (await app.client.$(".full-width")).click();
await setup.wait(5000);
await (await app.client.$(".private_messages_header")).click();
await setup.wait(5000);
await app.client.windowByIndex(0);
await (await app.client.$("#back-action")).click();
await setup.wait(5000);
await setup.endTest(app, t);
} catch (error) {
await setup.endTest(app, t, error || "error");
}
});