From 70990a60ba379af53193ea5847f086818d4fd803 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 4 Jun 2020 08:57:39 +1000 Subject: [PATCH] fix open groups and link device test --- integration_test/common.js | 9 +++++---- integration_test/link_device_test.js | 2 +- integration_test/message_functions_test.js | 3 --- integration_test/open_group_test.js | 6 +++--- integration_test/page-objects/conversation.page.js | 2 -- integration_test/sender_keys_test.js | 8 +------- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/integration_test/common.js b/integration_test/common.js index e685ad298..4cd7474e6 100644 --- a/integration_test/common.js +++ b/integration_test/common.js @@ -322,10 +322,11 @@ module.exports = { }, async addFriendToNewClosedGroup(members, useSenderKeys) { - await app.client.element(ConversationPage.globeButtonSection).click(); - await app.client.element(ConversationPage.createClosedGroupButton).click(); const [app, ...others] = members; + await app.client.element(ConversationPage.conversationButtonSection).click(); + await app.client.element(ConversationPage.createClosedGroupButton).click(); + await this.setValueWrapper( app, ConversationPage.closedGroupNameTextarea, @@ -500,7 +501,7 @@ module.exports = { await app1.client.waitForExist( ConversationPage.noPairedDeviceMessage, - 2000 + 5000 ); await app1.client.element(ConversationPage.linkDeviceButton).isEnabled() .should.eventually.be.true; @@ -619,7 +620,7 @@ module.exports = { }, async joinOpenGroup(app, openGroupUrl, name) { - await app.client.element(ConversationPage.globeButtonSection).click(); + await app.client.element(ConversationPage.conversationButtonSection).click(); await app.client.element(ConversationPage.joinOpenGroupButton).click(); await this.setValueWrapper( diff --git a/integration_test/link_device_test.js b/integration_test/link_device_test.js index 5c6611bc2..2c7ac9505 100644 --- a/integration_test/link_device_test.js +++ b/integration_test/link_device_test.js @@ -45,7 +45,7 @@ describe('Link Device', function() { it('linkDevice:sync no groups, closed group, nor open groups', async () => { await common.linkApp2ToApp(app, app2, common.TEST_PUBKEY1); - await common.timeout(5000); + await common.timeout(10000); // get logs at this stage (getRenderProcessLogs() clears the app logs) const secondaryRenderLogs = await app2.client.getRenderProcessLogs(); diff --git a/integration_test/message_functions_test.js b/integration_test/message_functions_test.js index 3de9cce25..b08f88f30 100644 --- a/integration_test/message_functions_test.js +++ b/integration_test/message_functions_test.js @@ -30,9 +30,6 @@ describe('Message Functions', function() { }); it('can send attachment', async () => { - await app.client.element(ConversationPage.globeButtonSection).click(); - await app.client.element(ConversationPage.createClosedGroupButton).click(); - // create group and add new friend await common.addFriendToNewClosedGroup([app, app2], false); diff --git a/integration_test/open_group_test.js b/integration_test/open_group_test.js index 8f319d491..b1cf3f814 100644 --- a/integration_test/open_group_test.js +++ b/integration_test/open_group_test.js @@ -7,7 +7,7 @@ const ConversationPage = require('./page-objects/conversation.page'); describe('Open groups', function() { let app; - this.timeout(30000); + this.timeout(40000); this.slow(15000); beforeEach(async () => { @@ -39,7 +39,7 @@ describe('Open groups', function() { ); // adding a second time the same open group - await app.client.element(ConversationPage.globeButtonSection).click(); + await app.client.element(ConversationPage.conversationButtonSection).click(); await app.client.element(ConversationPage.joinOpenGroupButton).click(); await common.setValueWrapper( @@ -64,7 +64,7 @@ describe('Open groups', function() { it('openGroup: can send message to open group', async () => { // join dev-chat group - await app.client.element(ConversationPage.globeButtonSection).click(); + await app.client.element(ConversationPage.conversationButtonSection).click(); await app.client.element(ConversationPage.joinOpenGroupButton).click(); await common.setValueWrapper( diff --git a/integration_test/page-objects/conversation.page.js b/integration_test/page-objects/conversation.page.js index 64515b91d..4a0b2394f 100644 --- a/integration_test/page-objects/conversation.page.js +++ b/integration_test/page-objects/conversation.page.js @@ -40,8 +40,6 @@ module.exports = { '//*[contains(@class, "session-modal")]//div[contains(string(), "Delete") and contains(@class, "session-button")]', // channels - globeButtonSection: - '//*[contains(@class,"session-icon-button") and .//*[contains(@class, "globe")]]', joinOpenGroupButton: commonPage.divRoleButtonWithText('Join Open Group'), openGroupInputUrl: commonPage.textAreaWithPlaceholder('chat.getsession.org'), sessionToastJoinOpenGroupSuccess: commonPage.toastWithText( diff --git a/integration_test/sender_keys_test.js b/integration_test/sender_keys_test.js index 446d19fce..836af43c2 100644 --- a/integration_test/sender_keys_test.js +++ b/integration_test/sender_keys_test.js @@ -39,15 +39,12 @@ async function makeFriendsPlusMessage(app, [app2, pubkey]) { ); // Click away so we can call this function again - await app.client.element(ConversationPage.globeButtonSection).click(); + await app.client.element(ConversationPage.conversationButtonSection).click(); } async function testTwoMembers() { const [app, app2] = await common.startAppsAsFriends(); - await app.client.element(ConversationPage.globeButtonSection).click(); - await app.client.element(ConversationPage.createClosedGroupButton).click(); - const useSenderKeys = true; // create group and add new friend @@ -106,9 +103,6 @@ async function testThreeMembers() { const useSenderKeys = true; - await app1.client.element(ConversationPage.globeButtonSection).click(); - await app1.client.element(ConversationPage.createClosedGroupButton).click(); - // 3. Add all three to the group await common.addFriendToNewClosedGroup([app1, app2, app3], useSenderKeys);