@bigbinary/neeto-playwright-commons 1.7.0 → 1.7.1

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.
package/index.d.ts CHANGED
@@ -19,10 +19,9 @@ interface ExecuteRecursivelyParams {
19
19
  }
20
20
  type ExecuteRecursively = (params: ExecuteRecursivelyParams) => Promise<void>;
21
21
  interface VerifySuccessToastParams {
22
- message?: string;
22
+ message: string;
23
23
  closeAfterVerification: boolean;
24
24
  }
25
- type VerifySuccessToast = (params: VerifySuccessToastParams) => Promise<void>;
26
25
  type BasicTypesInterface = Record<string, number | string | boolean>;
27
26
  type HttpMethods = "get" | "patch" | "post" | "put" | "delete";
28
27
  interface ApiRequestProps {
@@ -47,7 +46,7 @@ declare class CustomCommands {
47
46
  interceptMultipleResponses: ({ responseUrl, times, baseUrl, customPageContext, timeout, }?: Partial<InterceptMultipleResponsesParams>) => Promise<Response[]>;
48
47
  private recursiveMethod;
49
48
  executeRecursively: ExecuteRecursively;
50
- verifySuccessToast: VerifySuccessToast;
49
+ verifySuccessToast: ({ message, closeAfterVerification, }?: Partial<VerifySuccessToastParams>) => Promise<void>;
51
50
  reloadAndWait: (requestCount: number) => Promise<void>;
52
51
  apiRequest: ApiRequest;
53
52
  verifyFieldValue: VerifyFieldValue;
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import test, { expect, test as test$1, defineConfig, devices } from '@playwright/test';
2
2
  import * as require$$0 from 'fs';
3
3
  import require$$0__default from 'fs';
4
+ import { isEmpty as isEmpty$1, isNil, isNotNil, mergeDeepLeft, mergeAll, mergeLeft } from 'ramda';
4
5
  import { faker } from '@faker-js/faker';
5
- import { isNil, isNotNil, mergeDeepLeft, mergeAll, mergeLeft } from 'ramda';
6
6
  import MailosaurClient from 'mailosaur';
7
7
  import dayjs from 'dayjs';
8
8
  import require$$2 from 'os';
@@ -175,8 +175,8 @@ class CustomCommands {
175
175
  const startTime = Date.now();
176
176
  await this.recursiveMethod(callback, condition, timeout, startTime);
177
177
  };
178
- this.verifySuccessToast = async ({ message = null, closeAfterVerification = true, }) => {
179
- if (message) {
178
+ this.verifySuccessToast = async ({ message = "", closeAfterVerification = true, } = {}) => {
179
+ if (isEmpty$1(message)) {
180
180
  await expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message);
181
181
  }
182
182
  else {