@red-hat-developer-hub/e2e-test-utils 1.1.29 → 1.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { UIhelper } from "./ui-helper.js";
2
- import { generateSync } from "otplib";
2
+ import { authenticator } from "otplib";
3
3
  import { test, expect } from "@playwright/test";
4
4
  import { SETTINGS_PAGE_COMPONENTS } from "../page-objects/page-obj.js";
5
5
  import { UI_HELPER_ELEMENTS } from "../page-objects/global-obj.js";
@@ -177,11 +177,11 @@ export class LoginHelper {
177
177
  if (!secret) {
178
178
  throw new Error("Invalid User ID");
179
179
  }
180
- return generateSync({ secret });
180
+ return authenticator.generate(secret);
181
181
  }
182
182
  getGoogle2FAOTP() {
183
183
  const secret = process.env.GOOGLE_2FA_SECRET;
184
- return generateSync({ secret });
184
+ return authenticator.generate(secret);
185
185
  }
186
186
  async keycloakLogin(username, password) {
187
187
  await this.page.goto("/");
@@ -247,7 +247,7 @@ export class LoginHelper {
247
247
  .locator("[type='submit'][value='Sign in']:not(webauthn-status *)")
248
248
  .first()
249
249
  .click({ timeout: 5000 });
250
- const twofactorcode = generateSync({ secret: twofactor });
250
+ const twofactorcode = authenticator.generate(twofactor);
251
251
  await popup.locator("#app_totp").click({ timeout: 5000 });
252
252
  await popup.locator("#app_totp").fill(twofactorcode, { timeout: 5000 });
253
253
  await popup.waitForEvent("close", { timeout: 20000 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/e2e-test-utils",
3
- "version": "1.1.29",
3
+ "version": "1.1.30",
4
4
  "description": "Test utilities for RHDH E2E tests",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -114,7 +114,7 @@
114
114
  "js-yaml": "4.1.1",
115
115
  "lodash.clonedeepwith": "4.5.0",
116
116
  "lodash.mergewith": "4.6.2",
117
- "otplib": "13.4.0",
117
+ "otplib": "12.0.1",
118
118
  "prettier": "3.8.1",
119
119
  "proper-lockfile": "4.1.2",
120
120
  "typescript": "6.0.2",