From f607cb27027d0f5180ac69b7a040672502912ca2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 1 Nov 2018 17:55:48 -0600 Subject: [PATCH 1/2] Fix the registration process to handle m.login.terms auth --- src/usecases/signup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/usecases/signup.js b/src/usecases/signup.js index b715e111a1..dfd97a975f 100644 --- a/src/usecases/signup.js +++ b/src/usecases/signup.js @@ -59,6 +59,12 @@ module.exports = async function signup(session, username, password, homeserver) //confirm dialog saying you cant log back in without e-mail const continueButton = await session.waitAndQuery('.mx_QuestionDialog button.mx_Dialog_primary'); await continueButton.click(); + + //find the privacy policy checkbox and check it + //this should automatically move ahead with registration + const policyCheckbox = await session.waitAndQuery('.mx_Login_box input[type="checkbox"]'); + await policyCheckbox.click(); + //wait for registration to finish so the hash gets set //onhashchange better? await session.delay(2000); From d57a56d7a8e873b57dababd511b103d61b94b593 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 1 Nov 2018 18:20:55 -0600 Subject: [PATCH 2/2] There is no more server notices invite on signup --- src/scenario.js | 2 -- src/usecases/consent.js | 27 ---------------------- src/usecases/server-notices-consent.js | 31 -------------------------- src/usecases/signup.js | 1 - 4 files changed, 61 deletions(-) delete mode 100644 src/usecases/consent.js delete mode 100644 src/usecases/server-notices-consent.js diff --git a/src/scenario.js b/src/scenario.js index 2fd52de679..5b9d1f2906 100644 --- a/src/scenario.js +++ b/src/scenario.js @@ -17,7 +17,6 @@ limitations under the License. const {range} = require('./util'); const signup = require('./usecases/signup'); -const acceptServerNoticesInviteAndConsent = require('./usecases/server-notices-consent'); const roomDirectoryScenarios = require('./scenarios/directory'); const lazyLoadingScenarios = require('./scenarios/lazy-loading'); const e2eEncryptionScenarios = require('./scenarios/e2e-encryption'); @@ -26,7 +25,6 @@ module.exports = async function scenario(createSession, restCreator, runningOnTr async function createUser(username) { const session = await createSession(username); await signup(session, session.username, 'testtest', session.hsUrl); - await acceptServerNoticesInviteAndConsent(session); return session; } diff --git a/src/usecases/consent.js b/src/usecases/consent.js deleted file mode 100644 index b4a6289fca..0000000000 --- a/src/usecases/consent.js +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2018 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -const assert = require('assert'); - -module.exports = async function acceptTerms(session) { - const reviewTermsButton = await session.waitAndQuery('.mx_QuestionDialog button.mx_Dialog_primary'); - const termsPagePromise = session.waitForNewPage(); - await reviewTermsButton.click(); - const termsPage = await termsPagePromise; - const acceptButton = await termsPage.$('input[type=submit]'); - await acceptButton.click(); - await session.delay(1000); //TODO yuck, timers -} diff --git a/src/usecases/server-notices-consent.js b/src/usecases/server-notices-consent.js deleted file mode 100644 index 25c3bb3bd5..0000000000 --- a/src/usecases/server-notices-consent.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2018 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -const assert = require('assert'); -const acceptInvite = require("./accept-invite") -module.exports = async function acceptServerNoticesInviteAndConsent(session) { - await acceptInvite(session, "Server Notices"); - session.log.step(`accepts terms & conditions`); - const consentLink = await session.waitAndQuery(".mx_EventTile_body a"); - const termsPagePromise = session.waitForNewPage(); - await consentLink.click(); - const termsPage = await termsPagePromise; - const acceptButton = await termsPage.$('input[type=submit]'); - await acceptButton.click(); - await session.delay(1000); //TODO yuck, timers - await termsPage.close(); - session.log.done(); -} diff --git a/src/usecases/signup.js b/src/usecases/signup.js index dfd97a975f..bf2a512a91 100644 --- a/src/usecases/signup.js +++ b/src/usecases/signup.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -const acceptTerms = require('./consent'); const assert = require('assert'); module.exports = async function signup(session, username, password, homeserver) {