sf-browserforce 1.0.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.
Files changed (285) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -0
  3. package/bin/run +9 -0
  4. package/bin/run.cmd +3 -0
  5. package/lib/browserforce-command.d.ts +27 -0
  6. package/lib/browserforce-command.js +162 -0
  7. package/lib/browserforce-command.js.map +1 -0
  8. package/lib/browserforce.d.ts +27 -0
  9. package/lib/browserforce.js +163 -0
  10. package/lib/browserforce.js.map +1 -0
  11. package/lib/commands/browserforce/apply.d.ts +10 -0
  12. package/lib/commands/browserforce/apply.js +83 -0
  13. package/lib/commands/browserforce/apply.js.map +1 -0
  14. package/lib/commands/browserforce/playwright.d.ts +9 -0
  15. package/lib/commands/browserforce/playwright.js +53 -0
  16. package/lib/commands/browserforce/playwright.js.map +1 -0
  17. package/lib/config-parser.d.ts +16 -0
  18. package/lib/config-parser.js +24 -0
  19. package/lib/config-parser.js.map +1 -0
  20. package/lib/index.d.ts +1 -0
  21. package/lib/index.js +2 -0
  22. package/lib/index.js.map +1 -0
  23. package/lib/jsforce-utils.d.ts +5 -0
  24. package/lib/jsforce-utils.js +14 -0
  25. package/lib/jsforce-utils.js.map +1 -0
  26. package/lib/pages/login.d.ts +7 -0
  27. package/lib/pages/login.js +17 -0
  28. package/lib/pages/login.js.map +1 -0
  29. package/lib/plugin.d.ts +15 -0
  30. package/lib/plugin.js +28 -0
  31. package/lib/plugin.js.map +1 -0
  32. package/lib/plugins/activity-settings/index.d.ts +9 -0
  33. package/lib/plugins/activity-settings/index.e2e-spec.d.ts +1 -0
  34. package/lib/plugins/activity-settings/index.e2e-spec.js +36 -0
  35. package/lib/plugins/activity-settings/index.e2e-spec.js.map +1 -0
  36. package/lib/plugins/activity-settings/index.js +102 -0
  37. package/lib/plugins/activity-settings/index.js.map +1 -0
  38. package/lib/plugins/auth-providers/index.d.ts +13 -0
  39. package/lib/plugins/auth-providers/index.e2e-spec.d.ts +1 -0
  40. package/lib/plugins/auth-providers/index.e2e-spec.js +78 -0
  41. package/lib/plugins/auth-providers/index.e2e-spec.js.map +1 -0
  42. package/lib/plugins/auth-providers/index.js +135 -0
  43. package/lib/plugins/auth-providers/index.js.map +1 -0
  44. package/lib/plugins/company-information/index.d.ts +8 -0
  45. package/lib/plugins/company-information/index.e2e-spec.d.ts +1 -0
  46. package/lib/plugins/company-information/index.e2e-spec.js +37 -0
  47. package/lib/plugins/company-information/index.e2e-spec.js.map +1 -0
  48. package/lib/plugins/company-information/index.js +114 -0
  49. package/lib/plugins/company-information/index.js.map +1 -0
  50. package/lib/plugins/customer-portal/available-custom-objects/index.d.ts +14 -0
  51. package/lib/plugins/customer-portal/available-custom-objects/index.js +203 -0
  52. package/lib/plugins/customer-portal/available-custom-objects/index.js.map +1 -0
  53. package/lib/plugins/customer-portal/available-custom-objects/index.test.d.ts +1 -0
  54. package/lib/plugins/customer-portal/available-custom-objects/index.test.js +39 -0
  55. package/lib/plugins/customer-portal/available-custom-objects/index.test.js.map +1 -0
  56. package/lib/plugins/customer-portal/enabled/index.d.ts +6 -0
  57. package/lib/plugins/customer-portal/enabled/index.js +89 -0
  58. package/lib/plugins/customer-portal/enabled/index.js.map +1 -0
  59. package/lib/plugins/customer-portal/enabled/index.test.d.ts +1 -0
  60. package/lib/plugins/customer-portal/enabled/index.test.js +34 -0
  61. package/lib/plugins/customer-portal/enabled/index.test.js.map +1 -0
  62. package/lib/plugins/customer-portal/index.d.ts +15 -0
  63. package/lib/plugins/customer-portal/index.e2e-spec.d.ts +1 -0
  64. package/lib/plugins/customer-portal/index.e2e-spec.js +188 -0
  65. package/lib/plugins/customer-portal/index.e2e-spec.js.map +1 -0
  66. package/lib/plugins/customer-portal/index.js +58 -0
  67. package/lib/plugins/customer-portal/index.js.map +1 -0
  68. package/lib/plugins/customer-portal/index.test.d.ts +1 -0
  69. package/lib/plugins/customer-portal/index.test.js +84 -0
  70. package/lib/plugins/customer-portal/index.test.js.map +1 -0
  71. package/lib/plugins/customer-portal/portals/index.d.ts +25 -0
  72. package/lib/plugins/customer-portal/portals/index.js +254 -0
  73. package/lib/plugins/customer-portal/portals/index.js.map +1 -0
  74. package/lib/plugins/customer-portal/portals/index.test.d.ts +1 -0
  75. package/lib/plugins/customer-portal/portals/index.test.js +140 -0
  76. package/lib/plugins/customer-portal/portals/index.test.js.map +1 -0
  77. package/lib/plugins/density-settings/index.d.ts +10 -0
  78. package/lib/plugins/density-settings/index.e2e-spec.d.ts +1 -0
  79. package/lib/plugins/density-settings/index.e2e-spec.js +39 -0
  80. package/lib/plugins/density-settings/index.e2e-spec.js.map +1 -0
  81. package/lib/plugins/density-settings/index.js +101 -0
  82. package/lib/plugins/density-settings/index.js.map +1 -0
  83. package/lib/plugins/deprecated.d.ts +4 -0
  84. package/lib/plugins/deprecated.js +28 -0
  85. package/lib/plugins/deprecated.js.map +1 -0
  86. package/lib/plugins/email-deliverability/index.d.ts +9 -0
  87. package/lib/plugins/email-deliverability/index.e2e-spec.d.ts +1 -0
  88. package/lib/plugins/email-deliverability/index.e2e-spec.js +55 -0
  89. package/lib/plugins/email-deliverability/index.e2e-spec.js.map +1 -0
  90. package/lib/plugins/email-deliverability/index.js +109 -0
  91. package/lib/plugins/email-deliverability/index.js.map +1 -0
  92. package/lib/plugins/high-velocity-sales-settings/index.d.ts +10 -0
  93. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.d.ts +1 -0
  94. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js +29 -0
  95. package/lib/plugins/high-velocity-sales-settings/index.e2e-spec.js.map +1 -0
  96. package/lib/plugins/high-velocity-sales-settings/index.js +105 -0
  97. package/lib/plugins/high-velocity-sales-settings/index.js.map +1 -0
  98. package/lib/plugins/high-velocity-sales-settings/page.d.ts +8 -0
  99. package/lib/plugins/high-velocity-sales-settings/page.js +27 -0
  100. package/lib/plugins/high-velocity-sales-settings/page.js.map +1 -0
  101. package/lib/plugins/history-tracking/index.d.ts +19 -0
  102. package/lib/plugins/history-tracking/index.e2e-spec.d.ts +1 -0
  103. package/lib/plugins/history-tracking/index.e2e-spec.js +128 -0
  104. package/lib/plugins/history-tracking/index.e2e-spec.js.map +1 -0
  105. package/lib/plugins/history-tracking/index.js +272 -0
  106. package/lib/plugins/history-tracking/index.js.map +1 -0
  107. package/lib/plugins/home-page-layouts/index.d.ts +14 -0
  108. package/lib/plugins/home-page-layouts/index.e2e-spec.d.ts +1 -0
  109. package/lib/plugins/home-page-layouts/index.e2e-spec.js +47 -0
  110. package/lib/plugins/home-page-layouts/index.e2e-spec.js.map +1 -0
  111. package/lib/plugins/home-page-layouts/index.js +145 -0
  112. package/lib/plugins/home-page-layouts/index.js.map +1 -0
  113. package/lib/plugins/home-page-layouts/index.test.d.ts +1 -0
  114. package/lib/plugins/home-page-layouts/index.test.js +104 -0
  115. package/lib/plugins/home-page-layouts/index.test.js.map +1 -0
  116. package/lib/plugins/index.d.ts +28 -0
  117. package/lib/plugins/index.js +29 -0
  118. package/lib/plugins/index.js.map +1 -0
  119. package/lib/plugins/lightning-experience-settings/index.d.ts +17 -0
  120. package/lib/plugins/lightning-experience-settings/index.e2e-spec.d.ts +1 -0
  121. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js +48 -0
  122. package/lib/plugins/lightning-experience-settings/index.e2e-spec.js.map +1 -0
  123. package/lib/plugins/lightning-experience-settings/index.js +149 -0
  124. package/lib/plugins/lightning-experience-settings/index.js.map +1 -0
  125. package/lib/plugins/linkedin-sales-navigator-settings/index.d.ts +8 -0
  126. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.d.ts +1 -0
  127. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js +29 -0
  128. package/lib/plugins/linkedin-sales-navigator-settings/index.e2e-spec.js.map +1 -0
  129. package/lib/plugins/linkedin-sales-navigator-settings/index.js +93 -0
  130. package/lib/plugins/linkedin-sales-navigator-settings/index.js.map +1 -0
  131. package/lib/plugins/linkedin-sales-navigator-settings/page.d.ts +9 -0
  132. package/lib/plugins/linkedin-sales-navigator-settings/page.js +35 -0
  133. package/lib/plugins/linkedin-sales-navigator-settings/page.js.map +1 -0
  134. package/lib/plugins/login-as-user/index.d.ts +9 -0
  135. package/lib/plugins/login-as-user/index.js +104 -0
  136. package/lib/plugins/login-as-user/index.js.map +1 -0
  137. package/lib/plugins/logout-login-as-user/index.d.ts +6 -0
  138. package/lib/plugins/logout-login-as-user/index.js +76 -0
  139. package/lib/plugins/logout-login-as-user/index.js.map +1 -0
  140. package/lib/plugins/omni-channel-settings/index.d.ts +9 -0
  141. package/lib/plugins/omni-channel-settings/index.e2e-spec.d.ts +1 -0
  142. package/lib/plugins/omni-channel-settings/index.e2e-spec.js +30 -0
  143. package/lib/plugins/omni-channel-settings/index.e2e-spec.js.map +1 -0
  144. package/lib/plugins/omni-channel-settings/index.js +97 -0
  145. package/lib/plugins/omni-channel-settings/index.js.map +1 -0
  146. package/lib/plugins/opportunity-splits/index.d.ts +9 -0
  147. package/lib/plugins/opportunity-splits/index.e2e-spec.d.ts +1 -0
  148. package/lib/plugins/opportunity-splits/index.e2e-spec.js +46 -0
  149. package/lib/plugins/opportunity-splits/index.e2e-spec.js.map +1 -0
  150. package/lib/plugins/opportunity-splits/index.js +117 -0
  151. package/lib/plugins/opportunity-splits/index.js.map +1 -0
  152. package/lib/plugins/opportunity-splits/pages/layout-selection.d.ts +8 -0
  153. package/lib/plugins/opportunity-splits/pages/layout-selection.js +15 -0
  154. package/lib/plugins/opportunity-splits/pages/layout-selection.js.map +1 -0
  155. package/lib/plugins/opportunity-splits/pages/overview.d.ts +11 -0
  156. package/lib/plugins/opportunity-splits/pages/overview.js +32 -0
  157. package/lib/plugins/opportunity-splits/pages/overview.js.map +1 -0
  158. package/lib/plugins/opportunity-splits/pages/setup.d.ts +9 -0
  159. package/lib/plugins/opportunity-splits/pages/setup.js +17 -0
  160. package/lib/plugins/opportunity-splits/pages/setup.js.map +1 -0
  161. package/lib/plugins/permission-sets/index.d.ts +10 -0
  162. package/lib/plugins/permission-sets/index.e2e-spec.d.ts +1 -0
  163. package/lib/plugins/permission-sets/index.e2e-spec.js +47 -0
  164. package/lib/plugins/permission-sets/index.e2e-spec.js.map +1 -0
  165. package/lib/plugins/permission-sets/index.js +22 -0
  166. package/lib/plugins/permission-sets/index.js.map +1 -0
  167. package/lib/plugins/permission-sets/service-presence-status/index.d.ts +10 -0
  168. package/lib/plugins/permission-sets/service-presence-status/index.js +124 -0
  169. package/lib/plugins/permission-sets/service-presence-status/index.js.map +1 -0
  170. package/lib/plugins/picklists/field-dependencies/index.d.ts +11 -0
  171. package/lib/plugins/picklists/field-dependencies/index.js +133 -0
  172. package/lib/plugins/picklists/field-dependencies/index.js.map +1 -0
  173. package/lib/plugins/picklists/field-dependencies/index.test.d.ts +1 -0
  174. package/lib/plugins/picklists/field-dependencies/index.test.js +64 -0
  175. package/lib/plugins/picklists/field-dependencies/index.test.js.map +1 -0
  176. package/lib/plugins/picklists/field-dependencies/pages.d.ts +15 -0
  177. package/lib/plugins/picklists/field-dependencies/pages.js +50 -0
  178. package/lib/plugins/picklists/field-dependencies/pages.js.map +1 -0
  179. package/lib/plugins/picklists/index.d.ts +23 -0
  180. package/lib/plugins/picklists/index.e2e-spec.d.ts +1 -0
  181. package/lib/plugins/picklists/index.e2e-spec.js +128 -0
  182. package/lib/plugins/picklists/index.e2e-spec.js.map +1 -0
  183. package/lib/plugins/picklists/index.js +229 -0
  184. package/lib/plugins/picklists/index.js.map +1 -0
  185. package/lib/plugins/picklists/pages.d.ts +45 -0
  186. package/lib/plugins/picklists/pages.js +185 -0
  187. package/lib/plugins/picklists/pages.js.map +1 -0
  188. package/lib/plugins/picklists/standard-value-set.d.ts +1 -0
  189. package/lib/plugins/picklists/standard-value-set.js +80 -0
  190. package/lib/plugins/picklists/standard-value-set.js.map +1 -0
  191. package/lib/plugins/record-types/index.d.ts +14 -0
  192. package/lib/plugins/record-types/index.e2e-spec.d.ts +1 -0
  193. package/lib/plugins/record-types/index.e2e-spec.js +76 -0
  194. package/lib/plugins/record-types/index.e2e-spec.js.map +1 -0
  195. package/lib/plugins/record-types/index.js +133 -0
  196. package/lib/plugins/record-types/index.js.map +1 -0
  197. package/lib/plugins/record-types/pages.d.ts +14 -0
  198. package/lib/plugins/record-types/pages.js +50 -0
  199. package/lib/plugins/record-types/pages.js.map +1 -0
  200. package/lib/plugins/relate-contact-to-multiple-accounts/index.d.ts +11 -0
  201. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.d.ts +1 -0
  202. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js +30 -0
  203. package/lib/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.js.map +1 -0
  204. package/lib/plugins/relate-contact-to-multiple-accounts/index.js +120 -0
  205. package/lib/plugins/relate-contact-to-multiple-accounts/index.js.map +1 -0
  206. package/lib/plugins/reports-and-dashboards/folder-sharing/index.d.ts +8 -0
  207. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.d.ts +1 -0
  208. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js +3 -0
  209. package/lib/plugins/reports-and-dashboards/folder-sharing/index.e2e-spec.js.map +1 -0
  210. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js +116 -0
  211. package/lib/plugins/reports-and-dashboards/folder-sharing/index.js.map +1 -0
  212. package/lib/plugins/reports-and-dashboards/index.d.ts +11 -0
  213. package/lib/plugins/reports-and-dashboards/index.e2e-spec.d.ts +1 -0
  214. package/lib/plugins/reports-and-dashboards/index.e2e-spec.js +3 -0
  215. package/lib/plugins/reports-and-dashboards/index.e2e-spec.js.map +1 -0
  216. package/lib/plugins/reports-and-dashboards/index.js +29 -0
  217. package/lib/plugins/reports-and-dashboards/index.js.map +1 -0
  218. package/lib/plugins/salesforce-cpq-config/formConfig.d.ts +17 -0
  219. package/lib/plugins/salesforce-cpq-config/formConfig.js +649 -0
  220. package/lib/plugins/salesforce-cpq-config/formConfig.js.map +1 -0
  221. package/lib/plugins/salesforce-cpq-config/index.d.ts +7 -0
  222. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.d.ts +1 -0
  223. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js +37 -0
  224. package/lib/plugins/salesforce-cpq-config/index.e2e-spec.js.map +1 -0
  225. package/lib/plugins/salesforce-cpq-config/index.js +261 -0
  226. package/lib/plugins/salesforce-cpq-config/index.js.map +1 -0
  227. package/lib/plugins/salesforce-to-salesforce/index.d.ts +9 -0
  228. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.d.ts +1 -0
  229. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js +34 -0
  230. package/lib/plugins/salesforce-to-salesforce/index.e2e-spec.js.map +1 -0
  231. package/lib/plugins/salesforce-to-salesforce/index.js +107 -0
  232. package/lib/plugins/salesforce-to-salesforce/index.js.map +1 -0
  233. package/lib/plugins/scheduled-batches/index.d.ts +10 -0
  234. package/lib/plugins/scheduled-batches/index.js +145 -0
  235. package/lib/plugins/scheduled-batches/index.js.map +1 -0
  236. package/lib/plugins/scheduled-batches/page.d.ts +19 -0
  237. package/lib/plugins/scheduled-batches/page.js +39 -0
  238. package/lib/plugins/scheduled-batches/page.js.map +1 -0
  239. package/lib/plugins/security/authentication-configuration/index.d.ts +15 -0
  240. package/lib/plugins/security/authentication-configuration/index.e2e-spec.d.ts +1 -0
  241. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js +129 -0
  242. package/lib/plugins/security/authentication-configuration/index.e2e-spec.js.map +1 -0
  243. package/lib/plugins/security/authentication-configuration/index.js +200 -0
  244. package/lib/plugins/security/authentication-configuration/index.js.map +1 -0
  245. package/lib/plugins/security/certificate-and-key-management/index.d.ts +23 -0
  246. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.d.ts +1 -0
  247. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js +59 -0
  248. package/lib/plugins/security/certificate-and-key-management/index.e2e-spec.js.map +1 -0
  249. package/lib/plugins/security/certificate-and-key-management/index.js +233 -0
  250. package/lib/plugins/security/certificate-and-key-management/index.js.map +1 -0
  251. package/lib/plugins/security/certificate-and-key-management/index.test.d.ts +1 -0
  252. package/lib/plugins/security/certificate-and-key-management/index.test.js +61 -0
  253. package/lib/plugins/security/certificate-and-key-management/index.test.js.map +1 -0
  254. package/lib/plugins/security/index.d.ts +13 -0
  255. package/lib/plugins/security/index.js +41 -0
  256. package/lib/plugins/security/index.js.map +1 -0
  257. package/lib/plugins/service-channels/capacity/index.d.ts +18 -0
  258. package/lib/plugins/service-channels/capacity/index.js +194 -0
  259. package/lib/plugins/service-channels/capacity/index.js.map +1 -0
  260. package/lib/plugins/service-channels/index.d.ts +12 -0
  261. package/lib/plugins/service-channels/index.e2e-spec.d.ts +1 -0
  262. package/lib/plugins/service-channels/index.e2e-spec.js +67 -0
  263. package/lib/plugins/service-channels/index.e2e-spec.js.map +1 -0
  264. package/lib/plugins/service-channels/index.js +37 -0
  265. package/lib/plugins/service-channels/index.js.map +1 -0
  266. package/lib/plugins/slack/index.d.ts +9 -0
  267. package/lib/plugins/slack/index.e2e-spec.d.ts +1 -0
  268. package/lib/plugins/slack/index.e2e-spec.js +47 -0
  269. package/lib/plugins/slack/index.e2e-spec.js.map +1 -0
  270. package/lib/plugins/slack/index.js +111 -0
  271. package/lib/plugins/slack/index.js.map +1 -0
  272. package/lib/plugins/user-access-policies/index.d.ts +19 -0
  273. package/lib/plugins/user-access-policies/index.e2e-spec.d.ts +1 -0
  274. package/lib/plugins/user-access-policies/index.e2e-spec.js +61 -0
  275. package/lib/plugins/user-access-policies/index.e2e-spec.js.map +1 -0
  276. package/lib/plugins/user-access-policies/index.js +176 -0
  277. package/lib/plugins/user-access-policies/index.js.map +1 -0
  278. package/lib/plugins/user-access-policies/page.d.ts +30 -0
  279. package/lib/plugins/user-access-policies/page.js +114 -0
  280. package/lib/plugins/user-access-policies/page.js.map +1 -0
  281. package/lib/plugins/utils.d.ts +13 -0
  282. package/lib/plugins/utils.js +159 -0
  283. package/lib/plugins/utils.js.map +1 -0
  284. package/oclif.manifest.json +177 -0
  285. package/package.json +65 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Matthias Rolke <mr.amtrack@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,266 @@
1
+ # sfdx-browserforce-plugin
2
+
3
+ > sf plugin to apply settings in the Salesforce Setup Menu using browser automation
4
+
5
+ [![Actions Status](https://github.com/amtrack/sfdx-browserforce-plugin/actions/workflows/default.yml/badge.svg?branch=main)](https://github.com/amtrack/sfdx-browserforce-plugin/actions?query=branch:main)
6
+
7
+ > [!NOTE]
8
+ > Since v6 we're using Playwright instead of Puppeteer. Please see the [release notes](https://github.com/amtrack/sfdx-browserforce-plugin/releases) for migration instructions.
9
+
10
+ ✅ Most settings in the Salesforce Setup Menu are represented as [Settings](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_settings.htm) in the Metadata API.
11
+
12
+ For example, the highlighted checkbox "Show View Hierarchy link on account pages" in Account Settings is indeed represented in the Metadata `AccountSettings` as `showViewHierarchyLink`.
13
+
14
+ | | |
15
+ | --------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
16
+ | ![Account Settings in the Salesforce Setup Menu](./examples/account-settings.png) | ![AccountSettings Metadata](./examples/account-settings-meta.png) |
17
+
18
+ ⚡ **BUT**
19
+
20
+ > Not all feature settings are available in the Metadata API. See [Unsupported Metadata Types](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_unsupported_types.htm) for information on which feature settings are not available.
21
+ >
22
+ > Source: [Metadata API Developer Guide | Settings](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_settings.htm)
23
+
24
+ For example, the Currency Locale in `Setup -> Company Settings -> Company Information` is not represented in any Metadata.
25
+
26
+ ![unsupported setting for currency locale](examples/unsupported-currency-locale.png)
27
+
28
+ 👉 This is where Browserforce (sfdx-browserforce-plugin) comes to the rescue. It fills this gap by applying these unsupported settings through browser automation!
29
+
30
+ ## Example
31
+
32
+ To change the Currency Locale, the Browserforce config file (here: `./config/currency.json`) looks like this:
33
+
34
+ ```json
35
+ {
36
+ "$schema": "https://raw.githubusercontent.com/amtrack/sfdx-browserforce-plugin/main/src/plugins/schema.json",
37
+ "settings": {
38
+ "companyInformation": {
39
+ "defaultCurrencyIsoCode": "English (South Africa) - ZAR"
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Apply the config:
46
+
47
+ ```console
48
+ $ sf browserforce apply -f ./config/currency.json --target-org myOrg@example.com
49
+ logging in... done
50
+ Applying config file ./config/currency.json to org myOrg@example.com
51
+ [CompanyInformation] retrieving state... done
52
+ [CompanyInformation] changing 'defaultCurrencyIsoCode' to '"English (South Africa) - ZAR"'... done
53
+ logging out... done
54
+ ```
55
+
56
+ Apply the config again: 👉 No action necessary
57
+
58
+ ```console
59
+ $ sf browserforce apply -f ./config/currency.json --target-org myOrg@example.com
60
+ logging in... done
61
+ Applying config file ./config/currency.json to org myOrg@example.com
62
+ [CompanyInformation] retrieving state... done
63
+ [CompanyInformation] no action necessary
64
+ logging out... done
65
+ ```
66
+
67
+ ## Key Concepts
68
+
69
+ - 🔧 configuration using JSON Schema (similar to the [Scratch Org Definition Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm))
70
+ - 🧠 idempotency of the `apply` command only applies what's necessary and allows re-execution (concept similar to [terraform](https://www.terraform.io/docs/commands/apply.html))
71
+ - 🏎️ browser automation powered by Playwright, [learn more about Playwright and Browserforce](#playwright)
72
+
73
+ ## Supported Browserforce Settings
74
+
75
+ Top settings:
76
+
77
+ - Change Currency Locale
78
+ - Delete inactive record types
79
+ - Replace (and delete) picklist values
80
+ - Manage (create/modify/delete) Field Dependencies on CustomFields
81
+ - Set Email Deliverability Access Level to "No access", "System email only" and "All email"
82
+ - Enable the 'Sales Cloud for Slack' Slack App
83
+ - Change active Lightning Theme
84
+ - Enable Salesforce To Salesforce
85
+ - Import certificates from a keystore in Java Keystore (JKS) format
86
+
87
+ But there's more:
88
+
89
+ - Please see the [Browserforce Settings](https://github.com/amtrack/sfdx-browserforce-plugin/wiki/Browserforce-Settings) wiki page with screenshots.
90
+ - Explore the JSON schema powered configuration using a [full-blown example](https://github.dev/amtrack/sfdx-browserforce-plugin/blob/main/examples/full.json) or start with an [empty configuration](https://github.dev/amtrack/sfdx-browserforce-plugin/blob/main/examples/empty.json).
91
+
92
+ ## Installation
93
+
94
+ ```shell
95
+ sf plugins install sfdx-browserforce-plugin
96
+ ```
97
+
98
+ > [!IMPORTANT]
99
+ > Playwright does not come with a browser automatically
100
+
101
+ You might need to install a browser explicitly or configure Browserforce to use an existing browser.
102
+
103
+ > [!TIP]
104
+ > If you're using Browserforce on GitHub Actions with the `ubuntu-latest` (v24) Docker image, we can use the preinstalled Google Chrome automatically.
105
+ > No further configuration and installation needed, because the `CHROME_BIN` environment variable is already set.
106
+
107
+ ### Option 1: Install a browser using our Playwright wrapper command
108
+
109
+ ```shell
110
+ sf browserforce playwright -- install chromium
111
+ ```
112
+
113
+ > [!IMPORTANT]
114
+ > The two hyphens `--` are intentional and separate the sf command from the arguments to be passed to the playwright executable.
115
+
116
+ ### Option 2: Configure Browserforce to use an existing browser
117
+
118
+ You can use any of the following environment variables:
119
+
120
+ ```shell
121
+ BROWSERFORCE_BROWSER_CHANNEL="chrome"
122
+ BROWSERFORCE_BROWSER_CHANNEL="chromium"
123
+ BROWSERFORCE_BROWSER_EXECUTABLE_PATH="/usr/bin/google-chrome"
124
+ CHROME_BIN="/usr/bin/google-chrome"
125
+ ```
126
+
127
+ ## Usage
128
+
129
+ <!-- commands -->
130
+ * [`sf browserforce apply`](#sf-browserforce-apply)
131
+ * [`sf browserforce playwright`](#sf-browserforce-playwright)
132
+
133
+ ## `sf browserforce apply`
134
+
135
+ apply a plan from a config file
136
+
137
+ ```
138
+ USAGE
139
+ $ sf browserforce apply -o <value> [--json] [--flags-dir <value>] [-f <value>] [-d] [--headless] [--slow-mo <value>]
140
+ [--timeout <value>] [--trace] [--browser-executable-path <value>] [--browser-channel <value>] [--max-retries
141
+ <value>] [--retry-timeout <value>]
142
+
143
+ FLAGS
144
+ -d, --dry-run [env: BROWSERFORCE_DRY_RUN] dry run
145
+ -f, --definitionfile=<value> path to a browserforce config file
146
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
147
+ configuration variable is already set.
148
+
149
+ BROWSER CONFIGURATION FLAGS
150
+ --browser-channel=<value> [env: BROWSERFORCE_BROWSER_CHANNEL] the channel (e.g. chromium or chrome) to use
151
+ --browser-executable-path=<value> [default: /usr/bin/google-chrome, env: BROWSERFORCE_BROWSER_EXECUTABLE_PATH] the
152
+ path to a browser executable
153
+ --[no-]headless [env: BROWSERFORCE_HEADLESS] run in headless mode (default: true)
154
+ --slow-mo=<value> [env: BROWSERFORCE_SLOWMO] slow motion in milliseconds (default: 0)
155
+ --timeout=<value> [default: 90000, env: BROWSERFORCE_NAVIGATION_TIMEOUT_MS] the default navigation
156
+ timeout in milliseconds
157
+ --trace [env: BROWSERFORCE_TRACE] create a Playwright trace file
158
+
159
+ GLOBAL FLAGS
160
+ --flags-dir=<value> Import flag values from a directory.
161
+ --json Format output as json.
162
+
163
+ RETRY CONFIGURATION FLAGS
164
+ --max-retries=<value> [default: 6, env: BROWSERFORCE_RETRY_MAX_RETRIES] the maximum number of retries for retryable
165
+ actions
166
+ --retry-timeout=<value> [default: 4000, env: BROWSERFORCE_RETRY_TIMEOUT_MS] the inital timeout in milliseconds for
167
+ retryable actions (exponentially increased)
168
+
169
+ DESCRIPTION
170
+ apply a plan from a config file
171
+
172
+ EXAMPLES
173
+ $ sf browserforce apply -f ./config/currency.json --target-org myOrg@example.com
174
+ logging in... done
175
+ Applying config file ./config/currency.json to org myOrg@example.com
176
+ [CompanyInformation] retrieving state... done
177
+ [CompanyInformation] changing 'defaultCurrencyIsoCode' to '"English (South Africa) - ZAR"'... done
178
+ logging out... done
179
+
180
+
181
+ FLAG DESCRIPTIONS
182
+ -d, --dry-run dry run
183
+
184
+ Retrieve the config and show the diff, but don't apply it.
185
+
186
+ --browser-channel=<value> the channel (e.g. chromium or chrome) to use
187
+
188
+ Playwright will try to figure out the path to the browser executable automatically.
189
+
190
+ --browser-executable-path=<value> the path to a browser executable
191
+
192
+ Note: The environment variable CHROME_BIN can also be used. On GitHub Actions with ubuntu-latest, CHROME_BIN is set
193
+ to /usr/bin/google-chrome.
194
+
195
+ --trace create a Playwright trace file
196
+
197
+ The trace file can be viewed with "sf browserforce playwright -- show-trace trace-<date>.zip".
198
+ ```
199
+
200
+ _See code: [src/commands/browserforce/apply.ts](https://github.com/jrupesh/sfdx-browserforce-plugin/blob/v1.0.0/src/commands/browserforce/apply.ts)_
201
+
202
+ ## `sf browserforce playwright`
203
+
204
+ access the Playwright CLI
205
+
206
+ ```
207
+ USAGE
208
+ $ sf browserforce playwright
209
+
210
+ DESCRIPTION
211
+ access the Playwright CLI
212
+
213
+ EXAMPLES
214
+ $ sf browserforce playwright -- --help
215
+
216
+ $ sf browserforce playwright -- --version
217
+
218
+ $ sf browserforce playwright -- install --list
219
+
220
+ $ sf browserforce playwright -- install chromium
221
+ ```
222
+
223
+ _See code: [src/commands/browserforce/playwright.ts](https://github.com/jrupesh/sfdx-browserforce-plugin/blob/v1.0.0/src/commands/browserforce/playwright.ts)_
224
+ <!-- commandsstop -->
225
+
226
+ ## Playwright
227
+
228
+ We use [Playwright](https://playwright.dev/) for browser automation.
229
+
230
+ For more information on browser automation best practices, see the [Playwright documentation](./docs/PLAYWRIGHT.md).
231
+
232
+ ## Alternative Installation
233
+
234
+ You can also install the `sfdx-browserforce-plugin` NPM package without `sf`. The package exports a `sfdx-browserforce-plugin` executable:
235
+
236
+ Example:
237
+
238
+ ```shell
239
+ npm install --save-dev sfdx-browserforce-plugin
240
+ npx sfdx-browserforce-plugin browserforce -h
241
+ ```
242
+
243
+ ## Troubleshooting
244
+
245
+ If no browser is installed or launching fails, you'll get an error message from Playwright with a suggestion.
246
+
247
+ Typically this will guide you to install a browser.
248
+ If you've installed sfdx-browserforce-plugin using `sf`, you can replace the following:
249
+
250
+ ```diff
251
+ - npx playwright install chromium
252
+ + sf browserforce playwright -- install chromium
253
+ ```
254
+
255
+ ## Contributing
256
+
257
+ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for getting started.
258
+
259
+ ## Sponsors
260
+
261
+ - [PARX](https://www.parx.com)
262
+ - [IPfolio](https://www.ipfolio.com)
263
+
264
+ ## License
265
+
266
+ MIT © [Matthias Rolke](mailto:mr.amtrack@gmail.com)
package/bin/run ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ // eslint-disable-next-line node/shebang
4
+ async function main() {
5
+ const { execute } = await import('@oclif/core');
6
+ await execute({ dir: import.meta.url });
7
+ }
8
+
9
+ await main();
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
@@ -0,0 +1,27 @@
1
+ import { type Interfaces } from '@oclif/core';
2
+ import { SfCommand } from '@salesforce/sf-plugins-core';
3
+ import { Browserforce } from './browserforce.js';
4
+ export declare abstract class BrowserforceCommand<T> extends SfCommand<T> {
5
+ static baseFlags: {
6
+ 'target-org': Interfaces.OptionFlag<import("@salesforce/core").Org, Interfaces.CustomOptions>;
7
+ definitionfile: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
8
+ 'dry-run': Interfaces.BooleanFlag<boolean>;
9
+ headless: Interfaces.BooleanFlag<boolean>;
10
+ 'slow-mo': Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
11
+ timeout: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
12
+ trace: Interfaces.BooleanFlag<boolean>;
13
+ 'browser-executable-path': Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
14
+ 'browser-channel': Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
15
+ 'max-retries': Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
16
+ 'retry-timeout': Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
17
+ 'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ };
19
+ protected browserforce: Browserforce;
20
+ protected settings: any[];
21
+ protected retryConfig?: {
22
+ retries: number;
23
+ minTimeout: number;
24
+ };
25
+ init(): Promise<void>;
26
+ finally(err?: Error): Promise<void>;
27
+ }
@@ -0,0 +1,162 @@
1
+ import { Flags, SfCommand, Ux } from '@salesforce/sf-plugins-core';
2
+ import { promises } from 'fs';
3
+ import * as path from 'path';
4
+ import { chromium } from 'playwright';
5
+ import { Browserforce } from './browserforce.js';
6
+ import { ConfigParser } from './config-parser.js';
7
+ import { handleDeprecations } from './plugins/deprecated.js';
8
+ import * as DRIVERS from './plugins/index.js';
9
+ export class BrowserforceCommand extends SfCommand {
10
+ static baseFlags = {
11
+ ...SfCommand.baseFlags,
12
+ 'target-org': Flags.requiredOrg(),
13
+ definitionfile: Flags.string({
14
+ char: 'f',
15
+ summary: 'path to a browserforce config file',
16
+ }),
17
+ 'dry-run': Flags.boolean({
18
+ char: 'd',
19
+ summary: 'dry run',
20
+ description: `Retrieve the config and show the diff, but don't apply it.`,
21
+ env: 'BROWSERFORCE_DRY_RUN',
22
+ }),
23
+ // browser configuration
24
+ headless: Flags.boolean({
25
+ helpGroup: 'Browser Configuration',
26
+ summary: 'run in headless mode (default: true)',
27
+ allowNo: true,
28
+ env: 'BROWSERFORCE_HEADLESS',
29
+ default: !(process.env.BROWSER_DEBUG === 'true'), // for backwards-compatibility
30
+ }),
31
+ 'slow-mo': Flags.integer({
32
+ helpGroup: 'Browser Configuration',
33
+ summary: 'slow motion in milliseconds (default: 0)',
34
+ env: 'BROWSERFORCE_SLOWMO',
35
+ default: Number(process.env.BROWSER_SLOWMO ?? '0'), // for backwards-compatibility
36
+ }),
37
+ timeout: Flags.integer({
38
+ helpGroup: 'Browser Configuration',
39
+ summary: 'the default navigation timeout in milliseconds',
40
+ env: 'BROWSERFORCE_NAVIGATION_TIMEOUT_MS',
41
+ default: 90_000,
42
+ }),
43
+ trace: Flags.boolean({
44
+ helpGroup: 'Browser Configuration',
45
+ summary: 'create a Playwright trace file',
46
+ description: 'The trace file can be viewed with "sf browserforce playwright -- show-trace trace-<date>.zip".',
47
+ env: 'BROWSERFORCE_TRACE',
48
+ }),
49
+ 'browser-executable-path': Flags.string({
50
+ helpGroup: 'Browser Configuration',
51
+ summary: 'the path to a browser executable',
52
+ description: 'Note: The environment variable CHROME_BIN can also be used. On GitHub Actions with ubuntu-latest, CHROME_BIN is set to /usr/bin/google-chrome.',
53
+ env: 'BROWSERFORCE_BROWSER_EXECUTABLE_PATH',
54
+ default: process.env.CHROME_BIN?.length ? process.env.CHROME_BIN : undefined,
55
+ }),
56
+ 'browser-channel': Flags.string({
57
+ helpGroup: 'Browser Configuration',
58
+ summary: 'the channel (e.g. chromium or chrome) to use',
59
+ description: 'Playwright will try to figure out the path to the browser executable automatically.',
60
+ env: 'BROWSERFORCE_BROWSER_CHANNEL',
61
+ }),
62
+ // retry config
63
+ 'max-retries': Flags.integer({
64
+ helpGroup: 'Retry Configuration',
65
+ summary: 'the maximum number of retries for retryable actions',
66
+ env: 'BROWSERFORCE_RETRY_MAX_RETRIES',
67
+ default: 6,
68
+ }),
69
+ 'retry-timeout': Flags.integer({
70
+ helpGroup: 'Retry Configuration',
71
+ summary: 'the inital timeout in milliseconds for retryable actions (exponentially increased)',
72
+ env: 'BROWSERFORCE_RETRY_TIMEOUT_MS',
73
+ default: 4_000,
74
+ }),
75
+ };
76
+ browserforce;
77
+ settings;
78
+ retryConfig;
79
+ async init() {
80
+ await super.init();
81
+ const { flags } = await this.parse({
82
+ baseFlags: BrowserforceCommand.baseFlags,
83
+ });
84
+ let definition;
85
+ if (flags.definitionfile) {
86
+ const definitionFileData = await promises.readFile(path.resolve(flags.definitionfile), 'utf8');
87
+ try {
88
+ definition = JSON.parse(definitionFileData);
89
+ }
90
+ catch (err) {
91
+ throw new Error('Failed parsing config file');
92
+ }
93
+ }
94
+ handleDeprecations(definition);
95
+ this.settings = ConfigParser.parse(DRIVERS, definition);
96
+ const connection = flags['target-org'].getConnection();
97
+ const browserContext = await createBrowserContextFromFlags(flags);
98
+ const options = {
99
+ logger: new Ux({ jsonEnabled: this.jsonEnabled() }),
100
+ retry: createRetryOptionsFromFlags(flags),
101
+ };
102
+ this.browserforce = new Browserforce(connection, browserContext, options);
103
+ this.spinner.start('logging in');
104
+ await this.browserforce.browserContext.tracing.group('login');
105
+ await this.browserforce.login();
106
+ this.spinner.stop();
107
+ await this.browserforce.browserContext.tracing.groupEnd();
108
+ }
109
+ async finally(err) {
110
+ this.spinner.stop(err?.toString());
111
+ if (err?.cause instanceof Error) {
112
+ this.logToStderr(`Cause: ${err.cause.toString()}`);
113
+ }
114
+ if (this.browserforce) {
115
+ this.spinner.start('logging out');
116
+ try {
117
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
118
+ const tracePath = `trace-${timestamp}.zip`;
119
+ await this.browserforce.browserContext.tracing.stop({ path: tracePath });
120
+ this.logToStderr(`Playwright trace saved to: ${tracePath}`);
121
+ }
122
+ catch (_) { }
123
+ await this.browserforce.browserContext.browser().close();
124
+ this.spinner.stop();
125
+ }
126
+ }
127
+ }
128
+ async function createBrowserContextFromFlags(flags) {
129
+ const browser = await chromium.launch({
130
+ ...(flags['browser-channel']
131
+ ? {
132
+ channel: flags['browser-channel'],
133
+ }
134
+ : {}),
135
+ ...(flags['browser-executable-path']
136
+ ? {
137
+ executablePath: flags['browser-executable-path'],
138
+ }
139
+ : {}),
140
+ headless: flags.headless,
141
+ slowMo: flags['slow-mo'],
142
+ });
143
+ const browserContext = await browser.newContext({
144
+ viewport: { width: 1280, height: 1536 },
145
+ });
146
+ browserContext.setDefaultNavigationTimeout(flags.timeout);
147
+ if (flags.trace) {
148
+ await browserContext.tracing.start({
149
+ screenshots: true,
150
+ snapshots: true,
151
+ sources: true,
152
+ });
153
+ }
154
+ return browserContext;
155
+ }
156
+ function createRetryOptionsFromFlags(flags) {
157
+ return {
158
+ retries: flags['max-retries'],
159
+ minTimeout: flags['retry-timeout'],
160
+ };
161
+ }
162
+ //# sourceMappingURL=browserforce-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browserforce-command.js","sourceRoot":"","sources":["../src/browserforce-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OA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AAyB,CAAC;YAClC,CAAC,CAAC;gBACE,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAAC;aACjD;YACH,CAAC,CAAC,EAAE,CAAC;QACP,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;KACzB,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;QAC9C,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;KACxC,CAAC,CAAC;IACH,cAAc,CAAC,2BAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC;YACjC,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACL,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAwB;IAC3D,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,UAAU,EAAE,KAAK,CAAC,eAAe,CAAC;KACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type Connection } from '@salesforce/core';
2
+ import { type Ux } from '@salesforce/sf-plugins-core';
3
+ import { Options as RetryOptions } from 'p-retry';
4
+ import { type BrowserContext, type FrameLocator, type Page } from 'playwright';
5
+ export type SalesforceUrlPath = `/${string}`;
6
+ export type BrowserforceOptions = {
7
+ logger?: Ux;
8
+ retry?: RetryOptions;
9
+ };
10
+ export declare class Browserforce {
11
+ connection: Connection;
12
+ browserContext: BrowserContext;
13
+ logger?: Ux;
14
+ private retryConfig?;
15
+ constructor(connection: Connection, browserContext: BrowserContext, options?: BrowserforceOptions);
16
+ login(): Promise<Browserforce>;
17
+ openPage(urlPath: SalesforceUrlPath): Promise<Page>;
18
+ waitForSelectorInFrameOrPage(page: Page, selector: string): Promise<Page | FrameLocator>;
19
+ getMyDomain(): string | null;
20
+ getInstanceUrl(): string;
21
+ /**
22
+ * @returns the setup url (e.g. https://[MyDomainName].my.salesforce-setup.com)
23
+ */
24
+ getLightningSetupUrl(): Promise<string>;
25
+ retry<T>(input: (attemptCount: number) => PromiseLike<T> | T): Promise<T>;
26
+ }
27
+ export declare function waitForPageErrors(page: Page | FrameLocator, timeout?: number): Promise<void>;