From 820dd382e134099e69b83e2719f87f7e4caa3263 Mon Sep 17 00:00:00 2001 From: vladikoff Date: Fri, 20 Apr 2018 12:02:39 -0400 Subject: [PATCH] fix(tests): make a signin test work --- tests/functional/lib/selectors.js | 3 ++- tests/functional/oauth_sign_in.js | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/functional/lib/selectors.js b/tests/functional/lib/selectors.js index 4101c22350..6b78d20b9d 100644 --- a/tests/functional/lib/selectors.js +++ b/tests/functional/lib/selectors.js @@ -169,7 +169,8 @@ module.exports = { }, SIGNIN_COMPLETE: { CONTINUE_BUTTON: '.btn-continue', - HEADER: '#fxa-sign-in-complete-header' + HEADER: '#fxa-sign-in-complete-header', + SERVICE_NAME: '.account-ready-service' }, SIGNIN_PASSWORD: { EMAIL: 'input[type=email]', diff --git a/tests/functional/oauth_sign_in.js b/tests/functional/oauth_sign_in.js index 04c0359d89..f2868c60c6 100644 --- a/tests/functional/oauth_sign_in.js +++ b/tests/functional/oauth_sign_in.js @@ -244,10 +244,17 @@ registerSuite('oauth signin', { .then(createUser(email, PASSWORD, {preVerified: true})) .then(openFxaFromRp('signin', { query: { - forceUA: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Mobile Safari/537.36' + client_id: 'd5d74070a481bc10', // eslint-disable-line camelcase + forceUA: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Mobile Safari/537.36', + // eslint-disable-next-line camelcase + keys_jwk: 'eyJrdHkiOiJFQyIsImtpZCI6Im9DNGFudFBBSFZRX1pmQ09RRUYycTRaQlZYblVNZ2xISGpVRzdtSjZHOEEiLCJjcnYiOi' + + 'JQLTI1NiIsIngiOiJDeUpUSjVwbUNZb2lQQnVWOTk1UjNvNTFLZVBMaEg1Y3JaQlkwbXNxTDk0IiwieSI6IkJCWDhfcFVZeHpTaldsdX' + + 'U5MFdPTVZwamIzTlpVRDAyN0xwcC04RW9vckEifQ', + redirect_uri: 'https://mozilla.github.io/notes/fxa/android-redirect.html', // eslint-disable-line camelcase + scope: 'profile https://identity.mozilla.com/apps/notes' } })) - .then(testElementTextInclude(selectors.SIGNIN.SUB_HEADER, '123done')) + .then(testElementTextInclude(selectors.SIGNIN.SUB_HEADER, 'notes')) .then(testUrlInclude('client_id=')) .then(testUrlInclude('state=')) @@ -261,15 +268,13 @@ registerSuite('oauth signin', { .then(testElementExists(selectors.SIGNIN_COMPLETE.HEADER)) .then(noSuchElement(selectors.SIGNIN_COMPLETE.CONTINUE_BUTTON)) // user sees the name of the RP, but cannot redirect - .then(testElementTextInclude(selectors.SIGNIN_COMPLETE.SERVICE_NAME, '123done')) + .then(testElementTextInclude(selectors.SIGNIN_COMPLETE.SERVICE_NAME, 'notes')) // switch to the original window .then(closeCurrentWindow()) .then(testElementExists(selectors.SIGNIN_COMPLETE.HEADER)) - .then(click(selectors.SIGNIN_COMPLETE.CONTINUE_BUTTON)) - - .then(testElementExists(selectors['123DONE'].AUTHENTICATED)); + .then(click(selectors.SIGNIN_COMPLETE.CONTINUE_BUTTON)); },