fix sender_keys itest

pull/1287/head
Audric Ackermann 5 years ago
parent 1f7cfc357b
commit e24fc12b93
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -19,12 +19,12 @@ chai.use(chaiAsPromised as any);
chai.config.includeStack = true; chai.config.includeStack = true;
// FIXME audric // FIXME audric
// // From https://github.com/chaijs/chai/issues/200 // From https://github.com/chaijs/chai/issues/200
// chai.use((_chai, _) => { chai.use((_chai, _) => {
// _chai.Assertion.addMethod('withMessage', (msg:any) => { _chai.Assertion.addMethod('withMessage', (msg: string) => {
// _.flag(Common, 'message', msg); _.flag(Common, 'message', msg);
// }); });
// }); });
const STUB_SNODE_SERVER_PORT = 3000; const STUB_SNODE_SERVER_PORT = 3000;
const ENABLE_LOG = false; const ENABLE_LOG = false;
@ -272,7 +272,7 @@ export class Common {
app1: Application, app1: Application,
client2: [Application, string] client2: [Application, string]
) { ) {
const [app2, pubkey2] = client2; const [_, pubkey2] = client2;
/** add each other as friends */ /** add each other as friends */
const textMessage = Common.generateSendMessageText(); const textMessage = Common.generateSendMessageText();

@ -7,10 +7,10 @@ import './open_group_itest';
import './add_contacts_itest'; import './add_contacts_itest';
import './link_device_itest'; import './link_device_itest';
import './closed_group_itest'; import './closed_group_itest';
// import './message_functions_itest'; import './message_functions_itest';
// import './settings_itest'; import './settings_itest';
// import'./message_sync_itest'; import './message_sync_itest';
// import './sender_keys_itest'; import './sender_keys_itest';
before(async function() { before(async function() {
// start the app once before all tests to get the platform-dependent // start the app once before all tests to get the platform-dependent

@ -30,13 +30,14 @@ describe('Message Functions', function() {
await Common.stopStubSnodeServer(); await Common.stopStubSnodeServer();
}); });
it('can send attachment', async () => { it('messageFunction: can send attachment', async () => {
// create group and add new friend // create group and add new friend
await Common.addFriendToNewClosedGroup([app, app2], false); await Common.addFriendToNewClosedGroup([app, app2], false);
// send attachment from app1 to closed group // send attachment from app1 to closed group
const fileLocation = path.join(__dirname, 'test_attachment'); const fileLocation = path.join(__dirname, 'test_attachment');
const messageText = 'test_attachment'; const messageText = 'test_attachment';
await Common.closeToast(app);
await Common.sendMessage(app, messageText, fileLocation); await Common.sendMessage(app, messageText, fileLocation);
@ -52,7 +53,7 @@ describe('Message Functions', function() {
); );
}); });
it('can delete message', async () => { it('messageFunction: can delete message', async () => {
// create group and add new friend // create group and add new friend
await Common.addFriendToNewClosedGroup([app, app2], false); await Common.addFriendToNewClosedGroup([app, app2], false);
const messageText = 'delete_me'; const messageText = 'delete_me';

@ -4,7 +4,7 @@
// tslint:disable: no-implicit-dependencies // tslint:disable: no-implicit-dependencies
// tslint:disable: no-invalid-this // tslint:disable: no-invalid-this
import { after, before, describe, it } from 'mocha'; import { after, before, it, describe} from 'mocha';
import { Common } from './common'; import { Common } from './common';
import { Application } from 'spectron'; import { Application } from 'spectron';
@ -40,7 +40,7 @@ describe('Message Syncing', function() {
await Common.stopStubSnodeServer(); await Common.stopStubSnodeServer();
}); });
it('message syncing with 1 friend, 1 closed group, 1 open group', async () => { xit('message syncing with 1 friend, 1 closed group, 1 open group', async () => {
// Alice1 has: // Alice1 has:
// * no linked device // * no linked device
// * Bob is a friend // * Bob is a friend

@ -26,7 +26,7 @@ export = {
`${num} members` `${num} members`
), ),
conversationItem: commonPage.divWithClass('module-conversation-list-item'), conversationItem: '//*[contains(@class, \'module-conversation-list-item\')]',
attachmentInput: '//*[contains(@class, "choose-file")]/input[@type="file"]', attachmentInput: '//*[contains(@class, "choose-file")]/input[@type="file"]',
attachmentButton: '//*[contains(@class, "choose-file")]/button', attachmentButton: '//*[contains(@class, "choose-file")]/button',

@ -36,10 +36,14 @@ async function makeFriendsPlusMessage(
app: Application, app: Application,
[app2, pubkey]: [Application, string] [app2, pubkey]: [Application, string]
) { ) {
await Common.makeFriends(app, [app2, pubkey]); await Common.makeFriends(app, [app2, pubkey]);
// Send something back so that `app` can see our name // Send something back so that `app` can see our name
await app2.client.waitForExist(ConversationPage.conversationItem, 5000);
await app2.client.element(ConversationPage.conversationItem).click();
const text = await generateAndSendMessage(app2); const text = await generateAndSendMessage(app2);
await app.client.waitForExist( await app.client.waitForExist(
ConversationPage.existingReceivedMessageText(text), ConversationPage.existingReceivedMessageText(text),
8000 8000
@ -104,8 +108,8 @@ async function testThreeMembers() {
]); ]);
// 2. Make A friends with B and C (B and C are not friends) // 2. Make A friends with B and C (B and C are not friends)
await makeFriendsPlusMessage(app1, [app2, Common.TEST_PUBKEY2]); await makeFriendsPlusMessage(app1, [app2, Common.TEST_PUBKEY2]);
await makeFriendsPlusMessage(app1, [app3, Common.TEST_PUBKEY3]); await makeFriendsPlusMessage(app1, [app3, Common.TEST_PUBKEY3]);
const useSenderKeys = true; const useSenderKeys = true;
@ -116,17 +120,14 @@ async function testThreeMembers() {
// 4. Test that all members can see the message from app1 // 4. Test that all members can see the message from app1
const text1 = await generateAndSendMessage(app1); const text1 = await generateAndSendMessage(app1);
await app2.client.waitForExist( await app2.client.waitForExist(
ConversationPage.existingReceivedMessageText(text1), ConversationPage.existingReceivedMessageText(text1),
5000 5000
); );
await app3.client.waitForExist( await app3.client.waitForExist(
ConversationPage.existingReceivedMessageText(text1), ConversationPage.existingReceivedMessageText(text1),
5000 5000
); );
// TODO: test that B and C can send messages to the group // TODO: test that B and C can send messages to the group
// const text2 = await generateAndSendMessage(app3); // const text2 = await generateAndSendMessage(app3);

@ -40,7 +40,7 @@ describe('Settings', function() {
await Common.stopStubSnodeServer(); await Common.stopStubSnodeServer();
}); });
it('can toggle menubar', async () => { it('settings: can toggle menubar', async () => {
const menuBarVisible = await app.browserWindow.isMenuBarVisible(); const menuBarVisible = await app.browserWindow.isMenuBarVisible();
await app.client.element(SettingsPage.settingsButtonSection).click(); await app.client.element(SettingsPage.settingsButtonSection).click();
@ -53,7 +53,7 @@ describe('Settings', function() {
menuBarToggled.should.equal(!menuBarVisible); menuBarToggled.should.equal(!menuBarVisible);
}); });
it('can set password', async () => { it('settings: can set password', async () => {
await app.client await app.client
.element(SettingsPage.settingsRowWithText('Privacy')) .element(SettingsPage.settingsRowWithText('Privacy'))
.click(); .click();
@ -84,7 +84,7 @@ describe('Settings', function() {
await Common.closeToast(app); await Common.closeToast(app);
}); });
it('can remove password', async () => { it('settings: can remove password', async () => {
// Enter password to unlock settings // Enter password to unlock settings
await Common.setValueWrapper( await Common.setValueWrapper(
app, app,

Loading…
Cancel
Save