Skip to content

Commit 0a87676

Browse files
committed
tests: back button
Signed-off-by: tarun8718 <tarunkumar8718@gmail.com>
1 parent 391c515 commit 0a87676

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/test-back-button.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"use strict";
2+
const test = require("tape");
3+
4+
const setup = require("./setup");
5+
6+
test("back button", async (t) => {
7+
t.timeoutAfter(50e3);
8+
setup.resetTestDataDir();
9+
const app = setup.createApp();
10+
try {
11+
await setup.waitForLoad(app, t);
12+
await app.client.windowByIndex(1); // Focus on webview
13+
await (await app.client.$(".setting-input-value")).setValue(
14+
"chat.zulip.org",
15+
);
16+
await (await app.client.$("#connect")).click();
17+
await setup.wait(5000);
18+
await app.client.windowByIndex(0); // Switch focus back to main win
19+
await app.client.windowByIndex(1); // Switch focus back to org webview
20+
await (await app.client.$("#id_username")).waitForExist();
21+
await (await app.client.$("#id_username")).setValue(
22+
"testzulipdesktop@gmail.com",
23+
);
24+
await (await app.client.$("#id_password")).setValue(
25+
"testzulipdesktop",
26+
);
27+
await (await app.client.$(".full-width")).click();
28+
await setup.wait(5000);
29+
await (await app.client.$(".private_messages_header")).click();
30+
await setup.wait(5000);
31+
await app.client.windowByIndex(0);
32+
await (await app.client.$("#back-action")).click();
33+
await setup.wait(5000);
34+
await setup.endTest(app, t);
35+
} catch (error) {
36+
await setup.endTest(app, t, error || "error");
37+
}
38+
});

0 commit comments

Comments
 (0)