@azure/playwright 1.1.4 → 1.1.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.
Files changed (332) hide show
  1. package/README.md +10 -18
  2. package/dist/commonjs/common/constants.d.ts +7 -1
  3. package/dist/commonjs/common/constants.d.ts.map +1 -1
  4. package/dist/commonjs/common/constants.js +11 -1
  5. package/dist/commonjs/common/constants.js.map +1 -1
  6. package/dist/commonjs/common/entraIdAccessToken.d.ts +6 -0
  7. package/dist/commonjs/common/entraIdAccessToken.d.ts.map +1 -1
  8. package/dist/commonjs/common/entraIdAccessToken.js +24 -0
  9. package/dist/commonjs/common/entraIdAccessToken.js.map +1 -1
  10. package/dist/commonjs/common/messages.d.ts +4 -0
  11. package/dist/commonjs/common/messages.d.ts.map +1 -1
  12. package/dist/commonjs/common/messages.js +6 -0
  13. package/dist/commonjs/common/messages.js.map +1 -1
  14. package/dist/commonjs/common/playwrightServiceConfig.d.ts +2 -1
  15. package/dist/commonjs/common/playwrightServiceConfig.d.ts.map +1 -1
  16. package/dist/commonjs/common/playwrightServiceConfig.js +5 -0
  17. package/dist/commonjs/common/playwrightServiceConfig.js.map +1 -1
  18. package/dist/commonjs/common/types.d.ts +15 -0
  19. package/dist/commonjs/common/types.d.ts.map +1 -1
  20. package/dist/commonjs/common/types.js.map +1 -1
  21. package/dist/commonjs/core/playwrightService.d.ts.map +1 -1
  22. package/dist/commonjs/core/playwrightService.js +7 -7
  23. package/dist/commonjs/core/playwrightService.js.map +1 -1
  24. package/dist/commonjs/core/playwrightServiceEntra.d.ts.map +1 -1
  25. package/dist/commonjs/core/playwrightServiceEntra.js +1 -0
  26. package/dist/commonjs/core/playwrightServiceEntra.js.map +1 -1
  27. package/dist/{browser/core/playwrightServiceUtils.d.ts → commonjs/core/playwrightServiceUtils-cjs.d.ts} +1 -1
  28. package/dist/commonjs/core/playwrightServiceUtils-cjs.d.ts.map +1 -0
  29. package/dist/commonjs/core/playwrightServiceUtils-cjs.js +14 -0
  30. package/dist/commonjs/core/playwrightServiceUtils-cjs.js.map +1 -0
  31. package/dist/commonjs/index.d.ts +2 -2
  32. package/dist/commonjs/index.d.ts.map +1 -1
  33. package/dist/commonjs/index.js.map +1 -1
  34. package/dist/commonjs/reporter/playwrightReporter.d.ts.map +1 -1
  35. package/dist/commonjs/reporter/playwrightReporter.js +12 -11
  36. package/dist/commonjs/reporter/playwrightReporter.js.map +1 -1
  37. package/dist/commonjs/tsdoc-metadata.json +1 -1
  38. package/dist/{browser/utils/getPackageVersion.d.ts → commonjs/utils/getPackageVersion-cjs.d.ts} +1 -1
  39. package/dist/commonjs/utils/getPackageVersion-cjs.d.ts.map +1 -0
  40. package/dist/commonjs/utils/{getPackageVersion.js → getPackageVersion-cjs.js} +1 -1
  41. package/dist/commonjs/utils/getPackageVersion-cjs.js.map +1 -0
  42. package/dist/commonjs/utils/parseJwt.d.ts.map +1 -1
  43. package/dist/commonjs/utils/parseJwt.js +2 -3
  44. package/dist/commonjs/utils/parseJwt.js.map +1 -1
  45. package/dist/commonjs/utils/utils.d.ts +3 -2
  46. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  47. package/dist/commonjs/utils/utils.js +33 -6
  48. package/dist/commonjs/utils/utils.js.map +1 -1
  49. package/dist/esm/common/constants.d.ts +7 -1
  50. package/dist/esm/common/constants.d.ts.map +1 -1
  51. package/dist/esm/common/constants.js +10 -0
  52. package/dist/esm/common/constants.js.map +1 -1
  53. package/dist/esm/common/entraIdAccessToken.d.ts +6 -0
  54. package/dist/esm/common/entraIdAccessToken.d.ts.map +1 -1
  55. package/dist/esm/common/entraIdAccessToken.js +24 -0
  56. package/dist/esm/common/entraIdAccessToken.js.map +1 -1
  57. package/dist/esm/common/messages.d.ts +4 -0
  58. package/dist/esm/common/messages.d.ts.map +1 -1
  59. package/dist/esm/common/messages.js +6 -0
  60. package/dist/esm/common/messages.js.map +1 -1
  61. package/dist/esm/common/playwrightServiceConfig.d.ts +2 -1
  62. package/dist/esm/common/playwrightServiceConfig.d.ts.map +1 -1
  63. package/dist/esm/common/playwrightServiceConfig.js +6 -1
  64. package/dist/esm/common/playwrightServiceConfig.js.map +1 -1
  65. package/dist/esm/common/types.d.ts +15 -0
  66. package/dist/esm/common/types.d.ts.map +1 -1
  67. package/dist/esm/common/types.js.map +1 -1
  68. package/dist/esm/core/playwrightService.d.ts.map +1 -1
  69. package/dist/esm/core/playwrightService.js +2 -2
  70. package/dist/esm/core/playwrightService.js.map +1 -1
  71. package/dist/esm/core/playwrightServiceEntra.d.ts.map +1 -1
  72. package/dist/esm/core/playwrightServiceEntra.js +1 -0
  73. package/dist/esm/core/playwrightServiceEntra.js.map +1 -1
  74. package/dist/esm/core/playwrightServiceUtils.d.ts.map +1 -1
  75. package/dist/esm/core/playwrightServiceUtils.js +4 -2
  76. package/dist/esm/core/playwrightServiceUtils.js.map +1 -1
  77. package/dist/esm/index.d.ts +2 -2
  78. package/dist/esm/index.d.ts.map +1 -1
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/esm/reporter/playwrightReporter.d.ts.map +1 -1
  81. package/dist/esm/reporter/playwrightReporter.js +13 -12
  82. package/dist/esm/reporter/playwrightReporter.js.map +1 -1
  83. package/dist/esm/utils/getPackageVersion.d.ts.map +1 -1
  84. package/dist/esm/utils/getPackageVersion.js +2 -2
  85. package/dist/esm/utils/getPackageVersion.js.map +1 -1
  86. package/dist/esm/utils/parseJwt.d.ts.map +1 -1
  87. package/dist/esm/utils/parseJwt.js +2 -3
  88. package/dist/esm/utils/parseJwt.js.map +1 -1
  89. package/dist/esm/utils/utils.d.ts +3 -2
  90. package/dist/esm/utils/utils.d.ts.map +1 -1
  91. package/dist/esm/utils/utils.js +29 -3
  92. package/dist/esm/utils/utils.js.map +1 -1
  93. package/package.json +18 -26
  94. package/dist/browser/common/constants.d.ts +0 -103
  95. package/dist/browser/common/constants.d.ts.map +0 -1
  96. package/dist/browser/common/constants.js +0 -105
  97. package/dist/browser/common/constants.js.map +0 -1
  98. package/dist/browser/common/customerConfig.d.ts +0 -8
  99. package/dist/browser/common/customerConfig.d.ts.map +0 -1
  100. package/dist/browser/common/customerConfig.js +0 -16
  101. package/dist/browser/common/customerConfig.js.map +0 -1
  102. package/dist/browser/common/entraIdAccessToken.d.ts +0 -13
  103. package/dist/browser/common/entraIdAccessToken.d.ts.map +0 -1
  104. package/dist/browser/common/entraIdAccessToken.js +0 -84
  105. package/dist/browser/common/entraIdAccessToken.js.map +0 -1
  106. package/dist/browser/common/environmentVariables.d.ts +0 -12
  107. package/dist/browser/common/environmentVariables.d.ts.map +0 -1
  108. package/dist/browser/common/environmentVariables.js +0 -22
  109. package/dist/browser/common/environmentVariables.js.map +0 -1
  110. package/dist/browser/common/executor.d.ts +0 -2
  111. package/dist/browser/common/executor.d.ts.map +0 -1
  112. package/dist/browser/common/executor.js +0 -73
  113. package/dist/browser/common/executor.js.map +0 -1
  114. package/dist/browser/common/httpService.d.ts +0 -5
  115. package/dist/browser/common/httpService.d.ts.map +0 -1
  116. package/dist/browser/common/httpService.js +0 -34
  117. package/dist/browser/common/httpService.js.map +0 -1
  118. package/dist/browser/common/logger.d.ts +0 -2
  119. package/dist/browser/common/logger.d.ts.map +0 -1
  120. package/dist/browser/common/logger.js +0 -5
  121. package/dist/browser/common/logger.js.map +0 -1
  122. package/dist/browser/common/messages.d.ts +0 -165
  123. package/dist/browser/common/messages.d.ts.map +0 -1
  124. package/dist/browser/common/messages.js +0 -167
  125. package/dist/browser/common/messages.js.map +0 -1
  126. package/dist/browser/common/playwrightServiceConfig.d.ts +0 -22
  127. package/dist/browser/common/playwrightServiceConfig.d.ts.map +0 -1
  128. package/dist/browser/common/playwrightServiceConfig.js +0 -102
  129. package/dist/browser/common/playwrightServiceConfig.js.map +0 -1
  130. package/dist/browser/common/state.d.ts +0 -2
  131. package/dist/browser/common/state.d.ts.map +0 -1
  132. package/dist/browser/common/state.js +0 -9
  133. package/dist/browser/common/state.js.map +0 -1
  134. package/dist/browser/common/types.d.ts +0 -207
  135. package/dist/browser/common/types.d.ts.map +0 -1
  136. package/dist/browser/common/types.js +0 -4
  137. package/dist/browser/common/types.js.map +0 -1
  138. package/dist/browser/core/global/playwright-service-global-setup.d.ts +0 -4
  139. package/dist/browser/core/global/playwright-service-global-setup.d.ts.map +0 -1
  140. package/dist/browser/core/global/playwright-service-global-setup.js +0 -25
  141. package/dist/browser/core/global/playwright-service-global-setup.js.map +0 -1
  142. package/dist/browser/core/global/playwright-service-global-teardown.d.ts +0 -4
  143. package/dist/browser/core/global/playwright-service-global-teardown.d.ts.map +0 -1
  144. package/dist/browser/core/global/playwright-service-global-teardown.js +0 -19
  145. package/dist/browser/core/global/playwright-service-global-teardown.js.map +0 -1
  146. package/dist/browser/core/initializePlaywrightServiceTestRun.d.ts +0 -9
  147. package/dist/browser/core/initializePlaywrightServiceTestRun.d.ts.map +0 -1
  148. package/dist/browser/core/initializePlaywrightServiceTestRun.js +0 -26
  149. package/dist/browser/core/initializePlaywrightServiceTestRun.js.map +0 -1
  150. package/dist/browser/core/playwrightService.d.ts +0 -66
  151. package/dist/browser/core/playwrightService.d.ts.map +0 -1
  152. package/dist/browser/core/playwrightService.js +0 -219
  153. package/dist/browser/core/playwrightService.js.map +0 -1
  154. package/dist/browser/core/playwrightServiceEntra.d.ts +0 -15
  155. package/dist/browser/core/playwrightServiceEntra.d.ts.map +0 -1
  156. package/dist/browser/core/playwrightServiceEntra.js +0 -52
  157. package/dist/browser/core/playwrightServiceEntra.js.map +0 -1
  158. package/dist/browser/core/playwrightServiceUtils.d.ts.map +0 -1
  159. package/dist/browser/core/playwrightServiceUtils.js +0 -13
  160. package/dist/browser/core/playwrightServiceUtils.js.map +0 -1
  161. package/dist/browser/index.d.ts +0 -10
  162. package/dist/browser/index.d.ts.map +0 -1
  163. package/dist/browser/index.js +0 -11
  164. package/dist/browser/index.js.map +0 -1
  165. package/dist/browser/package.json +0 -3
  166. package/dist/browser/reporter/index.d.ts +0 -10
  167. package/dist/browser/reporter/index.d.ts.map +0 -1
  168. package/dist/browser/reporter/index.js +0 -12
  169. package/dist/browser/reporter/index.js.map +0 -1
  170. package/dist/browser/reporter/playwrightReporter.d.ts +0 -28
  171. package/dist/browser/reporter/playwrightReporter.d.ts.map +0 -1
  172. package/dist/browser/reporter/playwrightReporter.js +0 -210
  173. package/dist/browser/reporter/playwrightReporter.js.map +0 -1
  174. package/dist/browser/utils/PlaywrightServiceClient.d.ts +0 -9
  175. package/dist/browser/utils/PlaywrightServiceClient.d.ts.map +0 -1
  176. package/dist/browser/utils/PlaywrightServiceClient.js +0 -67
  177. package/dist/browser/utils/PlaywrightServiceClient.js.map +0 -1
  178. package/dist/browser/utils/cIInfoProvider.d.ts +0 -20
  179. package/dist/browser/utils/cIInfoProvider.d.ts.map +0 -1
  180. package/dist/browser/utils/cIInfoProvider.js +0 -75
  181. package/dist/browser/utils/cIInfoProvider.js.map +0 -1
  182. package/dist/browser/utils/getPackageVersion.d.ts.map +0 -1
  183. package/dist/browser/utils/getPackageVersion.js +0 -23
  184. package/dist/browser/utils/getPackageVersion.js.map +0 -1
  185. package/dist/browser/utils/getPlaywrightVersion.d.ts +0 -2
  186. package/dist/browser/utils/getPlaywrightVersion.d.ts.map +0 -1
  187. package/dist/browser/utils/getPlaywrightVersion.js +0 -19
  188. package/dist/browser/utils/getPlaywrightVersion.js.map +0 -1
  189. package/dist/browser/utils/packageManager.d.ts +0 -15
  190. package/dist/browser/utils/packageManager.d.ts.map +0 -1
  191. package/dist/browser/utils/packageManager.js +0 -41
  192. package/dist/browser/utils/packageManager.js.map +0 -1
  193. package/dist/browser/utils/parseJwt.d.ts +0 -4
  194. package/dist/browser/utils/parseJwt.d.ts.map +0 -1
  195. package/dist/browser/utils/parseJwt.js +0 -16
  196. package/dist/browser/utils/parseJwt.js.map +0 -1
  197. package/dist/browser/utils/playwrightReporterStorageManager.d.ts +0 -13
  198. package/dist/browser/utils/playwrightReporterStorageManager.d.ts.map +0 -1
  199. package/dist/browser/utils/playwrightReporterStorageManager.js +0 -452
  200. package/dist/browser/utils/playwrightReporterStorageManager.js.map +0 -1
  201. package/dist/browser/utils/utils.d.ts +0 -57
  202. package/dist/browser/utils/utils.d.ts.map +0 -1
  203. package/dist/browser/utils/utils.js +0 -392
  204. package/dist/browser/utils/utils.js.map +0 -1
  205. package/dist/commonjs/common/environmentVariables.d.ts +0 -12
  206. package/dist/commonjs/common/environmentVariables.d.ts.map +0 -1
  207. package/dist/commonjs/common/environmentVariables.js +0 -26
  208. package/dist/commonjs/common/environmentVariables.js.map +0 -1
  209. package/dist/commonjs/core/playwrightServiceUtils.d.ts +0 -5
  210. package/dist/commonjs/core/playwrightServiceUtils.d.ts.map +0 -1
  211. package/dist/commonjs/core/playwrightServiceUtils.js +0 -12
  212. package/dist/commonjs/core/playwrightServiceUtils.js.map +0 -1
  213. package/dist/commonjs/utils/getPackageVersion.d.ts +0 -2
  214. package/dist/commonjs/utils/getPackageVersion.d.ts.map +0 -1
  215. package/dist/commonjs/utils/getPackageVersion.js.map +0 -1
  216. package/dist/esm/common/environmentVariables.d.ts +0 -12
  217. package/dist/esm/common/environmentVariables.d.ts.map +0 -1
  218. package/dist/esm/common/environmentVariables.js +0 -22
  219. package/dist/esm/common/environmentVariables.js.map +0 -1
  220. package/dist/react-native/common/constants.d.ts +0 -103
  221. package/dist/react-native/common/constants.d.ts.map +0 -1
  222. package/dist/react-native/common/constants.js +0 -105
  223. package/dist/react-native/common/constants.js.map +0 -1
  224. package/dist/react-native/common/customerConfig.d.ts +0 -8
  225. package/dist/react-native/common/customerConfig.d.ts.map +0 -1
  226. package/dist/react-native/common/customerConfig.js +0 -16
  227. package/dist/react-native/common/customerConfig.js.map +0 -1
  228. package/dist/react-native/common/entraIdAccessToken.d.ts +0 -13
  229. package/dist/react-native/common/entraIdAccessToken.d.ts.map +0 -1
  230. package/dist/react-native/common/entraIdAccessToken.js +0 -84
  231. package/dist/react-native/common/entraIdAccessToken.js.map +0 -1
  232. package/dist/react-native/common/environmentVariables.d.ts +0 -12
  233. package/dist/react-native/common/environmentVariables.d.ts.map +0 -1
  234. package/dist/react-native/common/environmentVariables.js +0 -22
  235. package/dist/react-native/common/environmentVariables.js.map +0 -1
  236. package/dist/react-native/common/executor.d.ts +0 -2
  237. package/dist/react-native/common/executor.d.ts.map +0 -1
  238. package/dist/react-native/common/executor.js +0 -73
  239. package/dist/react-native/common/executor.js.map +0 -1
  240. package/dist/react-native/common/httpService.d.ts +0 -5
  241. package/dist/react-native/common/httpService.d.ts.map +0 -1
  242. package/dist/react-native/common/httpService.js +0 -34
  243. package/dist/react-native/common/httpService.js.map +0 -1
  244. package/dist/react-native/common/logger.d.ts +0 -2
  245. package/dist/react-native/common/logger.d.ts.map +0 -1
  246. package/dist/react-native/common/logger.js +0 -5
  247. package/dist/react-native/common/logger.js.map +0 -1
  248. package/dist/react-native/common/messages.d.ts +0 -165
  249. package/dist/react-native/common/messages.d.ts.map +0 -1
  250. package/dist/react-native/common/messages.js +0 -167
  251. package/dist/react-native/common/messages.js.map +0 -1
  252. package/dist/react-native/common/playwrightServiceConfig.d.ts +0 -22
  253. package/dist/react-native/common/playwrightServiceConfig.d.ts.map +0 -1
  254. package/dist/react-native/common/playwrightServiceConfig.js +0 -102
  255. package/dist/react-native/common/playwrightServiceConfig.js.map +0 -1
  256. package/dist/react-native/common/state.d.ts +0 -2
  257. package/dist/react-native/common/state.d.ts.map +0 -1
  258. package/dist/react-native/common/state.js +0 -9
  259. package/dist/react-native/common/state.js.map +0 -1
  260. package/dist/react-native/common/types.d.ts +0 -207
  261. package/dist/react-native/common/types.d.ts.map +0 -1
  262. package/dist/react-native/common/types.js +0 -4
  263. package/dist/react-native/common/types.js.map +0 -1
  264. package/dist/react-native/core/global/playwright-service-global-setup.d.ts +0 -4
  265. package/dist/react-native/core/global/playwright-service-global-setup.d.ts.map +0 -1
  266. package/dist/react-native/core/global/playwright-service-global-setup.js +0 -25
  267. package/dist/react-native/core/global/playwright-service-global-setup.js.map +0 -1
  268. package/dist/react-native/core/global/playwright-service-global-teardown.d.ts +0 -4
  269. package/dist/react-native/core/global/playwright-service-global-teardown.d.ts.map +0 -1
  270. package/dist/react-native/core/global/playwright-service-global-teardown.js +0 -19
  271. package/dist/react-native/core/global/playwright-service-global-teardown.js.map +0 -1
  272. package/dist/react-native/core/initializePlaywrightServiceTestRun.d.ts +0 -9
  273. package/dist/react-native/core/initializePlaywrightServiceTestRun.d.ts.map +0 -1
  274. package/dist/react-native/core/initializePlaywrightServiceTestRun.js +0 -26
  275. package/dist/react-native/core/initializePlaywrightServiceTestRun.js.map +0 -1
  276. package/dist/react-native/core/playwrightService.d.ts +0 -66
  277. package/dist/react-native/core/playwrightService.d.ts.map +0 -1
  278. package/dist/react-native/core/playwrightService.js +0 -219
  279. package/dist/react-native/core/playwrightService.js.map +0 -1
  280. package/dist/react-native/core/playwrightServiceEntra.d.ts +0 -15
  281. package/dist/react-native/core/playwrightServiceEntra.d.ts.map +0 -1
  282. package/dist/react-native/core/playwrightServiceEntra.js +0 -52
  283. package/dist/react-native/core/playwrightServiceEntra.js.map +0 -1
  284. package/dist/react-native/core/playwrightServiceUtils.d.ts +0 -5
  285. package/dist/react-native/core/playwrightServiceUtils.d.ts.map +0 -1
  286. package/dist/react-native/core/playwrightServiceUtils.js +0 -13
  287. package/dist/react-native/core/playwrightServiceUtils.js.map +0 -1
  288. package/dist/react-native/index.d.ts +0 -10
  289. package/dist/react-native/index.d.ts.map +0 -1
  290. package/dist/react-native/index.js +0 -11
  291. package/dist/react-native/index.js.map +0 -1
  292. package/dist/react-native/package.json +0 -3
  293. package/dist/react-native/reporter/index.d.ts +0 -10
  294. package/dist/react-native/reporter/index.d.ts.map +0 -1
  295. package/dist/react-native/reporter/index.js +0 -12
  296. package/dist/react-native/reporter/index.js.map +0 -1
  297. package/dist/react-native/reporter/playwrightReporter.d.ts +0 -28
  298. package/dist/react-native/reporter/playwrightReporter.d.ts.map +0 -1
  299. package/dist/react-native/reporter/playwrightReporter.js +0 -210
  300. package/dist/react-native/reporter/playwrightReporter.js.map +0 -1
  301. package/dist/react-native/utils/PlaywrightServiceClient.d.ts +0 -9
  302. package/dist/react-native/utils/PlaywrightServiceClient.d.ts.map +0 -1
  303. package/dist/react-native/utils/PlaywrightServiceClient.js +0 -67
  304. package/dist/react-native/utils/PlaywrightServiceClient.js.map +0 -1
  305. package/dist/react-native/utils/cIInfoProvider.d.ts +0 -20
  306. package/dist/react-native/utils/cIInfoProvider.d.ts.map +0 -1
  307. package/dist/react-native/utils/cIInfoProvider.js +0 -75
  308. package/dist/react-native/utils/cIInfoProvider.js.map +0 -1
  309. package/dist/react-native/utils/getPackageVersion.d.ts +0 -2
  310. package/dist/react-native/utils/getPackageVersion.d.ts.map +0 -1
  311. package/dist/react-native/utils/getPackageVersion.js +0 -23
  312. package/dist/react-native/utils/getPackageVersion.js.map +0 -1
  313. package/dist/react-native/utils/getPlaywrightVersion.d.ts +0 -2
  314. package/dist/react-native/utils/getPlaywrightVersion.d.ts.map +0 -1
  315. package/dist/react-native/utils/getPlaywrightVersion.js +0 -19
  316. package/dist/react-native/utils/getPlaywrightVersion.js.map +0 -1
  317. package/dist/react-native/utils/packageManager.d.ts +0 -15
  318. package/dist/react-native/utils/packageManager.d.ts.map +0 -1
  319. package/dist/react-native/utils/packageManager.js +0 -41
  320. package/dist/react-native/utils/packageManager.js.map +0 -1
  321. package/dist/react-native/utils/parseJwt.d.ts +0 -4
  322. package/dist/react-native/utils/parseJwt.d.ts.map +0 -1
  323. package/dist/react-native/utils/parseJwt.js +0 -16
  324. package/dist/react-native/utils/parseJwt.js.map +0 -1
  325. package/dist/react-native/utils/playwrightReporterStorageManager.d.ts +0 -13
  326. package/dist/react-native/utils/playwrightReporterStorageManager.d.ts.map +0 -1
  327. package/dist/react-native/utils/playwrightReporterStorageManager.js +0 -452
  328. package/dist/react-native/utils/playwrightReporterStorageManager.js.map +0 -1
  329. package/dist/react-native/utils/utils.d.ts +0 -57
  330. package/dist/react-native/utils/utils.d.ts.map +0 -1
  331. package/dist/react-native/utils/utils.js +0 -392
  332. package/dist/react-native/utils/utils.js.map +0 -1
package/README.md CHANGED
@@ -163,26 +163,18 @@ The Azure Playwright reporter is included with the `@azure/playwright` package a
163
163
  Add both the HTML reporter and Azure Playwright reporter to your `playwright.service.config.ts`:
164
164
 
165
165
  ```typescript snippet:configure_reporters
166
- import { getServiceConfig, PlaywrightReporter } from "@azure/playwright";
167
- import { defineConfig } from "@playwright/test";
168
166
  import { DefaultAzureCredential } from "@azure/identity";
169
-
170
- // <snippet_configure_reporters>
171
- import { getServiceConfig, PlaywrightReporter } from "@azure/playwright";
172
167
  import { defineConfig } from "@playwright/test";
173
- import { DefaultAzureCredential } from "@azure/identity";
174
- export default defineConfig(
175
- getServiceConfig({
176
- // Your existing configuration
177
- credential: new DefaultAzureCredential(),
178
- }),
179
- {
180
- reporter: [
181
- ["html", { open: "never" }], // HTML reporter must come first
182
- ["@azure/playwright/reporter"], // Azure reporter uploads HTML report
183
- ],
184
- },
185
- );
168
+ import { createAzurePlaywrightConfig } from "@azure/playwright";
169
+
170
+ const credential = new DefaultAzureCredential();
171
+ const playwrightConfig = defineConfig({});
172
+ defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig, { credential }), {
173
+ reporter: [
174
+ ["html", { open: "never" }], // HTML reporter must come first
175
+ ["@azure/playwright/reporter"], // Azure reporter uploads HTML report
176
+ ],
177
+ });
186
178
  ```
187
179
 
188
180
  #### 2. Prerequisites for Reporting
@@ -1,6 +1,7 @@
1
1
  export declare const EntraIdAccessTokenConstants: {
2
2
  LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: number;
3
3
  SCOPE: string;
4
+ STORAGE_SCOPE: string;
4
5
  ROTATION_INTERVAL_PERIOD_IN_MINUTES: number;
5
6
  };
6
7
  /** @public
@@ -98,6 +99,11 @@ export declare const UploadConstants: {
98
99
  RETRY_BASE_DELAY: number;
99
100
  };
100
101
  export declare const BrowserSessionSourceType: {
101
- PLAYWRIGHT_WORKSPACES_TEST_RUN: string;
102
+ readonly PLAYWRIGHT_WORKSPACES_TEST_RUN: "PlaywrightWorkspacesTestRun";
103
+ readonly OTHERS: "Others";
104
+ };
105
+ export declare const StorageUriValidationConstants: {
106
+ AllowedProtocol: string;
107
+ AllowedHostnameSuffixes: readonly [".blob.core.windows.net", ".blob.core.usgovcloudapi.net", ".blob.core.chinacloudapi.cn"];
102
108
  };
103
109
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;CAM1C,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;CAexB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAWxC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;CAEpC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;CAM1C,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;CAexB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAWxC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;CAOzC,CAAC"}
@@ -2,10 +2,11 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.BrowserSessionSourceType = exports.UploadConstants = exports.InternalEnvironmentVariables = exports.UrlConstants = exports.Constants = exports.RunConfigConstants = exports.SDKLanguage = exports.DefaultConnectOptionsConstants = exports.GitHubActionsConstants = exports.ServiceEnvironmentVariable = exports.ServiceAuth = exports.ServiceOS = exports.EntraIdAccessTokenConstants = void 0;
5
+ exports.StorageUriValidationConstants = exports.BrowserSessionSourceType = exports.UploadConstants = exports.InternalEnvironmentVariables = exports.UrlConstants = exports.Constants = exports.RunConfigConstants = exports.SDKLanguage = exports.DefaultConnectOptionsConstants = exports.GitHubActionsConstants = exports.ServiceEnvironmentVariable = exports.ServiceAuth = exports.ServiceOS = exports.EntraIdAccessTokenConstants = void 0;
6
6
  exports.EntraIdAccessTokenConstants = {
7
7
  LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,
8
8
  SCOPE: "https://management.core.windows.net/.default",
9
+ STORAGE_SCOPE: "https://storage.azure.com/.default",
9
10
  ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,
10
11
  };
11
12
  /** @public
@@ -104,5 +105,14 @@ exports.UploadConstants = {
104
105
  };
105
106
  exports.BrowserSessionSourceType = {
106
107
  PLAYWRIGHT_WORKSPACES_TEST_RUN: "PlaywrightWorkspacesTestRun",
108
+ OTHERS: "Others",
109
+ };
110
+ exports.StorageUriValidationConstants = {
111
+ AllowedProtocol: "https:",
112
+ AllowedHostnameSuffixes: [
113
+ ".blob.core.windows.net",
114
+ ".blob.core.usgovcloudapi.net",
115
+ ".blob.core.chinacloudapi.cn",
116
+ ],
107
117
  };
108
118
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,+BAA+B,EAAE,iCAAiC;IAClE,sBAAsB,EAAE,wBAAwB;CACjD,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,mBAAmB,EAAE,eAAe;IACpC,aAAa,EAAE,qCAAqC;IACpD,0BAA0B,EAAE,iCAAiC;CAC9D,CAAC;AAEW,QAAA,8BAA8B,GAAG;IAC5C,eAAe,EAAE,KAAK;IACtB,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,YAAY;IACpC,kBAAkB,EAAE,iBAAS,CAAC,KAAK;IACnC,yBAAyB,EAAE,mBAAW,CAAC,QAAQ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gCAAgC;CAC5D,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,oBAAoB,EAAE,IAAI,GAAG,IAAI;IACjC,oBAAoB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACvC,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,EAAE;IACnB,oBAAoB,EAAE,EAAE;IACxB,sBAAsB,EAAE,CAAC;IACzB,UAAU,EAAE,GAAG;IACf,oBAAoB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACrC,kBAAkB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACnC,kBAAkB,EAAE,CAAC;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,8BAA8B,EAAE,6BAA6B;CAC9D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Azure Playwright cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Azure Playwright\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Azure Playwright\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const GitHubActionsConstants = {\n GIT_VERSION_COMMAND: \"git --version\",\n GIT_REV_PARSE: \"git rev-parse --is-inside-work-tree\",\n GIT_COMMIT_MESSAGE_COMMAND: 'git log -1 --pretty=format:\"%s\"',\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n DEFAULT_SERVICE_AUTH_TYPE: ServiceAuth.ENTRA_ID,\n};\n\nexport const SDKLanguage = {\n JAVASCRIPT: \"JAVASCRIPT\",\n TYPESCRIPT: \"TYPESCRIPT\",\n CSHARP: \"CSHARP\",\n};\n\nexport const RunConfigConstants = {\n TEST_FRAMEWORK_NAME: \"PLAYWRIGHT\",\n TEST_SDK_LANGUAGE: SDKLanguage.JAVASCRIPT,\n TEST_FRAMEWORK_RUNNERNAME: \"PLAYWRIGHT\",\n};\n\nexport const Constants = {\n SevenDaysInMS: 7 * 24 * 60 * 60 * 1000,\n OneDayInMS: 24 * 60 * 60 * 1000,\n MinimumSupportedPlaywrightVersion: \"1.47.0\",\n LatestAPIVersion: \"2025-09-01\",\n HTTP_CALL_TIMEOUT: 10000,\n};\n\nexport const UrlConstants = {\n AzurePortalBaseUrl: \"https://ms.portal.azure.com\",\n ReportingApiSubdomain: \"reporting.api\",\n ApiSubdomain: \"api\",\n PlaywrightWorkspacesPath: \"playwrightworkspaces\",\n TestRunsPath: \"test-runs\",\n LoadTestServiceProvider: \"Microsoft.LoadTestService\",\n PlaywrightWorkspacesResourceType: \"playwrightWorkspaces\",\n TestRunsRoute: \"TestRuns\",\n ResourceGroupsPath: \"resourcegroups\",\n ResourcePath: \"/resource\",\n SubscriptionsPath: \"/subscriptions\",\n ResourceGroupsUrlPath: \"/resourceGroups\",\n ProvidersPath: \"/providers\",\n TestReportViewPath: \"#view/Microsoft_Azure_CloudNativeTesting/TestReport.ReactView\",\n};\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_API_VERSION: \"_MPT_API_VERSION\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n USING_SERVICE_CONFIG: \"_USING_SERVICE_CONFIG\",\n TEST_RUN_CREATION_SUCCESS: \"_MPT_TEST_RUN_CREATION_SUCCESS\",\n};\n\nexport const UploadConstants = {\n SMALL_FILE_THRESHOLD: 1024 * 1024,\n LARGE_FILE_THRESHOLD: 100 * 1024 * 1024,\n BASE_CONCURRENCY: 20,\n MAX_CONCURRENCY: 50,\n PER_FILE_CONCURRENCY: 10,\n LARGE_FILE_CONCURRENCY: 5,\n BATCH_SIZE: 100,\n OPTIMIZED_BLOCK_SIZE: 8 * 1024 * 1024,\n STREAM_BUFFER_SIZE: 4 * 1024 * 1024,\n MAX_RETRY_ATTEMPTS: 3,\n RETRY_BASE_DELAY: 1000,\n};\n\nexport const BrowserSessionSourceType = {\n PLAYWRIGHT_WORKSPACES_TEST_RUN: \"PlaywrightWorkspacesTestRun\",\n};\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,aAAa,EAAE,oCAAoC;IACnD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,WAAW,GA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AAkB,EAAE,gBAAgB;IACpC,YAAY,EAAE,WAAW;IACzB,iBAAiB,EAAE,gBAAgB;IACnC,qBAAqB,EAAE,iBAAiB;IACxC,aAAa,EAAE,YAAY;IAC3B,kBAAkB,EAAE,+DAA+D;CACpF,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,eAAe,EAAE,kBAAkB;IACnC,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;IAC/D,cAAc,EAAE,iBAAiB;IACjC,uBAAuB,EAAE,0BAA0B;IACnD,oBAAoB,EAAE,uBAAuB;IAC7C,yBAAyB,EAAE,gCAAgC;CAC5D,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,oBAAoB,EAAE,IAAI,GAAG,IAAI;IACjC,oBAAoB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACvC,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,EAAE;IACnB,oBAAoB,EAAE,EAAE;IACxB,sBAAsB,EAAE,CAAC;IACzB,UAAU,EAAE,GAAG;IACf,oBAAoB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACrC,kBAAkB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACnC,kBAAkB,EAAE,CAAC;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,8BAA8B,EAAE,6BAA6B;IAC7D,MAAM,EAAE,QAAQ;CACR,CAAC;AAEE,QAAA,6BAA6B,GAAG;IAC3C,eAAe,EAAE,QAAQ;IACzB,uBAAuB,EAAE;QACvB,wBAAwB;QACxB,8BAA8B;QAC9B,6BAA6B;KACrB;CACX,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n STORAGE_SCOPE: \"https://storage.azure.com/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Azure Playwright cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Azure Playwright\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Azure Playwright\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const GitHubActionsConstants = {\n GIT_VERSION_COMMAND: \"git --version\",\n GIT_REV_PARSE: \"git rev-parse --is-inside-work-tree\",\n GIT_COMMIT_MESSAGE_COMMAND: 'git log -1 --pretty=format:\"%s\"',\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n DEFAULT_SERVICE_AUTH_TYPE: ServiceAuth.ENTRA_ID,\n};\n\nexport const SDKLanguage = {\n JAVASCRIPT: \"JAVASCRIPT\",\n TYPESCRIPT: \"TYPESCRIPT\",\n CSHARP: \"CSHARP\",\n};\n\nexport const RunConfigConstants = {\n TEST_FRAMEWORK_NAME: \"PLAYWRIGHT\",\n TEST_SDK_LANGUAGE: SDKLanguage.JAVASCRIPT,\n TEST_FRAMEWORK_RUNNERNAME: \"PLAYWRIGHT\",\n};\n\nexport const Constants = {\n SevenDaysInMS: 7 * 24 * 60 * 60 * 1000,\n OneDayInMS: 24 * 60 * 60 * 1000,\n MinimumSupportedPlaywrightVersion: \"1.47.0\",\n LatestAPIVersion: \"2025-09-01\",\n HTTP_CALL_TIMEOUT: 10000,\n};\n\nexport const UrlConstants = {\n AzurePortalBaseUrl: \"https://ms.portal.azure.com\",\n ReportingApiSubdomain: \"reporting.api\",\n ApiSubdomain: \"api\",\n PlaywrightWorkspacesPath: \"playwrightworkspaces\",\n TestRunsPath: \"test-runs\",\n LoadTestServiceProvider: \"Microsoft.LoadTestService\",\n PlaywrightWorkspacesResourceType: \"playwrightWorkspaces\",\n TestRunsRoute: \"TestRuns\",\n ResourceGroupsPath: \"resourcegroups\",\n ResourcePath: \"/resource\",\n SubscriptionsPath: \"/subscriptions\",\n ResourceGroupsUrlPath: \"/resourceGroups\",\n ProvidersPath: \"/providers\",\n TestReportViewPath: \"#view/Microsoft_Azure_CloudNativeTesting/TestReport.ReactView\",\n};\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_API_VERSION: \"_MPT_API_VERSION\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n USING_SERVICE_CONFIG: \"_USING_SERVICE_CONFIG\",\n TEST_RUN_CREATION_SUCCESS: \"_MPT_TEST_RUN_CREATION_SUCCESS\",\n};\n\nexport const UploadConstants = {\n SMALL_FILE_THRESHOLD: 1024 * 1024,\n LARGE_FILE_THRESHOLD: 100 * 1024 * 1024,\n BASE_CONCURRENCY: 20,\n MAX_CONCURRENCY: 50,\n PER_FILE_CONCURRENCY: 10,\n LARGE_FILE_CONCURRENCY: 5,\n BATCH_SIZE: 100,\n OPTIMIZED_BLOCK_SIZE: 8 * 1024 * 1024,\n STREAM_BUFFER_SIZE: 4 * 1024 * 1024,\n MAX_RETRY_ATTEMPTS: 3,\n RETRY_BASE_DELAY: 1000,\n};\n\nexport const BrowserSessionSourceType = {\n PLAYWRIGHT_WORKSPACES_TEST_RUN: \"PlaywrightWorkspacesTestRun\",\n OTHERS: \"Others\",\n} as const;\n\nexport const StorageUriValidationConstants = {\n AllowedProtocol: \"https:\",\n AllowedHostnameSuffixes: [\n \".blob.core.windows.net\",\n \".blob.core.usgovcloudapi.net\",\n \".blob.core.chinacloudapi.cn\",\n ] as const,\n};\n"]}
@@ -5,6 +5,12 @@ export declare class EntraIdAccessToken {
5
5
  private _credential?;
6
6
  private _noOpFlag;
7
7
  constructor(credential?: TokenCredential);
8
+ /**
9
+ * Pre-warms MSAL with a storage-scoped token so long test runs don't hit
10
+ * AADSTS700024 on report upload after the OIDC assertion expires.
11
+ * See https://github.com/Azure/azure-cli/issues/28708.
12
+ */
13
+ prefetchStorageAccessToken: () => Promise<void>;
8
14
  fetchEntraIdAccessToken: () => Promise<void>;
9
15
  doesEntraIdAccessTokenNeedRotation(): boolean;
10
16
  private setEntraIdAccessTokenFromEnvironment;
@@ -1 +1 @@
1
- {"version":3,"file":"entraIdAccessToken.d.ts","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAWxD,qBAAa,kBAAkB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,WAAW,CAAC,CAAkB;IACtC,OAAO,CAAC,SAAS,CAAS;gBAEd,UAAU,CAAC,EAAE,eAAe;IASjC,uBAAuB,QAAa,OAAO,CAAC,IAAI,CAAC,CA6BtD;IAEK,kCAAkC,IAAI,OAAO;IAmBpD,OAAO,CAAC,oCAAoC,CAgB1C;CACH;AAED,wBAAgB,wBAAwB,CAAC,UAAU,CAAC,EAAE,eAAe,GAAG,kBAAkB,CAEzF"}
1
+ {"version":3,"file":"entraIdAccessToken.d.ts","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAWxD,qBAAa,kBAAkB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,WAAW,CAAC,CAAkB;IACtC,OAAO,CAAC,SAAS,CAAS;gBAEd,UAAU,CAAC,EAAE,eAAe;IASxC;;;;OAIG;IACI,0BAA0B,QAAa,OAAO,CAAC,IAAI,CAAC,CAsBzD;IAEK,uBAAuB,QAAa,OAAO,CAAC,IAAI,CAAC,CA6BtD;IAEK,kCAAkC,IAAI,OAAO;IAmBpD,OAAO,CAAC,oCAAoC,CAgB1C;CACH;AAED,wBAAgB,wBAAwB,CAAC,UAAU,CAAC,EAAE,eAAe,GAAG,kBAAkB,CAEzF"}
@@ -21,6 +21,30 @@ class EntraIdAccessToken {
21
21
  }
22
22
  this.setEntraIdAccessTokenFromEnvironment();
23
23
  }
24
+ /**
25
+ * Pre-warms MSAL with a storage-scoped token so long test runs don't hit
26
+ * AADSTS700024 on report upload after the OIDC assertion expires.
27
+ * See https://github.com/Azure/azure-cli/issues/28708.
28
+ */
29
+ prefetchStorageAccessToken = async () => {
30
+ if (this._noOpFlag) {
31
+ return;
32
+ }
33
+ try {
34
+ logger_js_1.coreLogger.info("Pre-fetching storage-scoped entra id access token to warm MSAL cache");
35
+ const accessToken = await this._credential.getToken(constants_js_1.EntraIdAccessTokenConstants.STORAGE_SCOPE);
36
+ if (!accessToken) {
37
+ logger_js_1.coreLogger.info("Storage-scoped entra id access token prefetch returned null");
38
+ return;
39
+ }
40
+ logger_js_1.coreLogger.info("Storage-scoped entra id access token prefetched, expiry:", new Date(accessToken.expiresOnTimestamp).toISOString());
41
+ }
42
+ catch (err) {
43
+ // Do not fail global setup on pre-warm errors; the actual storage client call will
44
+ // surface any real authentication issues with its own error handling.
45
+ logger_js_1.coreLogger.info("Failed to pre-fetch storage-scoped entra id access token:", err);
46
+ }
47
+ };
24
48
  fetchEntraIdAccessToken = async () => {
25
49
  if (this._noOpFlag) {
26
50
  throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);
@@ -1 +1 @@
1
- {"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAiGlC,4DAEC;AAhGD,2CAAyC;AACzC,iDAIwB;AAExB,sDAAgD;AAChD,+CAA6D;AAE7D,MAAa,kBAAkB;IACtB,KAAK,CAAU;IACd,gBAAgB,CAAU,CAAC,kBAAkB;IAC7C,WAAW,CAAmB;IAC9B,SAAS,GAAG,KAAK,CAAC;IAE1B,YAAY,UAA4B;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,oCAAoC,EAAE,CAAC;IAC9C,CAAC;IAEM,uBAAuB,GAAG,KAAK,IAAmB,EAAE;QACzD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,0CAA4B,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACjF,CAAC;QACD,IAAI,CAAC;YACH,sBAAU,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YAClD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,WAAY,CAAC,QAAQ,CAAC,0CAA2B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YAAY,GAAG,IAAI,CAAC,gBAAiB,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACnE,MAAM,6BAA6B,GACjC,YAAY;YACZ,0CAA2B,CAAC,+CAA+C,GAAG,EAAE,GAAG,IAAI,CAAC;QAC1F,sBAAU,CAAC,IAAI,CACb,0CAA0C,EAC1C,6BAA6B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAC7C,CAAC;QACF,OAAO,6BAA6B,CAAC;IACvC,CAAC;IAEO,oCAAoC,GAAG,GAAS,EAAE;QACxD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,yCAA0B,CAAC,+BAA+B,CAAC,CAAC;YACtF,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO;YACT,CAAC;YACD,MAAM,MAAM,GAAG,IAAA,sBAAQ,EAA6B,KAAK,CAAC,CAAC;YAC3D,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAChB,OAAO;YACT,CAAC,CAAC,UAAU;YACZ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,GAAI,GAAG,IAAI,CAAC,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;QACT,CAAC;IACH,CAAC,CAAC;CACH;AAlFD,gDAkFC;AAED,SAAgB,wBAAwB,CAAC,UAA4B;IACnE,OAAO,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { coreLogger } from \"./logger.js\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants.js\";\nimport type { AccessTokenClaims } from \"./types.js\";\nimport { parseJwt } from \"../utils/parseJwt.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nexport class EntraIdAccessToken {\n public token?: string;\n private _expiryTimestamp?: number; // in milliseconds\n private _credential?: TokenCredential;\n private _noOpFlag = false;\n\n constructor(credential?: TokenCredential) {\n this._credential = credential;\n if (!this._credential) {\n this._noOpFlag = true;\n return;\n }\n this.setEntraIdAccessTokenFromEnvironment();\n }\n\n public fetchEntraIdAccessToken = async (): Promise<void> => {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n try {\n coreLogger.info(\"Fetching entra id access token\");\n const accessToken = await this._credential!.getToken(EntraIdAccessTokenConstants.SCOPE);\n if (!accessToken) {\n throw new Error(\"Entra id access token is null\");\n }\n if (accessToken.token === this.token) {\n // azure identity library can fetch the same token again from cache. 10 mins before expiry, it allows token refresh\n coreLogger.info(\"Cached access token is returned, will be retried again.\");\n return;\n }\n this.token = accessToken.token;\n this._expiryTimestamp = accessToken.expiresOnTimestamp;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token!;\n coreLogger.info(\"Entra id access token fetched and set in environment variable\");\n coreLogger.info(\n \"Entra id access token expiry:\",\n new Date(this._expiryTimestamp!).toISOString(),\n );\n return;\n } catch (err) {\n coreLogger.error(err);\n process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = \"true\";\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_ENTRA_TOKEN.message);\n }\n };\n\n public doesEntraIdAccessTokenNeedRotation(): boolean {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n if (!this.token) {\n coreLogger.info(\"Entra id access token not found, needs rotation\");\n return true;\n }\n const lifetimeLeft = this._expiryTimestamp! - new Date().getTime();\n const doesEntraTokenRequireRotation =\n lifetimeLeft <\n EntraIdAccessTokenConstants.LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION * 60 * 1000;\n coreLogger.info(\n \"Entra id access token requires rotation:\",\n doesEntraTokenRequireRotation ? \"Yes\" : \"No\",\n );\n return doesEntraTokenRequireRotation;\n }\n\n private setEntraIdAccessTokenFromEnvironment = (): void => {\n try {\n const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n if (!token) {\n return;\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(token);\n if (claims.pwid) {\n return;\n } // mpt PAT\n const expiry = new Date(claims.exp! * 1000);\n this.token = token;\n this._expiryTimestamp = expiry.getTime();\n } catch (_) {\n return;\n }\n };\n}\n\nexport function createEntraIdAccessToken(credential?: TokenCredential): EntraIdAccessToken {\n return new EntraIdAccessToken(credential);\n}\n"]}
1
+ {"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA8HlC,4DAEC;AA7HD,2CAAyC;AACzC,iDAIwB;AAExB,sDAAgD;AAChD,+CAA6D;AAE7D,MAAa,kBAAkB;IACtB,KAAK,CAAU;IACd,gBAAgB,CAAU,CAAC,kBAAkB;IAC7C,WAAW,CAAmB;IAC9B,SAAS,GAAG,KAAK,CAAC;IAE1B,YAAY,UAA4B;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,oCAAoC,EAAE,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACI,0BAA0B,GAAG,KAAK,IAAmB,EAAE;QAC5D,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QACD,IAAI,CAAC;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AC;YACH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,yCAA0B,CAAC,+BAA+B,CAAC,CAAC;YACtF,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO;YACT,CAAC;YACD,MAAM,MAAM,GAAG,IAAA,sBAAQ,EAA6B,KAAK,CAAC,CAAC;YAC3D,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBAChB,OAAO;YACT,CAAC,CAAC,UAAU;YACZ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,GAAI,GAAG,IAAI,CAAC,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;QACT,CAAC;IACH,CAAC,CAAC;CACH;AA/GD,gDA+GC;AAED,SAAgB,wBAAwB,CAAC,UAA4B;IACnE,OAAO,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { coreLogger } from \"./logger.js\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants.js\";\nimport type { AccessTokenClaims } from \"./types.js\";\nimport { parseJwt } from \"../utils/parseJwt.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nexport class EntraIdAccessToken {\n public token?: string;\n private _expiryTimestamp?: number; // in milliseconds\n private _credential?: TokenCredential;\n private _noOpFlag = false;\n\n constructor(credential?: TokenCredential) {\n this._credential = credential;\n if (!this._credential) {\n this._noOpFlag = true;\n return;\n }\n this.setEntraIdAccessTokenFromEnvironment();\n }\n\n /**\n * Pre-warms MSAL with a storage-scoped token so long test runs don't hit\n * AADSTS700024 on report upload after the OIDC assertion expires.\n * See https://github.com/Azure/azure-cli/issues/28708.\n */\n public prefetchStorageAccessToken = async (): Promise<void> => {\n if (this._noOpFlag) {\n return;\n }\n try {\n coreLogger.info(\"Pre-fetching storage-scoped entra id access token to warm MSAL cache\");\n const accessToken = await this._credential!.getToken(\n EntraIdAccessTokenConstants.STORAGE_SCOPE,\n );\n if (!accessToken) {\n coreLogger.info(\"Storage-scoped entra id access token prefetch returned null\");\n return;\n }\n coreLogger.info(\n \"Storage-scoped entra id access token prefetched, expiry:\",\n new Date(accessToken.expiresOnTimestamp).toISOString(),\n );\n } catch (err) {\n // Do not fail global setup on pre-warm errors; the actual storage client call will\n // surface any real authentication issues with its own error handling.\n coreLogger.info(\"Failed to pre-fetch storage-scoped entra id access token:\", err);\n }\n };\n\n public fetchEntraIdAccessToken = async (): Promise<void> => {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n try {\n coreLogger.info(\"Fetching entra id access token\");\n const accessToken = await this._credential!.getToken(EntraIdAccessTokenConstants.SCOPE);\n if (!accessToken) {\n throw new Error(\"Entra id access token is null\");\n }\n if (accessToken.token === this.token) {\n // azure identity library can fetch the same token again from cache. 10 mins before expiry, it allows token refresh\n coreLogger.info(\"Cached access token is returned, will be retried again.\");\n return;\n }\n this.token = accessToken.token;\n this._expiryTimestamp = accessToken.expiresOnTimestamp;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token!;\n coreLogger.info(\"Entra id access token fetched and set in environment variable\");\n coreLogger.info(\n \"Entra id access token expiry:\",\n new Date(this._expiryTimestamp!).toISOString(),\n );\n return;\n } catch (err) {\n coreLogger.error(err);\n process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = \"true\";\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_ENTRA_TOKEN.message);\n }\n };\n\n public doesEntraIdAccessTokenNeedRotation(): boolean {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n if (!this.token) {\n coreLogger.info(\"Entra id access token not found, needs rotation\");\n return true;\n }\n const lifetimeLeft = this._expiryTimestamp! - new Date().getTime();\n const doesEntraTokenRequireRotation =\n lifetimeLeft <\n EntraIdAccessTokenConstants.LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION * 60 * 1000;\n coreLogger.info(\n \"Entra id access token requires rotation:\",\n doesEntraTokenRequireRotation ? \"Yes\" : \"No\",\n );\n return doesEntraTokenRequireRotation;\n }\n\n private setEntraIdAccessTokenFromEnvironment = (): void => {\n try {\n const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n if (!token) {\n return;\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(token);\n if (claims.pwid) {\n return;\n } // mpt PAT\n const expiry = new Date(claims.exp! * 1000);\n this.token = token;\n this._expiryTimestamp = expiry.getTime();\n } catch (_) {\n return;\n }\n };\n}\n\nexport function createEntraIdAccessToken(credential?: TokenCredential): EntraIdAccessToken {\n return new EntraIdAccessToken(credential);\n}\n"]}
@@ -69,6 +69,10 @@ export declare const ServiceErrorMessageConstants: {
69
69
  key: string;
70
70
  message: string;
71
71
  };
72
+ INVALID_STORAGE_URI: {
73
+ key: string;
74
+ message: string;
75
+ };
72
76
  STORAGE_AUTHORIZATION_FAILED: {
73
77
  key: string;
74
78
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA0DE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM;;;;;;;;;uDAWP,MAAM,KAAG,MAAM;;;;;;;;;uDAWf,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;kCA+BpC,MAAM,KAAG,MAAM;;;;;uCAMV,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BzB,MAAM,KAAG,MAAM;;;;;4CAKA,MAAM,aAAa,MAAM,UAAU,MAAM,KAAG,MAAM;;;;;iCAM7D,MAAM,KAAG,MAAM;;;;;+CAKD,MAAM,KAAG,MAAM;;;;;;;;;;CAYzD,CAAC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA0DE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM;;;;;;;;;;;;;uDAkBP,MAAM,KAAG,MAAM;;;;;;;;;uDAWf,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;kCA+BpC,MAAM,KAAG,MAAM;;;;;uCAMV,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BzB,MAAM,KAAG,MAAM;;;;;4CAKA,MAAM,aAAa,MAAM,UAAU,MAAM,KAAG,MAAM;;;;;iCAM7D,MAAM,KAAG,MAAM;;;;;+CAKD,MAAM,KAAG,MAAM;;;;;;;;;;CAYzD,CAAC"}
@@ -74,6 +74,12 @@ exports.ServiceErrorMessageConstants = {
74
74
  key: "StorageUriNotFound",
75
75
  message: "Storage Account is not linked with this Playwright Workspace.",
76
76
  },
77
+ INVALID_STORAGE_URI: {
78
+ key: "InvalidStorageUri",
79
+ message: "The storage URI configured on this Playwright Workspace is not a valid Azure Storage Blob endpoint. " +
80
+ "Please ask a workspace administrator to relink a valid Azure Storage Blob account. " +
81
+ "For more information, see https://aka.ms/pww-reporting",
82
+ },
77
83
  STORAGE_AUTHORIZATION_FAILED: {
78
84
  key: "StorageAuthorizationFailed",
79
85
  message: "The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting",
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,0IAA0I;KAC7I;IACD,wCAAwC,EAAE;QACxC,GAAG,EAAE,qCAAqC;QAC1C,OAAO,EACL,8KAA8K;KACjL;IACD,4CAA4C,EAAE;QAC5C,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,4IAA4I;KAC/I;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;KACtH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,qBAAqB;QAC1B,OAAO,EACL,kKAAkK;KACrK;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EACL,2GAA2G;KAC9G;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,iGAAiG;KACpG;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,+EAA+E;KACzF;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EACL,sLAAsL;KACzL;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EACL,+HAA+H;QACjI,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,sEAAsE,YAAY,qEAAqE;KAC1J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wBAAwB,EAAE;QACxB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,0DAA0D;QACnE,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,qCAAqC,YAAY,iCAAiC;KACrF;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,wCAAwC;KAClD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,mKAAmK;KACtK;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.\",\n },\n PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {\n key: \"PlaywrightVersionTooOldForReporting\",\n message:\n \"To use the Playwright Workspaces reporting feature, you need Playwright version 1.57 or later installed. Update the Playwright package to a supported version and try again.\",\n },\n MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {\n key: \"MultipleSetupFilePlaywrightVersionError\",\n message:\n \"The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n },\n NO_AUTH_ERROR_PAT_TOKEN: {\n key: \"NoAuthErrorPatToken\",\n message:\n \"Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n NO_AUTH_ERROR_ENTRA_TOKEN: {\n key: \"NoAuthErrorEntraToken\",\n message:\n \"Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message:\n \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Missing 'credential' parameter which is required when using ENTRA_ID authentication, Azure credential not provided. See https://aka.ms/pww/docs/authentication for more information.\",\n },\n FAILED_TO_CREATE_TEST_RUN: {\n key: \"FailedToCreateTestRun\",\n message:\n \"Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,\n },\n INVALID_PARAM_WITH_SERVICE_CONFIG: {\n key: \"InvalidParamWithServiceConfig\",\n message: `Remove serviceAuth, runId, and runName from getConnectOptions when using createAzurePlaywrightConfig. Configure these options through createAzurePlaywrightConfig instead.`,\n },\n INVALID_RUN_ID_FORMAT: {\n key: \"InvalidRunIdFormat\",\n message: \"The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.\",\n },\n INVALID_AUTH_TYPE_ERROR: {\n key: \"InvalidAuthTypeError\",\n message: \"Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.\",\n },\n FAILED_TO_GET_WORKSPACE_DETAILS: {\n key: \"FailedToGetWorkspaceDetails\",\n message: \"Failed to retrieve workspace details from the Playwright service.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,\n },\n STORAGE_URI_NOT_FOUND: {\n key: \"StorageUriNotFound\",\n message: \"Storage Account is not linked with this Playwright Workspace.\",\n },\n STORAGE_AUTHORIZATION_FAILED: {\n key: \"StorageAuthorizationFailed\",\n message:\n \"The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account - ${storageAccountName}. For more information, see https://aka.ms/pww-reporting`,\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n STORAGE_ACCOUNT_DELETED: {\n key: \"StorageAccountDeleted\",\n message:\n \"The storage account linked to your Playwright Workspace may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The storage account linked to your Playwright Workspace (${storageAccountName}) may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n HTML_REPORTER_REQUIRED: {\n key: \"HtmlReporterRequired\",\n message:\n \"Playwright Workspaces Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the 'html' reporter before playwright workspace reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]. For more information, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_METADATA_FETCH_FAILED: {\n key: \"WorkspaceMetadataFetchFailed\",\n message:\n \"Failed to retrieve workspace configuration. Reporting will be disabled for this run. Please check your authentication credentials and service URL.\",\n },\n WORKSPACE_REPORTING_DISABLED: {\n key: \"WorkspaceReportingDisabled\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is not enabled for the Playwright Workspace. To learn more about how to enable reporting and link a storage account, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_REPORTING_STORAGE_NOT_LINKED: {\n key: \"WorkspaceReportingStorageNotLinked\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is enabled for the Playwright Workspace, but no storage account is linked. Please link a storage account to enable reporting. For more information, see https://aka.ms/pww-reporting\",\n },\n UPLOAD_FAILED_FILES: {\n key: \"UploadFailedFiles\",\n message: \"Upload failed: files could not be uploaded\",\n formatWithCount: (failed: number): string =>\n `Upload failed: ${failed} files could not be uploaded`,\n },\n PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {\n key: \"PlaywrightTestReportNotFound\",\n message: \"Playwright test report not found\",\n formatWithFolder: (folderName: string): string =>\n `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,\n },\n REPORTING_ENABLED: {\n key: \"ReportingEnabled\",\n message: \"Playwright Workspaces reporting: ENABLED\",\n },\n COLLECTING_ARTIFACTS: {\n key: \"CollectingArtifacts\",\n message: \"Collecting artifacts: screenshots, videos, traces.\",\n },\n REPORTING_STATUS_SUCCESS: {\n key: \"ReportingStatusSuccess\",\n message: \"Reporting upload status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting upload status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting upload status: FAILED\",\n },\n TEST_REPORT_VIEW_URL: {\n key: \"TestReportViewUrl\",\n message: \"Published report URL: \",\n formatWithUrl: (url: string): string => `Published report URL: ${url}`,\n },\n UPLOADING_ARTIFACTS: {\n key: \"UploadingArtifacts\",\n message: \"Uploading artifacts to storage\",\n formatWithDetails: (storageAccount: string, container: string, folder: string): string =>\n `Uploading artifacts to: storage account= ${storageAccount}, storage container= ${container}, folder= ${folder}`,\n },\n FAILED_TO_GET_WORKSPACE_METADATA: {\n key: \"FailedToGetWorkspaceMetadata\",\n message: \"Failed to get workspace metadata\",\n formatWithError: (error: string): string => error,\n },\n TEST_RUN_CREATION_FAILED: {\n key: \"TestRunCreationFailed\",\n message: \"Failed to create test run. Test execution will continue.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,\n },\n REPORTING_TEST_RUN_FAILED: {\n key: \"ReportingTestRunFailed\",\n message: \"Test run creation failed during setup.\",\n },\n REPORTER_REQUIRES_SERVICE_CONFIG: {\n key: \"ReporterRequiresServiceConfig\",\n message:\n \"Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.\",\n },\n};\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,0IAA0I;KAC7I;IACD,wCAAwC,EAAE;QACxC,GAAG,EAAE,qCAAqC;QAC1C,OAAO,EACL,8KAA8K;KACjL;IACD,4CAA4C,EAAE;QAC5C,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,4IAA4I;KAC/I;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;KACtH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,qBAAqB;QAC1B,OAAO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AAO,EAAE,6CAA6C;KACvD;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,iCAAiC;KAC3C;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EAAE,wBAAwB;QACjC,aAAa,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,yBAAyB,GAAG,EAAE;KACvE;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,gCAAgC;QACzC,iBAAiB,EAAE,CAAC,cAAsB,EAAE,SAAiB,EAAE,MAAc,EAAU,EAAE,CACvF,4CAA4C,cAAc,wBAAwB,SAAS,aAAa,MAAM,EAAE;KACnH;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,8BAA8B;QACnC,OAAO,EAAE,kCAAkC;QAC3C,eAAe,EAAE,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK;KAClD;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,0DAA0D;QACnE,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,qCAAqC,YAAY,iCAAiC;KACrF;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,wCAAwC;KAClD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,mKAAmK;KACtK;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.\",\n },\n PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {\n key: \"PlaywrightVersionTooOldForReporting\",\n message:\n \"To use the Playwright Workspaces reporting feature, you need Playwright version 1.57 or later installed. Update the Playwright package to a supported version and try again.\",\n },\n MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {\n key: \"MultipleSetupFilePlaywrightVersionError\",\n message:\n \"The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n },\n NO_AUTH_ERROR_PAT_TOKEN: {\n key: \"NoAuthErrorPatToken\",\n message:\n \"Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n NO_AUTH_ERROR_ENTRA_TOKEN: {\n key: \"NoAuthErrorEntraToken\",\n message:\n \"Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message:\n \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Missing 'credential' parameter which is required when using ENTRA_ID authentication, Azure credential not provided. See https://aka.ms/pww/docs/authentication for more information.\",\n },\n FAILED_TO_CREATE_TEST_RUN: {\n key: \"FailedToCreateTestRun\",\n message:\n \"Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,\n },\n INVALID_PARAM_WITH_SERVICE_CONFIG: {\n key: \"InvalidParamWithServiceConfig\",\n message: `Remove serviceAuth, runId, and runName from getConnectOptions when using createAzurePlaywrightConfig. Configure these options through createAzurePlaywrightConfig instead.`,\n },\n INVALID_RUN_ID_FORMAT: {\n key: \"InvalidRunIdFormat\",\n message: \"The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.\",\n },\n INVALID_AUTH_TYPE_ERROR: {\n key: \"InvalidAuthTypeError\",\n message: \"Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.\",\n },\n FAILED_TO_GET_WORKSPACE_DETAILS: {\n key: \"FailedToGetWorkspaceDetails\",\n message: \"Failed to retrieve workspace details from the Playwright service.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,\n },\n STORAGE_URI_NOT_FOUND: {\n key: \"StorageUriNotFound\",\n message: \"Storage Account is not linked with this Playwright Workspace.\",\n },\n INVALID_STORAGE_URI: {\n key: \"InvalidStorageUri\",\n message:\n \"The storage URI configured on this Playwright Workspace is not a valid Azure Storage Blob endpoint. \" +\n \"Please ask a workspace administrator to relink a valid Azure Storage Blob account. \" +\n \"For more information, see https://aka.ms/pww-reporting\",\n },\n STORAGE_AUTHORIZATION_FAILED: {\n key: \"StorageAuthorizationFailed\",\n message:\n \"The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account - ${storageAccountName}. For more information, see https://aka.ms/pww-reporting`,\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n STORAGE_ACCOUNT_DELETED: {\n key: \"StorageAccountDeleted\",\n message:\n \"The storage account linked to your Playwright Workspace may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The storage account linked to your Playwright Workspace (${storageAccountName}) may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n HTML_REPORTER_REQUIRED: {\n key: \"HtmlReporterRequired\",\n message:\n \"Playwright Workspaces Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the 'html' reporter before playwright workspace reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]. For more information, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_METADATA_FETCH_FAILED: {\n key: \"WorkspaceMetadataFetchFailed\",\n message:\n \"Failed to retrieve workspace configuration. Reporting will be disabled for this run. Please check your authentication credentials and service URL.\",\n },\n WORKSPACE_REPORTING_DISABLED: {\n key: \"WorkspaceReportingDisabled\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is not enabled for the Playwright Workspace. To learn more about how to enable reporting and link a storage account, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_REPORTING_STORAGE_NOT_LINKED: {\n key: \"WorkspaceReportingStorageNotLinked\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is enabled for the Playwright Workspace, but no storage account is linked. Please link a storage account to enable reporting. For more information, see https://aka.ms/pww-reporting\",\n },\n UPLOAD_FAILED_FILES: {\n key: \"UploadFailedFiles\",\n message: \"Upload failed: files could not be uploaded\",\n formatWithCount: (failed: number): string =>\n `Upload failed: ${failed} files could not be uploaded`,\n },\n PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {\n key: \"PlaywrightTestReportNotFound\",\n message: \"Playwright test report not found\",\n formatWithFolder: (folderName: string): string =>\n `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,\n },\n REPORTING_ENABLED: {\n key: \"ReportingEnabled\",\n message: \"Playwright Workspaces reporting: ENABLED\",\n },\n COLLECTING_ARTIFACTS: {\n key: \"CollectingArtifacts\",\n message: \"Collecting artifacts: screenshots, videos, traces.\",\n },\n REPORTING_STATUS_SUCCESS: {\n key: \"ReportingStatusSuccess\",\n message: \"Reporting upload status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting upload status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting upload status: FAILED\",\n },\n TEST_REPORT_VIEW_URL: {\n key: \"TestReportViewUrl\",\n message: \"Published report URL: \",\n formatWithUrl: (url: string): string => `Published report URL: ${url}`,\n },\n UPLOADING_ARTIFACTS: {\n key: \"UploadingArtifacts\",\n message: \"Uploading artifacts to storage\",\n formatWithDetails: (storageAccount: string, container: string, folder: string): string =>\n `Uploading artifacts to: storage account= ${storageAccount}, storage container= ${container}, folder= ${folder}`,\n },\n FAILED_TO_GET_WORKSPACE_METADATA: {\n key: \"FailedToGetWorkspaceMetadata\",\n message: \"Failed to get workspace metadata\",\n formatWithError: (error: string): string => error,\n },\n TEST_RUN_CREATION_FAILED: {\n key: \"TestRunCreationFailed\",\n message: \"Failed to create test run. Test execution will continue.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,\n },\n REPORTING_TEST_RUN_FAILED: {\n key: \"ReportingTestRunFailed\",\n message: \"Test run creation failed during setup.\",\n },\n REPORTER_REQUIRES_SERVICE_CONFIG: {\n key: \"ReporterRequiresServiceConfig\",\n message:\n \"Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.\",\n },\n};\n"]}
@@ -1,4 +1,4 @@
1
- import type { PlaywrightServiceAdditionalOptions, OsType } from "./types.js";
1
+ import type { BrowserSessionSourceTypeValue, PlaywrightServiceAdditionalOptions, OsType } from "./types.js";
2
2
  import type { TokenCredential } from "@azure/identity";
3
3
  declare class PlaywrightServiceConfig {
4
4
  serviceOs: OsType;
@@ -8,6 +8,7 @@ declare class PlaywrightServiceConfig {
8
8
  exposeNetwork: string;
9
9
  runName: string;
10
10
  apiVersion: string;
11
+ sourceType: BrowserSessionSourceTypeValue;
11
12
  private _serviceAuthType;
12
13
  credential?: TokenCredential;
13
14
  constructor();
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD,cAAM,uBAAuB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,gBAAgB,CAAgC;IACjD,UAAU,CAAC,EAAE,eAAe,CAAC;;IAcpC,WAAkB,QAAQ,IAAI,uBAAuB,CAKpD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,MAAM,EAEvC;IAEY,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxC,eAAe,GAAI,UAAU,kCAAkC,KAAG,IAAI,CAYpE;IAEF,UAAU,GACR,UAAU,kCAAkC,EAC5C,sBAAqB,OAAe,KACnC,IAAI,CAwCL;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,6BAA6B,EAC7B,kCAAkC,EAClC,MAAM,EACP,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD,cAAM,uBAAuB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,6BAA6B,CAAC;IACjD,OAAO,CAAC,gBAAgB,CAAgC;IACjD,UAAU,CAAC,EAAE,eAAe,CAAC;;IAepC,WAAkB,QAAQ,IAAI,uBAAuB,CAKpD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,MAAM,EAEvC;IAEY,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxC,eAAe,GAAI,UAAU,kCAAkC,KAAG,IAAI,CAYpE;IAEF,UAAU,GACR,UAAU,kCAAkC,EAC5C,sBAAqB,OAAe,KACnC,IAAI,CA2CL;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -16,6 +16,7 @@ class PlaywrightServiceConfig {
16
16
  exposeNetwork;
17
17
  runName;
18
18
  apiVersion;
19
+ sourceType;
19
20
  _serviceAuthType = constants_js_1.ServiceAuth.ENTRA_ID;
20
21
  credential;
21
22
  constructor() {
@@ -28,6 +29,7 @@ class PlaywrightServiceConfig {
28
29
  this.exposeNetwork = constants_js_1.DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;
29
30
  this.apiVersion =
30
31
  process.env[constants_js_1.InternalEnvironmentVariables.MPT_API_VERSION] || constants_js_1.Constants.LatestAPIVersion;
32
+ this.sourceType = constants_js_1.BrowserSessionSourceType.PLAYWRIGHT_WORKSPACES_TEST_RUN;
31
33
  }
32
34
  static get instance() {
33
35
  if (!state_js_1.state.playwrightServiceConfig) {
@@ -99,6 +101,9 @@ class PlaywrightServiceConfig {
99
101
  if (options?.credential) {
100
102
  this.credential = options.credential;
101
103
  }
104
+ if (options?.sourceType) {
105
+ this.sourceType = options.sourceType;
106
+ }
102
107
  };
103
108
  }
104
109
  exports.PlaywrightServiceConfig = PlaywrightServiceConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAKwB;AAGxB,gDAA8E;AAC9E,kEAA4D;AAC5D,yCAAmC;AACnC,+CAA6D;AAE7D,MAAM,uBAAuB;IACpB,SAAS,CAAS;IAClB,KAAK,CAAS;IACd,cAAc,CAAS;IACvB,MAAM,CAAS;IACf,aAAa,CAAS;IACtB,OAAO,CAAS;IAChB,UAAU,CAAS;IAClB,gBAAgB,GAAW,0BAAW,CAAC,QAAQ,CAAC;IACjD,UAAU,CAAmB;IAEpC;QACE,IAAI,CAAC,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,cAAc,CAAC;YACxE,6CAA8B,CAAC,kBAAkB,CAAW,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QACh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,OAAO,CAAC,OAAO,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAChF,CAAC;QACD,IAAI,OAAO,EAAE,EAAE,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5E,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC/B,CAAC;QACD,IAAI,OAAO,EAAE,cAAc,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;CACH;AAEQ,0DAAuB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type { PlaywrightServiceAdditionalOptions, OsType } from \"./types.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { getAndSetRunId, getRunName, ValidateRunID } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\nimport { state } from \"./state.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public connectTimeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n public apiVersion: string;\n private _serviceAuthType: string = ServiceAuth.ENTRA_ID;\n public credential?: TokenCredential;\n\n constructor() {\n this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n this.apiVersion =\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;\n }\n\n public static get instance(): PlaywrightServiceConfig {\n if (!state.playwrightServiceConfig) {\n state.playwrightServiceConfig = new PlaywrightServiceConfig();\n }\n return state.playwrightServiceConfig;\n }\n\n public get serviceAuthType(): string {\n return this._serviceAuthType;\n }\n\n public set serviceAuthType(value: string) {\n this._serviceAuthType = value;\n }\n\n public async initialize(): Promise<void> {\n if (!this.runName) {\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n this.runName = await getRunName(ciConfigInfo);\n }\n }\n\n validateOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (!options) return;\n\n const isUsingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n if (isUsingServiceConfig) {\n if (options.serviceAuthType || options.runId || options.runName) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;\n throw new Error(errorMessage);\n }\n return;\n }\n };\n\n setOptions = (\n options?: PlaywrightServiceAdditionalOptions,\n isGetConnectOptions: boolean = false,\n ): void => {\n if (isGetConnectOptions) {\n this.validateOptions(options);\n }\n\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (options?.apiVersion) {\n if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;\n }\n this.apiVersion = options.apiVersion;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n ValidateRunID(options.runId);\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.connectTimeout) {\n this.connectTimeout = options.connectTimeout;\n }\n if (options?.credential) {\n this.credential = options.credential;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
1
+ {"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAMwB;AAOxB,gDAA8E;AAC9E,kEAA4D;AAC5D,yCAAmC;AACnC,+CAA6D;AAE7D,MAAM,uBAAuB;IACpB,SAAS,CAAS;IAClB,KAAK,CAAS;IACd,cAAc,CAAS;IACvB,MAAM,CAAS;IACf,aAAa,CAAS;IACtB,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,UAAU,CAAgC;IACzC,gBAAgB,GAAW,0BAAW,CAAC,QAAQ,CAAC;IACjD,UAAU,CAAmB;IAEpC;QACE,IAAI,CAAC,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,cAAc,CAAC;YACxE,6CAA8B,CAAC,kBAAkB,CAAW,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAA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AE,CAAC;YAChC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;YACxF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAChF,CAAC;QACD,IAAI,OAAO,EAAE,EAAE,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5E,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC/B,CAAC;QACD,IAAI,OAAO,EAAE,cAAc,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;CACH;AAEQ,0DAAuB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n BrowserSessionSourceType,\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type {\n BrowserSessionSourceTypeValue,\n PlaywrightServiceAdditionalOptions,\n OsType,\n} from \"./types.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { getAndSetRunId, getRunName, ValidateRunID } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\nimport { state } from \"./state.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public connectTimeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n public apiVersion: string;\n public sourceType: BrowserSessionSourceTypeValue;\n private _serviceAuthType: string = ServiceAuth.ENTRA_ID;\n public credential?: TokenCredential;\n\n constructor() {\n this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n this.apiVersion =\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;\n this.sourceType = BrowserSessionSourceType.PLAYWRIGHT_WORKSPACES_TEST_RUN;\n }\n\n public static get instance(): PlaywrightServiceConfig {\n if (!state.playwrightServiceConfig) {\n state.playwrightServiceConfig = new PlaywrightServiceConfig();\n }\n return state.playwrightServiceConfig;\n }\n\n public get serviceAuthType(): string {\n return this._serviceAuthType;\n }\n\n public set serviceAuthType(value: string) {\n this._serviceAuthType = value;\n }\n\n public async initialize(): Promise<void> {\n if (!this.runName) {\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n this.runName = await getRunName(ciConfigInfo);\n }\n }\n\n validateOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (!options) return;\n\n const isUsingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n if (isUsingServiceConfig) {\n if (options.serviceAuthType || options.runId || options.runName) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;\n throw new Error(errorMessage);\n }\n return;\n }\n };\n\n setOptions = (\n options?: PlaywrightServiceAdditionalOptions,\n isGetConnectOptions: boolean = false,\n ): void => {\n if (isGetConnectOptions) {\n this.validateOptions(options);\n }\n\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (options?.apiVersion) {\n if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;\n }\n this.apiVersion = options.apiVersion;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n ValidateRunID(options.runId);\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.connectTimeout) {\n this.connectTimeout = options.connectTimeout;\n }\n if (options?.credential) {\n this.credential = options.credential;\n }\n if (options?.sourceType) {\n this.sourceType = options.sourceType;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
@@ -129,7 +129,22 @@ export type PlaywrightServiceAdditionalOptions = {
129
129
  * @defaultValue `2025-09-01`
130
130
  */
131
131
  apiVersion?: "2025-09-01";
132
+ /**
133
+ * @public
134
+ *
135
+ * Identifies the tool that initiated remote browser sessions, sent to the
136
+ * service as the `sourceType` query parameter on the WebSocket endpoint.
137
+ *
138
+ * @defaultValue `PlaywrightWorkspacesTestRun`
139
+ */
140
+ sourceType?: BrowserSessionSourceTypeValue;
132
141
  };
142
+ /**
143
+ * @public
144
+ *
145
+ * Source identifier values accepted by Azure Playwright for the `sourceType` option.
146
+ */
147
+ export type BrowserSessionSourceTypeValue = "PlaywrightWorkspacesTestRun" | "Others";
133
148
  /**
134
149
  * @public
135
150
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG;IACpD,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAE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MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport type { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Use cloud hosted browsers.\n *\n * @defaultValue `true`\n */\n useCloudHostedBrowsers?: boolean;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n};\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n reporting?: string;\n};\n\nexport interface UploadResult {\n success: boolean;\n errorMessage?: string;\n failedFileCount?: number;\n totalFiles?: number;\n failedFiles?: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n partialSuccess?: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport type { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Use cloud hosted browsers.\n *\n * @defaultValue `true`\n */\n useCloudHostedBrowsers?: boolean;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n\n /**\n * @public\n *\n * Identifies the tool that initiated remote browser sessions, sent to the\n * service as the `sourceType` query parameter on the WebSocket endpoint.\n *\n * @defaultValue `PlaywrightWorkspacesTestRun`\n */\n sourceType?: BrowserSessionSourceTypeValue;\n};\n\n/**\n * @public\n *\n * Source identifier values accepted by Azure Playwright for the `sourceType` option.\n */\nexport type BrowserSessionSourceTypeValue = \"PlaywrightWorkspacesTestRun\" | \"Others\";\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n reporting?: string;\n};\n\nexport interface UploadResult {\n success: boolean;\n errorMessage?: string;\n failedFileCount?: number;\n totalFiles?: number;\n failedFiles?: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n partialSuccess?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../../src/core/playwrightService.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kCAAkC,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAgBpG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,QAAA,MAAM,2BAA2B,GAC/B,YAAY,oBAAoB,EAChC,UAAU,kCAAkC,KAC3C,oBAiHF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,iBAAiB,GACrB,UAAU,kCAAkC,KAC3C,OAAO,CAAC,qBAAqB,CA0C/B,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../../src/core/playwrightService.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kCAAkC,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAgBpG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,QAAA,MAAM,2BAA2B,GAC/B,YAAY,oBAAoB,EAChC,UAAU,kCAAkC,KAC3C,oBAkHF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,iBAAiB,GACrB,UAAU,kCAAkC,KAC3C,OAAO,CAAC,qBAAqB,CA2C/B,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,CAAC"}
@@ -10,7 +10,7 @@ const playwrightServiceConfig_js_1 = require("../common/playwrightServiceConfig.
10
10
  const playwrightServiceEntra_js_1 = tslib_1.__importDefault(require("./playwrightServiceEntra.js"));
11
11
  const utils_js_1 = require("../utils/utils.js");
12
12
  const messages_js_1 = require("../common/messages.js");
13
- const playwrightServiceUtils_js_1 = require("./playwrightServiceUtils.js");
13
+ const playwrightServiceUtils_1 = require("./playwrightServiceUtils-cjs.js");
14
14
  const performOneTimeOperation = (options) => {
15
15
  const oneTimeOperationFlag = process.env[constants_js_1.InternalEnvironmentVariables.ONE_TIME_OPERATION_FLAG] === "true";
16
16
  if (oneTimeOperationFlag)
@@ -119,13 +119,13 @@ const createAzurePlaywrightConfig = (baseConfig, options) => {
119
119
  if (customerConfig_js_1.default.globalTeardown) {
120
120
  globalFunctions.globalTeardown.push(...customerConfig_js_1.default.globalTeardown);
121
121
  }
122
- globalFunctions.globalSetup.push(playwrightServiceUtils_js_1.globalPaths.setup);
123
- globalFunctions.globalTeardown.push(playwrightServiceUtils_js_1.globalPaths.teardown);
122
+ globalFunctions.globalSetup.push(playwrightServiceUtils_1.globalPaths.setup);
123
+ globalFunctions.globalTeardown.push(playwrightServiceUtils_1.globalPaths.teardown);
124
124
  }
125
125
  else {
126
126
  // If multiple global file is not supported, wrap playwright-service global setup/teardown with customer provided global setup/teardown
127
- globalFunctions.globalSetup = playwrightServiceUtils_js_1.globalPaths.setup;
128
- globalFunctions.globalTeardown = playwrightServiceUtils_js_1.globalPaths.teardown;
127
+ globalFunctions.globalSetup = playwrightServiceUtils_1.globalPaths.setup;
128
+ globalFunctions.globalTeardown = playwrightServiceUtils_1.globalPaths.teardown;
129
129
  }
130
130
  performOneTimeOperation(options);
131
131
  if (options?.useCloudHostedBrowsers === false) {
@@ -141,7 +141,7 @@ const createAzurePlaywrightConfig = (baseConfig, options) => {
141
141
  return {
142
142
  use: {
143
143
  connectOptions: {
144
- wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion),
144
+ wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion, playwrightServiceConfig.sourceType),
145
145
  headers: {
146
146
  Authorization: `Bearer ${(0, utils_js_1.getAccessToken)()}`,
147
147
  "x-ms-package-version": `@azure/playwright/${(0, utils_js_1.getPackageVersion)()}`,
@@ -208,7 +208,7 @@ const getConnectOptions = async (options) => {
208
208
  throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);
209
209
  }
210
210
  return {
211
- wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion),
211
+ wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion, playwrightServiceConfig.sourceType),
212
212
  options: {
213
213
  headers: {
214
214
  Authorization: `Bearer ${token}`,