mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 16:13:37 +00:00
tests: Fix E2E tests for Spectron 11.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -10,7 +10,7 @@ test('app runs', async t => {
|
||||
try {
|
||||
await setup.waitForLoad(app, t);
|
||||
await app.client.windowByIndex(1); // Focus on webview
|
||||
await app.client.waitForExist('//*[@id="connect"]'); // Id of the connect button
|
||||
await (await app.client.$('//*[@id="connect"]')).waitForExist(); // Id of the connect button
|
||||
await setup.endTest(app, t);
|
||||
} catch (error) {
|
||||
await setup.endTest(app, t, error || 'error');
|
||||
|
@@ -67,6 +67,7 @@ async function wait(ms) {
|
||||
|
||||
// Quit the app, end the test, either in success (!err) or failure (err)
|
||||
async function endTest(app, t, err) {
|
||||
await app.client.windowByIndex(0);
|
||||
await app.stop();
|
||||
t.end(err);
|
||||
}
|
||||
|
@@ -10,12 +10,12 @@ test('add-organization', async t => {
|
||||
try {
|
||||
await setup.waitForLoad(app, t);
|
||||
await app.client.windowByIndex(1); // Focus on webview
|
||||
await app.client.setValue('.setting-input-value', 'chat.zulip.org');
|
||||
await app.client.click('#connect');
|
||||
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 app.client.waitForExist('//*[@id="id_username"]');
|
||||
await (await app.client.$('//*[@id="id_username"]')).waitForExist();
|
||||
await setup.endTest(app, t);
|
||||
} catch (error) {
|
||||
await setup.endTest(app, t, error || 'error');
|
||||
|
@@ -12,7 +12,7 @@ test('new-org-link', async t => {
|
||||
try {
|
||||
await setup.waitForLoad(app, t);
|
||||
await app.client.windowByIndex(1); // Focus on webview
|
||||
await app.client.click('#open-create-org-link'); // Click on new org link button
|
||||
await (await app.client.$('#open-create-org-link')).click(); // Click on new org link button
|
||||
await setup.wait(5000);
|
||||
await setup.endTest(app, t);
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user