fix composer issue and more

This commit is contained in:
Bruno Windels 2018-08-09 14:23:09 +02:00
parent af0c0c0afe
commit 2c983f8cee
7 changed files with 54 additions and 29 deletions

View file

@ -15,6 +15,7 @@ limitations under the License.
*/
const {acceptDialog} = require('./tests/dialog');
const signup = require('./tests/signup');
const join = require('./tests/join');
const sendMessage = require('./tests/send-message');
@ -31,8 +32,7 @@ module.exports = async function scenario(createSession) {
async function createUser(username) {
const session = await createSession(username);
await signup(session, session.username, 'testtest');
const noticesName = "Server Notices";
await acceptServerNoticesInviteAndConsent(session, noticesName);
await acceptServerNoticesInviteAndConsent(session);
return session;
}
@ -46,26 +46,40 @@ module.exports = async function scenario(createSession) {
async function createDirectoryRoomAndTalk(alice, bob) {
console.log(" creating a public room and join through directory:");
const room = 'test';
const message = "hi Alice!";
await createRoom(alice, room);
await changeRoomSettings(alice, {directory: true, visibility: "public_no_guests"});
await join(bob, room);
await sendMessage(bob, message);
await receiveMessage(alice, {sender: "bob", body: message});
const bobMessage = "hi Alice!";
await sendMessage(bob, bobMessage);
await receiveMessage(alice, {sender: "bob", body: bobMessage});
const aliceMessage = "hi Bob, welcome!"
await sendMessage(alice, aliceMessage);
await receiveMessage(bob, {sender: "alice", body: aliceMessage});
}
async function createE2ERoomAndTalk(alice, bob) {
console.log(" creating an e2e encrypted room and join through invite:");
const room = "secrets";
const message = "Guess what I just heard?!"
await createRoom(bob, room);
await changeRoomSettings(bob, {encryption: true});
await invite(bob, "@alice:localhost");
await acceptInvite(alice, room);
const bobDevice = await getE2EDeviceFromSettings(bob);
// wait some time for the encryption warning dialog
// to appear after closing the settings
await bob.delay(500);
await acceptDialog(bob, "encryption");
const aliceDevice = await getE2EDeviceFromSettings(alice);
// wait some time for the encryption warning dialog
// to appear after closing the settings
await alice.delay(500);
await acceptDialog(alice, "encryption");
await verifyDeviceForUser(bob, "alice", aliceDevice);
await verifyDeviceForUser(alice, "bob", bobDevice);
await sendMessage(alice, message);
await receiveMessage(bob, {sender: "alice", body: message, encrypted: true});
const aliceMessage = "Guess what I just heard?!"
await sendMessage(alice, aliceMessage);
await receiveMessage(bob, {sender: "alice", body: aliceMessage, encrypted: true});
const bobMessage = "You've got to tell me!";
await sendMessage(bob, bobMessage);
await receiveMessage(alice, {sender: "bob", body: bobMessage, encrypted: true});
}