@bigbinary/neeto-playwright-commons 1.3.0 → 1.3.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.cjs.js +84 -3
- package/index.cjs.js.map +1 -1
- package/index.d.ts +4 -14
- package/index.js +83 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as _playwright_test from '@playwright/test';
|
|
2
2
|
import { Page, APIRequestContext, Response, APIResponse, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions } from '@playwright/test';
|
|
3
|
+
import * as playwright_test from 'playwright/test';
|
|
4
|
+
import * as playwright_i18next_fixture from 'playwright-i18next-fixture';
|
|
3
5
|
|
|
4
6
|
interface InterceptMultipleResponsesParams {
|
|
5
7
|
responseUrl: string;
|
|
@@ -66,19 +68,7 @@ declare const generateStagingData: (product?: string) => {
|
|
|
66
68
|
email: string;
|
|
67
69
|
};
|
|
68
70
|
|
|
69
|
-
declare const
|
|
70
|
-
options: {
|
|
71
|
-
debug: boolean;
|
|
72
|
-
fallbackLng: string;
|
|
73
|
-
resources: {
|
|
74
|
-
en: {
|
|
75
|
-
translation: Record<string, unknown>;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
cache: boolean;
|
|
80
|
-
auto: boolean;
|
|
81
|
-
};
|
|
71
|
+
declare const i18nFixture: playwright_test.Fixtures<playwright_i18next_fixture.I18nPlaywrightFixture, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions, playwright_test.PlaywrightTestArgs & playwright_test.PlaywrightTestOptions, playwright_test.PlaywrightWorkerArgs & playwright_test.PlaywrightWorkerOptions>;
|
|
82
72
|
|
|
83
73
|
interface CreateOrganizationProps {
|
|
84
74
|
email: string;
|
|
@@ -382,4 +372,4 @@ interface Overrides {
|
|
|
382
372
|
}
|
|
383
373
|
declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
|
|
384
374
|
|
|
385
|
-
export { BASE_URL, CHAT_WIDGET_SELECTORS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, ENVIRONMENT, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, IS_STAGING_ENV, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MERGE_TAGS_SELECTORS, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OrganizationPage, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, STORAGE_STATE, TAGS_SELECTORS, clearCredentials, commands, definePlaywrightConfig, generateStagingData, hyphenize,
|
|
375
|
+
export { BASE_URL, CHAT_WIDGET_SELECTORS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, ENVIRONMENT, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, IS_STAGING_ENV, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MERGE_TAGS_SELECTORS, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OrganizationPage, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, STORAGE_STATE, TAGS_SELECTORS, clearCredentials, commands, definePlaywrightConfig, generateStagingData, hyphenize, i18nFixture, initializeCredentials, joinHyphenCase, joinString, login, loginWithoutSSO, readFileSyncIfExists, readTranslations, updateCredentials, writeDataToFile };
|
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import require$$0$3 from 'stream';
|
|
|
8
8
|
import require$$0$4 from 'events';
|
|
9
9
|
import { mergeDeepLeft, mergeAll } from 'ramda';
|
|
10
10
|
import dayjs from 'dayjs';
|
|
11
|
+
import require$$0$5 from 'i18next';
|
|
11
12
|
import require$$3 from 'crypto';
|
|
12
13
|
|
|
13
14
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -6950,7 +6951,86 @@ const generateStagingData = (product = "invoice") => {
|
|
|
6950
6951
|
};
|
|
6951
6952
|
};
|
|
6952
6953
|
|
|
6953
|
-
|
|
6954
|
+
var __create = Object.create;
|
|
6955
|
+
var __defProp = Object.defineProperty;
|
|
6956
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6957
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6958
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6959
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6960
|
+
var __export = (target, all) => {
|
|
6961
|
+
for (var name in all)
|
|
6962
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6963
|
+
};
|
|
6964
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6965
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
6966
|
+
for (let key of __getOwnPropNames(from))
|
|
6967
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
6968
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
6969
|
+
}
|
|
6970
|
+
return to;
|
|
6971
|
+
};
|
|
6972
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
6973
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
6974
|
+
mod
|
|
6975
|
+
));
|
|
6976
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
6977
|
+
|
|
6978
|
+
// src/index.ts
|
|
6979
|
+
var src_exports = {};
|
|
6980
|
+
__export(src_exports, {
|
|
6981
|
+
createI18nFixture: () => createI18nFixture,
|
|
6982
|
+
getI18nInstance: () => getI18nInstance,
|
|
6983
|
+
initI18n: () => initI18n
|
|
6984
|
+
});
|
|
6985
|
+
var dist = __toCommonJS(src_exports);
|
|
6986
|
+
|
|
6987
|
+
// src/i18n.ts
|
|
6988
|
+
var import_i18next = __toESM(require$$0$5);
|
|
6989
|
+
var storedI18n;
|
|
6990
|
+
async function initI18n({
|
|
6991
|
+
plugins,
|
|
6992
|
+
options,
|
|
6993
|
+
cache
|
|
6994
|
+
}) {
|
|
6995
|
+
if (!cache || !storedI18n || !storedI18n.isInitialized) {
|
|
6996
|
+
const i18n2 = plugins.reduce(
|
|
6997
|
+
(i18n3, plugin) => i18n3 = i18n3.use(plugin),
|
|
6998
|
+
import_i18next.default.createInstance()
|
|
6999
|
+
);
|
|
7000
|
+
await i18n2.init(options);
|
|
7001
|
+
storedI18n = i18n2;
|
|
7002
|
+
}
|
|
7003
|
+
return storedI18n;
|
|
7004
|
+
}
|
|
7005
|
+
function getI18nInstance() {
|
|
7006
|
+
if (!storedI18n) {
|
|
7007
|
+
throw new Error("No i18n instance initialized");
|
|
7008
|
+
}
|
|
7009
|
+
return storedI18n;
|
|
7010
|
+
}
|
|
7011
|
+
|
|
7012
|
+
// src/fixture.ts
|
|
7013
|
+
var createI18nFixture = ({
|
|
7014
|
+
plugins = [],
|
|
7015
|
+
options = {},
|
|
7016
|
+
cache = true,
|
|
7017
|
+
auto = true
|
|
7018
|
+
}) => {
|
|
7019
|
+
return {
|
|
7020
|
+
i18n: [
|
|
7021
|
+
async ({}, use) => {
|
|
7022
|
+
const i18nInitialized = await initI18n({ plugins, options, cache });
|
|
7023
|
+
await use(i18nInitialized);
|
|
7024
|
+
},
|
|
7025
|
+
{ auto }
|
|
7026
|
+
],
|
|
7027
|
+
t: async ({ i18n: i18n2 }, use) => {
|
|
7028
|
+
await use(i18n2.t);
|
|
7029
|
+
}
|
|
7030
|
+
};
|
|
7031
|
+
};
|
|
7032
|
+
|
|
7033
|
+
const i18nFixture = dist.createI18nFixture({
|
|
6954
7034
|
// i18n configuration options
|
|
6955
7035
|
options: {
|
|
6956
7036
|
debug: false,
|
|
@@ -6963,7 +7043,7 @@ const i18n = {
|
|
|
6963
7043
|
// Run as auto fixture to be available through all tests by getI18nInstance()
|
|
6964
7044
|
// Default: true
|
|
6965
7045
|
auto: true,
|
|
6966
|
-
};
|
|
7046
|
+
});
|
|
6967
7047
|
|
|
6968
7048
|
const BASE_URL = "/api/v1";
|
|
6969
7049
|
const ROUTES = {
|
|
@@ -7747,5 +7827,5 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
7747
7827
|
});
|
|
7748
7828
|
};
|
|
7749
7829
|
|
|
7750
|
-
export { BASE_URL, CHAT_WIDGET_SELECTORS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, ENVIRONMENT, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, IS_STAGING_ENV, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MERGE_TAGS_SELECTORS, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OrganizationPage, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, STORAGE_STATE, TAGS_SELECTORS, clearCredentials, commands, definePlaywrightConfig, generateStagingData, hyphenize,
|
|
7830
|
+
export { BASE_URL, CHAT_WIDGET_SELECTORS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, ENVIRONMENT, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, IS_STAGING_ENV, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MERGE_TAGS_SELECTORS, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OrganizationPage, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, STORAGE_STATE, TAGS_SELECTORS, clearCredentials, commands, definePlaywrightConfig, generateStagingData, hyphenize, i18nFixture, initializeCredentials, joinHyphenCase, joinString, login, loginWithoutSSO, readFileSyncIfExists, readTranslations, updateCredentials, writeDataToFile };
|
|
7751
7831
|
//# sourceMappingURL=index.js.map
|