e2e-mail 0.0.4 → 0.0.6
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,4 +1,6 @@
|
|
|
1
|
+
import { expect, TestType } from '@playwright/test';
|
|
1
2
|
import { MailFixtures } from './types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
3
|
+
export type { MailFixtures };
|
|
4
|
+
export declare const test: TestType<MailFixtures, {}>;
|
|
5
|
+
export { expect };
|
|
4
6
|
//# sourceMappingURL=playwright.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../../src/playwright/playwright.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../../src/playwright/playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,YAAY,EAAE,YAAY,EAAE,CAAC;AAK7B,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,YAAY,EAAE,EAAE,CAuC1C,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -4,20 +4,16 @@ type Message = components["schemas"]["Message-message.read"];
|
|
|
4
4
|
export type MailFixtures = {
|
|
5
5
|
/**
|
|
6
6
|
* Initialize mailbox session
|
|
7
|
-
* @param address Email address
|
|
8
|
-
* @param password Account password
|
|
9
7
|
*/
|
|
10
|
-
initializeMailbox: (address: string, password: string) => void
|
|
8
|
+
initializeMailbox: (address: string, password: string) => Promise<void>;
|
|
11
9
|
/**
|
|
12
10
|
* Get most recent inbox match for an existing or new mail account
|
|
13
|
-
* @param filters Optional search filters
|
|
14
|
-
* @param options Configuration for message polling
|
|
15
11
|
*/
|
|
16
12
|
searchMailbox: (filters?: SearchFilters, options?: PollingOptions) => Promise<Message>;
|
|
17
13
|
/**
|
|
18
14
|
* Delete the account mailbox and all its emails from the server
|
|
19
15
|
*/
|
|
20
|
-
removeMailbox: () => void
|
|
16
|
+
removeMailbox: () => Promise<void>;
|
|
21
17
|
};
|
|
22
18
|
export {};
|
|
23
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/playwright/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,KAAK,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG;IACzB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/playwright/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,KAAK,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;OAEG;IACH,aAAa,EAAE,CACb,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,cAAc,KACrB,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC,CAAC"}
|
package/dist/playwright.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.js","sources":["../src/playwright/playwright.ts"],"sourcesContent":["import { test as base } from \"@playwright/test\"
|
|
1
|
+
{"version":3,"file":"playwright.js","sources":["../src/playwright/playwright.ts"],"sourcesContent":["import { test as base, expect, type TestType } from \"@playwright/test\"; // 1. Import TestType\nimport { E2EMailClient } from \"../core/mailtm\";\nimport type { MailFixtures } from \"./types\";\n\nexport type { MailFixtures };\n\nlet mailClient: E2EMailClient | undefined;\n\n// 2. Explicitly type the \"test\" constant using TestType<MailFixtures>\nexport const test: TestType<MailFixtures, {}> = base.extend<MailFixtures>({\n initializeMailbox: async ({}, use) => {\n await use(async (address, password) => {\n mailClient = new E2EMailClient(address, password);\n await mailClient.initialize();\n });\n },\n removeMailbox: async ({}, use) => {\n await use(async () => {\n if (!mailClient) {\n throw new Error(\n \"Mailbox client not initialized. Call initializeMailbox() first.\",\n );\n }\n await mailClient.dispose();\n });\n },\n searchMailbox: async ({ page }, use) => {\n await use(async (filters, options = {}) => {\n const {\n timeout = test.info().project.use.actionTimeout ?? 4000,\n autoDelete,\n } = options;\n if (!mailClient) {\n throw new Error(\n \"Mailbox client not initialized. Call initializeMailbox() first.\",\n );\n }\n const message = await mailClient.pollMessages(filters, {\n timeout,\n autoDelete,\n });\n const html = message.html?.[0] ?? message.html ?? \"\";\n if (html) {\n await page.setContent(String(html));\n }\n return message;\n });\n },\n});\n\nexport { expect };\n"],"names":["mailClient","test","base","use","address","password","E2EMailClient","page","filters","options","timeout","autoDelete","message","html","_a"],"mappings":";;;AAMA,IAAIA;AAGG,MAAMC,IAAmCC,EAAK,OAAqB;AAAA,EACxE,mBAAmB,OAAO,CAAA,GAAIC,MAAQ;AACpC,UAAMA,EAAI,OAAOC,GAASC,MAAa;AACrC,MAAAL,IAAa,IAAIM,EAAcF,GAASC,CAAQ,GAChD,MAAML,EAAW,WAAA;AAAA,IACnB,CAAC;AAAA,EACH;AAAA,EACA,eAAe,OAAO,CAAA,GAAIG,MAAQ;AAChC,UAAMA,EAAI,YAAY;AACpB,UAAI,CAACH;AACH,cAAM,IAAI;AAAA,UACR;AAAA,QAAA;AAGJ,YAAMA,EAAW,QAAA;AAAA,IACnB,CAAC;AAAA,EACH;AAAA,EACA,eAAe,OAAO,EAAE,MAAAO,EAAA,GAAQJ,MAAQ;AACtC,UAAMA,EAAI,OAAOK,GAASC,IAAU,CAAA,MAAO;;AACzC,YAAM;AAAA,QACJ,SAAAC,IAAUT,EAAK,KAAA,EAAO,QAAQ,IAAI,iBAAiB;AAAA,QACnD,YAAAU;AAAA,MAAA,IACEF;AACJ,UAAI,CAACT;AACH,cAAM,IAAI;AAAA,UACR;AAAA,QAAA;AAGJ,YAAMY,IAAU,MAAMZ,EAAW,aAAaQ,GAAS;AAAA,QACrD,SAAAE;AAAA,QACA,YAAAC;AAAA,MAAA,CACD,GACKE,MAAOC,IAAAF,EAAQ,SAAR,gBAAAE,EAAe,OAAMF,EAAQ,QAAQ;AAClD,aAAIC,KACF,MAAMN,EAAK,WAAW,OAAOM,CAAI,CAAC,GAE7BD;AAAA,IACT,CAAC;AAAA,EACH;AACF,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "e2e-mail",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "A zero-config solution for testing email in major testing frameworks.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@playwright/test": "^1.49.0",
|
|
43
43
|
"@types/node": "^25.9.2",
|
|
44
44
|
"cypress": "^15.17.0",
|
|
45
|
-
"e2e-mail": "^0.0.
|
|
45
|
+
"e2e-mail": "^0.0.5",
|
|
46
46
|
"openapi-fetch": "^0.17.0",
|
|
47
47
|
"openapi-typescript": "^7.13.0",
|
|
48
48
|
"tsx": "^4.22.4",
|