From 35cbb4cdd61f758d2eec45d2b14fc7eaf7931e8b Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 14 May 2020 09:51:11 +1000 Subject: [PATCH] fix linkDevice test --- integration_test/closed_group_test.js | 3 --- integration_test/common.js | 18 ++++++++---------- integration_test/message_functions_test.js | 3 --- integration_test/page-objects/settings.page.js | 2 ++ 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/integration_test/closed_group_test.js b/integration_test/closed_group_test.js index 12345b3e5..04d60663d 100644 --- a/integration_test/closed_group_test.js +++ b/integration_test/closed_group_test.js @@ -25,9 +25,6 @@ describe('Closed groups', function() { }); it('closedGroup: can create a closed group with a friend and send/receive a message', 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); diff --git a/integration_test/common.js b/integration_test/common.js index ef1d0912d..18fce26df 100644 --- a/integration_test/common.js +++ b/integration_test/common.js @@ -322,6 +322,9 @@ module.exports = { }, async addFriendToNewClosedGroup(app, app2) { + await app.client.element(ConversationPage.globeButtonSection).click(); + await app.client.element(ConversationPage.createClosedGroupButton).click(); + await this.setValueWrapper( app, ConversationPage.closedGroupNameTextarea, @@ -425,17 +428,17 @@ module.exports = { app1Pubkey ); await app2.client.element(RegistrationPage.linkDeviceTriggerButton).click(); - await app1.client.waitForExist(RegistrationPage.toastWrapper, 7000); - let secretWordsapp1 = await app1.client - .element(RegistrationPage.secretToastDescription) + await app1.client.waitForExist(SettingsPage.secretWordsTextInDialog, 7000); + const secretWordsapp1 = await app1.client + .element(SettingsPage.secretWordsTextInDialog) .getText(); - secretWordsapp1 = secretWordsapp1.split(': ')[1]; - await app2.client.waitForExist(RegistrationPage.toastWrapper, 6000); await app2.client .element(RegistrationPage.secretToastDescription) .getText() .should.eventually.be.equal(secretWordsapp1); + + await app1.client.element(ConversationPage.allowPairingButton).click(); await app1.client.element(ConversationPage.okButton).click(); // validate device paired in settings list with correct secrets @@ -545,11 +548,6 @@ module.exports = { ); }, - logsContainsString: async (app1, str) => { - const logs = JSON.stringify(await app1.client.getRenderProcessLogs()); - return logs.includes(str); - }, - async startStubSnodeServer() { if (!this.stubSnode) { this.messages = {}; diff --git a/integration_test/message_functions_test.js b/integration_test/message_functions_test.js index 469171f2d..8732ed321 100644 --- a/integration_test/message_functions_test.js +++ b/integration_test/message_functions_test.js @@ -28,9 +28,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); diff --git a/integration_test/page-objects/settings.page.js b/integration_test/page-objects/settings.page.js index 3adf33f05..33a56d027 100644 --- a/integration_test/page-objects/settings.page.js +++ b/integration_test/page-objects/settings.page.js @@ -17,4 +17,6 @@ module.exports = { // Confirm is a boolean. Selects confirmation input passwordSetModalInput: _confirm => `//input[@id = 'password-modal-input${_confirm ? '-confirm' : ''}']`, + + secretWordsTextInDialog: '//div[@class="device-pairing-dialog__secret-words"]/div[@class="subtle"]', };