fix open group integration tests

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

@ -638,13 +638,15 @@ module.exports = {
.should.eventually.equal(openGroupUrl); .should.eventually.equal(openGroupUrl);
await app.client.element(ConversationPage.joinOpenGroupButton).click(); await app.client.element(ConversationPage.joinOpenGroupButton).click();
// validate session loader is shown await app.client.waitForExist(
await app.client.isExisting(ConversationPage.sessionLoader).should ConversationPage.sessionToastJoinOpenGroup,
.eventually.be.true; 2 * 1000
);
// account for slow home internet connection delays... // account for slow home internet connection delays...
await app.client.waitForExist( await app.client.waitForExist(
ConversationPage.sessionToastJoinOpenGroupSuccess, ConversationPage.sessionToastJoinOpenGroupSuccess,
60 * 1000 20 * 1000
); );
// validate overlay is closed // validate overlay is closed
@ -652,9 +654,10 @@ module.exports = {
.eventually.be.false; .eventually.be.false;
// validate open chat has been added // validate open chat has been added
await app.client.isExisting( await app.client.waitForExist(
ConversationPage.rowOpenGroupConversationName(name) ConversationPage.rowOpenGroupConversationName(name),
).should.eventually.be.true; 20 * 1000
);
}, },
async stopStubSnodeServer() { async stopStubSnodeServer() {

@ -59,7 +59,7 @@ describe('Open groups', function() {
1 * 1000 1 * 1000
); );
// validate overlay is still opened // validate overlay is still opened as connection failed
await app.client.isExisting(ConversationPage.leftPaneOverlay).should await app.client.isExisting(ConversationPage.leftPaneOverlay).should
.eventually.be.true; .eventually.be.true;
}); });

@ -44,11 +44,14 @@ module.exports = {
// channels // channels
joinOpenGroupButton: commonPage.divRoleButtonWithText('Join Open Group'), joinOpenGroupButton: commonPage.divRoleButtonWithText('Join Open Group'),
openGroupInputUrl: commonPage.textAreaWithPlaceholder('chat.getsession.org'), openGroupInputUrl: commonPage.textAreaWithPlaceholder('chat.getsession.org'),
sessionToastJoinOpenGroup: commonPage.toastWithText(
'Connecting to server...'
),
sessionToastJoinOpenGroupSuccess: commonPage.toastWithText( sessionToastJoinOpenGroupSuccess: commonPage.toastWithText(
'Successfully connected to new open group server' 'Successfully connected to open group'
), ),
sessionToastJoinOpenGroupAlreadyExist: commonPage.toastWithText( sessionToastJoinOpenGroupAlreadyExist: commonPage.toastWithText(
'You are already connected to this public channel' 'You are already connected to this open group'
), ),
rowOpenGroupConversationName: groupName => rowOpenGroupConversationName: groupName =>
commonPage.spanWithClassAndText( commonPage.spanWithClassAndText(

@ -476,10 +476,15 @@ export class LeftPaneMessageSection extends React.Component<Props, State> {
// Connect to server // Connect to server
try { try {
window.pushToast({
title: window.i18n('connectingToServer'),
id: 'connectToServer',
type: 'success',
});
await OpenGroup.join(serverUrl, async () => { await OpenGroup.join(serverUrl, async () => {
if (await OpenGroup.serverExists(serverUrl)) { if (await OpenGroup.serverExists(serverUrl)) {
window.pushToast({ window.pushToast({
title: window.i18n('connectingToServer'), title: window.i18n('connectToServerSuccess'),
id: 'connectToServer', id: 'connectToServer',
type: 'success', type: 'success',
}); });

@ -85,7 +85,7 @@ export async function snodeRpc(
params: any, params: any,
targetNode: Snode targetNode: Snode
): Promise<boolean | SnodeResponse> { ): Promise<boolean | SnodeResponse> {
const url = `https://${targetNode.ip}${targetNode.port}/storage_rpc/v1`; const url = `https://${targetNode.ip}:${targetNode.port}/storage_rpc/v1`;
// TODO: The jsonrpc and body field will be ignored on storage server // TODO: The jsonrpc and body field will be ignored on storage server
if (params.pubKey) { if (params.pubKey) {

Loading…
Cancel
Save