|
| 1 | +/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. |
| 2 | + * |
| 3 | + * This software is licensed under the Apache License, Version 2.0 (the |
| 4 | + * "License") as published by the Apache Software Foundation. |
| 5 | + * |
| 6 | + * You may not use this file except in compliance with the License. You may |
| 7 | + * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | + * License for the specific language governing permissions and limitations |
| 13 | + * under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +/* |
| 17 | + * Imports |
| 18 | + */ |
| 19 | + |
| 20 | +import assert from "assert"; |
| 21 | +import puppeteer from "puppeteer"; |
| 22 | +import { |
| 23 | + clearBrowserCookiesWithoutAffectingConsole, |
| 24 | + clickOnProviderButton, |
| 25 | + getUserIdWithFetch, |
| 26 | + getLogoutButton, |
| 27 | + loginWithAuth0, |
| 28 | + setInputValues, |
| 29 | + submitForm, |
| 30 | + waitForSTElement, |
| 31 | + getPasswordlessDevice, |
| 32 | + setPasswordlessFlowType, |
| 33 | + getFeatureFlags, |
| 34 | + isReact16, |
| 35 | + assertProviders, |
| 36 | + setEnabledRecipes, |
| 37 | + clickOnProviderButtonWithoutWaiting, |
| 38 | + getGeneralError, |
| 39 | + backendBeforeEach, |
| 40 | +} from "../helpers"; |
| 41 | +import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants"; |
| 42 | +import { getThirdPartyTestCases } from "./thirdparty.test"; |
| 43 | +import { getPasswordlessTestCases } from "./passwordless.test"; |
| 44 | + |
| 45 | +/* |
| 46 | + * Tests. |
| 47 | + */ |
| 48 | +describe("SuperTokens Third Party Passwordless", function () { |
| 49 | + const signInUpPageLoadLogs = isReact16() |
| 50 | + ? ["ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO"] |
| 51 | + : [ |
| 52 | + "ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO", |
| 53 | + "ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO", |
| 54 | + ]; |
| 55 | + |
| 56 | + before(async function () { |
| 57 | + const features = await getFeatureFlags(); |
| 58 | + if (!features.includes("thirdpartypasswordless")) { |
| 59 | + this.skip(); |
| 60 | + } |
| 61 | + }); |
| 62 | + |
| 63 | + describe("Third Party specific", function () { |
| 64 | + getThirdPartyTestCases({ |
| 65 | + authRecipe: "thirdpartypasswordless", |
| 66 | + rid: "thirdpartypasswordless", |
| 67 | + logId: "THIRDPARTYPASSWORDLESS", |
| 68 | + signInUpPageLoadLogs, |
| 69 | + thirdPartySignInUpLog: "THIRD_PARTY_SIGN_IN_AND_UP", |
| 70 | + }); |
| 71 | + }); |
| 72 | +}); |
0 commit comments