proxymail-qa 0.13.0 → 0.14.0

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/README.md CHANGED
@@ -21,7 +21,8 @@ it. Then:
21
21
  - group tests into a run whose report says which test each email came from
22
22
 
23
23
  Checkout results, offers given twice, unsubscribing, consent, welcome series,
24
- the marketing checks and the spam score are in
24
+ the marketing checks, the spam score and a site's journey (with its five
25
+ good-practice checks) are in
25
26
  [Labs](https://proxymail.qa/docs/labs) for now: the key's creator switches
26
27
  them on in the app under Account settings → Labs. Until then those methods
27
28
  throw with a 403 that says so, and `checkEmail` leaves those checks out.
@@ -1,4 +1,4 @@
1
- export declare const CYPRESS_METHODS: readonly ["project", "updateProject", "customFields", "saveCustomField", "deleteCustomField", "setCustomFieldEnabled", "setStandardField", "sites", "addSite", "setMultiStep", "saveSignupScreen", "removeSignupScreen", "createAddress", "formValues", "listAddresses", "signInAccount", "totpCode", "listFormSections", "signupStarters", "getFormSection", "followsFormat", "signupForms", "signupForm", "saveSignupForm", "deleteSignupForm", "signupFormCode", "signupFormTest", "cleanupList", "markDevHost", "getAddress", "checkOutAccount", "extendCheckout", "returnAccount", "updateAddress", "deleteAddress", "markSubmitted", "waitForCode", "waitForLink", "messages", "countEmails", "checkEmail", "expectNoEmail", "markUnsubscribed", "markResubscribed", "checkUnsubscribe", "consent", "recordConsent", "recordCouponResult", "checkSequence", "offers", "checkDelivery", "variants", "nameVariants", "passwordVariants", "flowChecks", "setPassword", "savedPassword", "getRun", "runReport", "listRuns", "addRunNote"];
1
+ export declare const CYPRESS_METHODS: readonly ["project", "updateProject", "customFields", "saveCustomField", "deleteCustomField", "setCustomFieldEnabled", "setStandardField", "sites", "addSite", "setMultiStep", "saveSignupScreen", "removeSignupScreen", "createAddress", "formValues", "listAddresses", "signInAccount", "totpCode", "listFormSections", "signupStarters", "getFormSection", "followsFormat", "signupForms", "signupForm", "saveSignupForm", "deleteSignupForm", "signupFormCode", "signupFormTest", "cleanupList", "journey", "markDevHost", "getAddress", "checkOutAccount", "extendCheckout", "returnAccount", "updateAddress", "deleteAddress", "markSubmitted", "waitForCode", "waitForLink", "messages", "countEmails", "checkEmail", "expectNoEmail", "markUnsubscribed", "markResubscribed", "checkUnsubscribe", "consent", "recordConsent", "recordCouponResult", "checkSequence", "offers", "checkDelivery", "variants", "nameVariants", "passwordVariants", "flowChecks", "setPassword", "savedPassword", "getRun", "runReport", "listRuns", "addRunNote"];
2
2
  export type CypressMethod = (typeof CYPRESS_METHODS)[number];
3
3
  export declare const NOT_IN_CYPRESS: readonly ["forTest", "withAccount", "startRun", "finishRun", "recordTest", "recordTestTotals"];
4
4
  export declare const CYPRESS_TASK = "proxymail-qa";
@@ -31,6 +31,7 @@ export const CYPRESS_METHODS = [
31
31
  'signupFormCode',
32
32
  'signupFormTest',
33
33
  'cleanupList',
34
+ 'journey',
34
35
  'markDevHost',
35
36
  'getAddress',
36
37
  'checkOutAccount',
package/dist/index.d.ts CHANGED
@@ -624,7 +624,7 @@ export interface SharedSender {
624
624
  fix: string;
625
625
  docs: string;
626
626
  }
627
- export type NothingArrivedCase = 'nothing_arrived' | 'no_match' | 'turned_away' | 'already_used';
627
+ export type NothingArrivedCase = 'nothing_arrived' | 'no_match' | 'turned_away' | 'already_used' | 'arrived_before_since';
628
628
  export interface Variant {
629
629
  tests: string;
630
630
  address: string;
@@ -677,7 +677,7 @@ export interface CountOptions {
677
677
  }
678
678
  export type EmailCategory = 'auth' | 'transactional' | 'marketing';
679
679
  export type CountSubtype = 'otp' | 'coupon' | 'verify' | 'magic_signin' | 'invite' | 'reset' | 'other' | 'unsubscribe' | 'list_unsubscribe' | 'any';
680
- export type CheckId = 'spf' | 'dkim' | 'dmarc' | 'shared_sender' | 'local_links' | 'plain_http' | 'expected_host' | 'link_site' | 'expiry' | 'coupon_expiry' | 'plain_text' | 'size' | 'images_only' | 'layout' | 'expected_text' | 'language' | 'arrival_time' | 'expected_attachment' | 'list_unsubscribe' | 'one_click_unsubscribe' | 'unsubscribe_link' | 'preheader' | 'after_unsubscribe' | 'offer_reuse' | 'coupon_result' | 'marketing_consent' | 'prechecked_consent' | 'double_opt_in' | 'unsubscribe_deadline' | 'postal_address' | 'sender_identity' | 'minor_marketing' | 'harmful_attachment' | 'spam_risk' | 'misleading_subject' | 'ad_label';
680
+ export type CheckId = 'spf' | 'dkim' | 'dmarc' | 'shared_sender' | 'local_links' | 'plain_http' | 'expected_host' | 'link_site' | 'expiry' | 'coupon_expiry' | 'plain_text' | 'size' | 'images_only' | 'layout' | 'expected_text' | 'language' | 'arrival_time' | 'expected_attachment' | 'list_unsubscribe' | 'one_click_unsubscribe' | 'unsubscribe_link' | 'preheader' | 'after_unsubscribe' | 'offer_reuse' | 'coupon_result' | 'marketing_consent' | 'prechecked_consent' | 'double_opt_in' | 'unsubscribe_deadline' | 'postal_address' | 'sender_identity' | 'minor_marketing' | 'harmful_attachment' | 'spam_risk' | 'misleading_subject' | 'ad_label' | 'code_length' | 'link_length' | 'auth_length' | 'subject_length' | 'one_action';
681
681
  export interface EmailCheck {
682
682
  check: CheckId;
683
683
  status: 'pass' | 'fail' | 'warn' | 'skip';
@@ -914,6 +914,121 @@ export interface FlowChecks {
914
914
  flow: Flow;
915
915
  checks: FlowCheck[];
916
916
  }
917
+ export type JourneyPhase = 'after_signup' | 'signing_in' | 'password_reset' | 'invites' | 'ongoing';
918
+ export type JourneyAgeBand = 'under-18' | '18-24' | '25-34' | '35-44' | '45-54' | '55-plus';
919
+ export interface JourneyOptions {
920
+ site?: string;
921
+ phase?: JourneyPhase;
922
+ country?: string[];
923
+ countryUnknown?: boolean;
924
+ age?: JourneyAgeBand[];
925
+ ageUnknown?: boolean;
926
+ anyTags?: string[];
927
+ address?: string;
928
+ gotStep?: string[];
929
+ notGotStep?: string[];
930
+ }
931
+ export interface JourneyStepOut {
932
+ type: 'step';
933
+ key: string;
934
+ kind: string;
935
+ kind_name: string;
936
+ sender: string;
937
+ got: number;
938
+ of: number | null;
939
+ wait: {
940
+ ms: number;
941
+ kind: 'one' | 'two' | 'usual' | null;
942
+ all_ms: number[];
943
+ range_ms?: [number, number];
944
+ from: string;
945
+ } | null;
946
+ countries: Record<string, number>;
947
+ age_bands: Record<string, number>;
948
+ still_due: {
949
+ addresses: string[];
950
+ left_out: number;
951
+ usually_after_ms: number | null;
952
+ };
953
+ did_not_get: {
954
+ addresses: string[];
955
+ left_out: number;
956
+ } | null;
957
+ warnings: Array<{
958
+ id: string;
959
+ text: string;
960
+ }>;
961
+ emails: Array<{
962
+ id: string;
963
+ address: string;
964
+ received_at: string;
965
+ }>;
966
+ emails_left_out?: number;
967
+ }
968
+ export interface JourneyPathFilter {
969
+ site: string;
970
+ country?: string[];
971
+ country_unknown?: boolean;
972
+ age?: JourneyAgeBand[];
973
+ age_unknown?: boolean;
974
+ any_tags?: string[];
975
+ address?: string;
976
+ got_step?: string[];
977
+ not_got_step?: string[];
978
+ }
979
+ export interface JourneySplit {
980
+ type: 'split';
981
+ by: 'country' | 'age band' | 'tag';
982
+ paths: Array<{
983
+ label: string;
984
+ accounts: number;
985
+ filter: JourneyPathFilter;
986
+ query: string;
987
+ steps: JourneyStepOut[];
988
+ }>;
989
+ }
990
+ export interface Journey {
991
+ showing: string;
992
+ notes: string[];
993
+ link: string;
994
+ journey: string;
995
+ name: string;
996
+ by: 'site' | 'sender';
997
+ journeys: Array<{
998
+ journey: string;
999
+ name: string;
1000
+ by: 'site' | 'sender';
1001
+ accounts: number;
1002
+ }>;
1003
+ accounts: {
1004
+ shown: number;
1005
+ total: number;
1006
+ with_no_email: number;
1007
+ };
1008
+ emails: number;
1009
+ truncated: boolean;
1010
+ filters_left_off: number;
1011
+ filter_values: Record<'country' | 'age' | 'tags', Array<{
1012
+ value: string;
1013
+ accounts: number;
1014
+ chosen?: boolean;
1015
+ }>> & Partial<Record<'country_unknown' | 'age_unknown', {
1016
+ accounts: number;
1017
+ chosen?: boolean;
1018
+ }>>;
1019
+ phases: Array<{
1020
+ phase: JourneyPhase;
1021
+ name: string;
1022
+ started_by: string;
1023
+ steps: Array<JourneyStepOut | JourneySplit>;
1024
+ }>;
1025
+ good_practice: Array<{
1026
+ rule: string;
1027
+ name: string;
1028
+ checked: number;
1029
+ warned: number;
1030
+ }>;
1031
+ }
917
1032
  export interface AddressAllowance {
918
1033
  limited: boolean;
919
1034
  used: number;
@@ -1115,6 +1230,7 @@ export declare class ProxyMailQA {
1115
1230
  problem?: string;
1116
1231
  };
1117
1232
  cleanupList(options?: CleanupListOptions): Promise<CleanupList>;
1233
+ journey(options?: JourneyOptions | JourneyPathFilter): Promise<Journey>;
1118
1234
  markDevHost(host: string): Promise<{
1119
1235
  dev_hosts: string[];
1120
1236
  }>;
package/dist/index.js CHANGED
@@ -402,8 +402,9 @@ export class ProxyMailQA {
402
402
  return this.request('GET', `/form-sections${query ? `?${query}` : ''}`);
403
403
  }
404
404
  // One section: for an ID or tax number, its format in a country, a fake
405
- // value that follows it, and variants. Give address to keep the value the
406
- // same for that test account (New in 0.13.0).
405
+ // value that follows it, given only where one can never be a real person's, and
406
+ // variants. Give address to keep the value the same for that test account
407
+ // (New in 0.13.0).
407
408
  getFormSection(id, options = {}) {
408
409
  const q = new URLSearchParams();
409
410
  if (options.country)
@@ -436,6 +437,31 @@ export class ProxyMailQA {
436
437
  const query = q.toString();
437
438
  return this.request('GET', `/cleanup-list${query ? `?${query}` : ''}`);
438
439
  }
440
+ // A site's journey, as the Journeys page draws it, for all the project's
441
+ // test accounts or the ones the options pick (Journeys Lab; new in 0.14.0).
442
+ // A split path's filter works as the options too.
443
+ journey(options = {}) {
444
+ const o = options;
445
+ const q = new URLSearchParams();
446
+ // A comma inside a value is written %2C, as the page's address writes it.
447
+ const list = (items) => (items?.length ? items.map((item) => item.replace(/%/g, '%25').replace(/,/g, '%2C')).join(',') : null);
448
+ const put = (name, value) => {
449
+ if (value)
450
+ q.set(name, value);
451
+ };
452
+ put('site', o.site);
453
+ put('phase', o.phase);
454
+ put('country', list(o.country));
455
+ put('country_unknown', o.countryUnknown || o.country_unknown ? '1' : null);
456
+ put('age', list(o.age));
457
+ put('age_unknown', o.ageUnknown || o.age_unknown ? '1' : null);
458
+ put('any_tags', list(o.anyTags ?? o.any_tags));
459
+ put('address', o.address);
460
+ put('got_step', list(o.gotStep ?? o.got_step));
461
+ put('not_got_step', list(o.notGotStep ?? o.not_got_step));
462
+ const query = q.toString();
463
+ return this.request('GET', `/journeys${query ? `?${query}` : ''}`);
464
+ }
439
465
  markDevHost(host) {
440
466
  return this.request('POST', '/project/dev-hosts', { host });
441
467
  }
@@ -617,13 +643,14 @@ export class ProxyMailQA {
617
643
  deleteAddress(address) {
618
644
  return this.request('DELETE', `/addresses/${encodeURIComponent(address)}`);
619
645
  }
620
- // Records that the test has just submitted a form with the address (a
646
+ // Records that the test is about to submit a form with the address (a
621
647
  // sign-up unless flow says otherwise), on site (a page URL, kept as host and
622
648
  // path, with any part of the path that has an email address, an ID, a long
623
- // number or a token in it hidden; never its query or fragment). The time is the
624
- // server's: the wait that finds the code or link then returns
625
- // time_to_email. Pass its submitted_at as since. Never send the form's
626
- // contents.
649
+ // number or a token in it hidden; never its query or fragment). Call it just
650
+ // before the test presses the button: the time is the server's, taken when
651
+ // the call arrives, so after the click a fast email can come first. Pass its
652
+ // submitted_at as since; the wait that finds the code or link then returns
653
+ // time_to_email. Never send the form's contents.
627
654
  markSubmitted(address, options = {}) {
628
655
  return this.request('POST', `/addresses/${encodeURIComponent(address)}/submits`, { flow: options.flow, site: options.site });
629
656
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proxymail-qa",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Test every email your app sends from Playwright, Cypress, Jest, Vitest, any Node script or the command line: disposable inboxes, sign-up codes, links and coupons, email checks, unsubscribe tests and run reports.",
5
5
  "license": "MIT",
6
6
  "author": "Proxy Mail QA <hello@proxymail.qa> (https://proxymail.qa)",