Merge branch 'clearnet' of https://github.com/loki-project/session-desktop into integration-test-vince

pull/1067/head
Vincent 5 years ago
commit bbba903864

@ -43,9 +43,8 @@ describe('Add friends', function() {
await app.client.element(ConversationPage.contactsButtonSection).click();
await app.client.element(ConversationPage.addContactButton).click();
await app.client
.isExisting(ConversationPage.leftPaneOverlay)
.should.eventually.be.equal(true);
await app.client.isExisting(ConversationPage.leftPaneOverlay).should
.eventually.be.true;
await app.client
.element(ConversationPage.sessionIDInput)
@ -71,9 +70,8 @@ describe('Add friends', function() {
);
// assure friend request message has been sent
await common.timeout(3000);
await app.client
.isExisting(ConversationPage.retrySendButton)
.should.eventually.be.equal(false);
await app.client.isExisting(ConversationPage.retrySendButton).should
.eventually.be.false;
// wait for left notification Friend Request count to go to 1 and click it
await app2.client.waitForExist(
@ -86,7 +84,7 @@ describe('Add friends', function() {
// open the dropdown from the top friend request count
await app2.client.isExisting(
ConversationPage.oneNotificationFriendRequestTop
);
).should.eventually.be.true;
await app2.client
.element(ConversationPage.oneNotificationFriendRequestTop)
.click();
@ -97,8 +95,9 @@ describe('Add friends', function() {
common.TEST_DISPLAY_NAME1,
common.TEST_PUBKEY1
)
);
await app2.client.isExisting(ConversationPage.acceptFriendRequestButton);
).should.eventually.be.true;
await app2.client.isExisting(ConversationPage.acceptFriendRequestButton)
.should.eventually.be.true;
// accept the friend request and validate that on both side the "accepted FR" message is shown
await app2.client

@ -108,7 +108,7 @@ module.exports = {
const killStr =
process.platform === 'win32'
? 'taskkill /im electron.exe /t /f'
: 'pkill -f "node_modules/.bin/electron"';
: 'pkill -f "node_modules/electron/dist/electron"';
return new Promise(resolve => {
exec(killStr, (_err, stdout, stderr) => {
resolve({ stdout, stderr });
@ -248,7 +248,7 @@ module.exports = {
// open the dropdown from the top friend request count
await app2.client.isExisting(
ConversationPage.oneNotificationFriendRequestTop
);
).should.eventually.be.true;
await app2.client
.element(ConversationPage.oneNotificationFriendRequestTop)
.click();
@ -386,7 +386,8 @@ module.exports = {
2000
);
await app1.client.isExisting(ConversationPage.unpairDeviceButton);
await app1.client.isExisting(ConversationPage.unpairDeviceButton).should
.eventually.be.true;
await app1.client.isExisting(ConversationPage.linkDeviceButtonDisabled)
.should.eventually.be.true;
@ -404,7 +405,8 @@ module.exports = {
async triggerUnlinkApp2FromApp(app1, app2) {
// check app2 is loggedin
await app2.client.isExisting(RegistrationPage.conversationListContainer);
await app2.client.isExisting(RegistrationPage.conversationListContainer)
.should.eventually.be.true;
await app1.client.element(ConversationPage.settingsButtonSection).click();
await app1.client.element(ConversationPage.deviceSettingsRow).click();
@ -419,7 +421,7 @@ module.exports = {
2000
);
await app1.client.element(ConversationPage.linkDeviceButton).isEnabled()
.should.eventually.be.false;
.should.eventually.be.true;
// let time to app2 to catch the event and restart dropping its data
await this.timeout(5000);
@ -428,7 +430,8 @@ module.exports = {
// (did not find a better way than checking the app no longer being accessible)
let isApp2Joinable = true;
try {
await app2.client.isExisting(RegistrationPage.registrationTabSignIn);
await app2.client.isExisting(RegistrationPage.registrationTabSignIn)
.should.eventually.be.true;
} catch (err) {
// if we get an error here, it means Spectron is lost.
// this is a good thing because it means app2 restarted
@ -513,6 +516,7 @@ module.exports = {
if (this.messages[pubkey]) {
response.writeHead(200, { 'Content-Type': 'application/json' });
response.write(JSON.stringify(retrievedMessages));
this.messages[pubkey] = [];
}
response.end();
}

@ -2,10 +2,10 @@
/* eslint-disable more/no-then */
/* eslint-disable func-names */
/* eslint-disable import/no-extraneous-dependencies */
const common = require('./common');
const path = require('path');
const { after, before, describe, it } = require('mocha');
const common = require('./common');
const ConversationPage = require('./page-objects/conversation.page');
describe('Message Functions', function() {

@ -37,16 +37,16 @@ describe('Open groups', function() {
await app.client.element(ConversationPage.joinOpenGroupButton).click();
// validate session loader is shown
await app.client.isExisting(ConversationPage.sessionLoader);
await app.client.isExisting(ConversationPage.sessionLoader).should
.eventually.be.true;
await app.client.waitForExist(
ConversationPage.sessionToastJoinOpenGroupSuccess,
9000
);
// validate overlay is closed
await app.client
.isExisting(ConversationPage.leftPaneOverlay)
.should.eventually.be.equal(false);
await app.client.isExisting(ConversationPage.leftPaneOverlay).should
.eventually.be.false;
// validate open chat has been added
await app.client.waitForExist(
@ -81,9 +81,8 @@ describe('Open groups', function() {
.setValue(common.VALID_GROUP_URL2);
await app.client.element(ConversationPage.joinOpenGroupButton).click();
// validate session loader is not shown
await app.client
.isExisting(ConversationPage.sessionLoader)
.should.eventually.be.equal(false);
await app.client.isExisting(ConversationPage.sessionLoader).should
.eventually.be.false;
await app.client.waitForExist(
ConversationPage.sessionToastJoinOpenGroupAlreadyExist,
@ -91,9 +90,8 @@ describe('Open groups', function() {
);
// validate overlay is still opened
await app.client
.isExisting(ConversationPage.leftPaneOverlay)
.should.eventually.be.equal(true);
await app.client.isExisting(ConversationPage.leftPaneOverlay).should
.eventually.be.true;
});
it('can send message to open group', async () => {

@ -8,7 +8,7 @@ module.exports = {
divRoleButtonWithTextDisabled: text =>
`//div[contains(string(), "${text}")][contains(@role, "button")][contains(@class, "disabled")]`,
divRoleButtonDangerWithText: text =>
`${module.exports.divRoleButtonWithText(text)}`,
`${module.exports.divRoleButtonWithText(text)}[contains(@class, "danger")]`,
inputWithPlaceholder: placeholder =>
`//input[contains(@placeholder, "${placeholder}")]`,
textAreaWithPlaceholder: placeholder =>

@ -80,7 +80,7 @@ module.exports = {
oneNotificationFriendRequestLeft:
'//*[contains(@class,"session-icon-button") and .//*[contains(@class, "users")] and .//*[contains(@class, "notification-count") and contains(string(), "1")] ]',
oneNotificationFriendRequestTop:
'//*[contains(@class,"module-left-pane__header")] //*[contains(@class, "notification-count") and contains(string(), "1")]',
'//*[contains(@class,"notification-count hover") and contains(string(), "1")]',
friendRequestFromUser: (displayName, pubkey) =>
`//*[contains(@class,"module-left-pane__list-popup") and .//*[contains(@class, "module-conversation__user") and .//*[contains(string(), "${displayName}")] and .//*[contains(string(), "(...${pubkey.substring(
60
@ -102,23 +102,23 @@ module.exports = {
),
validateDeleteAccount: commonPage.divRoleButtonDangerWithText('OK'),
// device pairing
// device linking
noPairedDeviceMessage:
'//*[contains(@class, "session-settings-item__title")][contains(string(), "No paired devices")]',
'//*[contains(@class, "session-settings-item__title")][contains(string(), "No linked devices")]',
linkDeviceButton: commonPage.divRoleButtonWithText('Link New Device'),
linkDeviceButtonDisabled: commonPage.divRoleButtonWithTextDisabled(
'Link New Device'
),
devicePairingDialog: '//*[contains(@class,"device-pairing-dialog")]',
qrImageDiv: commonPage.divWithClass('qr-image'),
allowPairingButton: commonPage.divRoleButtonWithText('Allow Pairing'),
allowPairingButton: commonPage.divRoleButtonWithText('Allow Linking'),
okButton: commonPage.divRoleButtonWithText('OK'),
devicePairedDescription: secretWords =>
commonPage.divWithClassAndText(
'session-settings-item__description',
secretWords
),
unpairDeviceButton: commonPage.divRoleButtonDangerWithText('Unpair Device'),
unpairDeviceButton: commonPage.divRoleButtonDangerWithText('Unlink Device'),
deleteAccountButton: commonPage.divRoleButtonDangerWithText('Delete Account'),
validateUnpairDevice: commonPage.divRoleButtonDangerWithText('Unpair'),
validateUnpairDevice: commonPage.divRoleButtonDangerWithText('Unlink'),
};

@ -82,7 +82,8 @@ describe('Window Test and Login', function() {
pubkeyGenerated.should.have.lengthOf(66);
pubkeyGenerated.substr(0, 2).should.be.equal('05');
await app.client.element(RegistrationPage.continueButton).click();
await app.client.isExisting(RegistrationPage.displayNameInput);
await app.client.isExisting(RegistrationPage.displayNameInput).should
.eventually.be.true;
await app.client
.element(RegistrationPage.displayNameInput)
.setValue(common.TEST_DISPLAY_NAME1);
@ -117,7 +118,8 @@ describe('Window Test and Login', function() {
// delete account
await app.client.element(ConversationPage.settingsButtonSection).click();
await app.client.element(ConversationPage.deleteAccountButton).click();
await app.client.isExisting(ConversationPage.descriptionDeleteAccount);
await app.client.isExisting(ConversationPage.descriptionDeleteAccount)
.should.eventually.be.true;
// click on the modal OK button to delete the account
await app.client.element(ConversationPage.validateDeleteAccount).click();
// wait for the app restart

@ -437,3 +437,10 @@ if (
buildNewOnionPaths: () => [],
};
}
if (config.environment.includes('test-integration')) {
window.lokiFeatureFlags = {
multiDeviceUnpairing: true,
privateGroupChats: true,
useSnodeProxy: !process.env.USE_STUBBED_NETWORK,
};
}

Loading…
Cancel
Save