From a30771d65c1725f9e6de16934edc3a45dca41b98 Mon Sep 17 00:00:00 2001 From: Vijet Mahabaleshwar Date: Wed, 2 Sep 2020 22:29:40 -0700 Subject: [PATCH] Adds i18n config test to be used in widget PDV --- .../e2e/harness/start-custom-login-server.js | 16 +++++++++++--- .../test/e2e/harness/views/login.ejs | 12 +++++++++- .../test/e2e/page-objects/CustomLoginPage.js | 3 +++ .../test/e2e/specs/custom-login-page.js | 22 ++++++++++++++++--- .../oidc-middleware/test/e2e/util/util.js | 5 ++++- 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js b/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js index 5890abf43..c2178fdc7 100644 --- a/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js +++ b/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js @@ -12,9 +12,10 @@ const constants = require('../util/constants'); const util = require('../util/util'); +let options = {}; +let cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1'; -let cdnUrl='https://ok1static.oktacdn.com/assets/js/sdk/okta-signin-widget/3.0.0'; - +// This is used as PDV for widget after artifact promotion to CDN if(process.env.NPM_TARBALL_URL) { // Extract the version of sign-in widget from the NPM_TARBALL_URL variable // The variable is of the format https:/@okta/okta-signin-widget-3.0.6.tgz @@ -22,6 +23,14 @@ if(process.env.NPM_TARBALL_URL) { const i = url.lastIndexOf('-'); const version = url.substring(i + 1, url.length - 4); cdnUrl=`https://global.oktacdn.com/okta-signin-widget/${version}`; + + // We also test i18n assets on CDN + options.language = 'fr'; + options.i18n = { + fr: { + 'primaryauth.title': 'Connectez-vous à Acme', + } + } } console.log(`Using CDN url - ${cdnUrl}`); @@ -33,7 +42,8 @@ const serverOptions = { testing: { disableHttpsCheck: constants.OKTA_TESTING_DISABLEHTTPSCHECK }, - cdnUrl: cdnUrl + cdnUrl: cdnUrl, + options: options } console.log('serverOptions', serverOptions); diff --git a/packages/oidc-middleware/test/e2e/harness/views/login.ejs b/packages/oidc-middleware/test/e2e/harness/views/login.ejs index 25977ec9e..1cb58494c 100644 --- a/packages/oidc-middleware/test/e2e/harness/views/login.ejs +++ b/packages/oidc-middleware/test/e2e/harness/views/login.ejs @@ -13,8 +13,18 @@