@designcrowd/fe-shared-lib 1.8.4 → 1.8.5-edge-fallback-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 (166) hide show
  1. package/.nvmrc +1 -0
  2. package/.storybook-static/assets/Auth-DT64t5h-.css +1 -0
  3. package/.storybook-static/assets/Auth.stories-C6eXcTSu.js +490 -0
  4. package/.storybook-static/assets/AuthCrazyDomains.stories-DGvEoWCa.js +73 -0
  5. package/.storybook-static/assets/Button-5UzSGUF6.css +1 -0
  6. package/.storybook-static/assets/Button-DKdQT6Fq.js +1 -0
  7. package/.storybook-static/assets/ButtonGroup-DDPXuhxR.css +1 -0
  8. package/.storybook-static/assets/ButtonGroup.stories-DlrYMRSk.js +504 -0
  9. package/.storybook-static/assets/ButtonPrimary-Bu6bXb_c.css +1 -0
  10. package/.storybook-static/assets/ButtonPrimary-BvWW6Duz.js +1 -0
  11. package/.storybook-static/assets/Buttons.stories-CKmd6hkZ.js +761 -0
  12. package/.storybook-static/assets/ButtonsCrazyDomains.stories-DdEuOUrn.js +199 -0
  13. package/.storybook-static/assets/Checkbox.mixin-DkHpdvGa.js +1 -0
  14. package/.storybook-static/assets/Checkbox.stories-DPBUC2Mx.js +246 -0
  15. package/.storybook-static/assets/Checktile.stories-ByaFwplD.js +88 -0
  16. package/.storybook-static/assets/CollapsiblePanel.stories-Y6q3gP9j.js +56 -0
  17. package/.storybook-static/assets/ColorPicker.stories-DdxPUB_R.js +73 -0
  18. package/.storybook-static/assets/CopyToClipboardText.stories-J9qndWxd.js +32 -0
  19. package/.storybook-static/assets/Dropdown.stories-1zKPATii.js +159 -0
  20. package/.storybook-static/assets/DropdownItem-BV-BdThU.css +1 -0
  21. package/.storybook-static/assets/DropdownItem-DA6TdpDb.js +1 -0
  22. package/.storybook-static/assets/FormControl.mixin-DcEBwrV3.js +1 -0
  23. package/.storybook-static/assets/HashRouteModal.stories-BGxvqE22.js +60 -0
  24. package/.storybook-static/assets/HelloBar-CYEZR2kQ.js +1 -0
  25. package/.storybook-static/assets/HelloBar.stories-597Kxj0W.js +342 -0
  26. package/.storybook-static/assets/Icon-C17LFvsP.js +145 -0
  27. package/.storybook-static/assets/Icon.stories-B9iAmcTU.js +151 -0
  28. package/.storybook-static/assets/Icon.stories-CR5vT9H7.js +791 -0
  29. package/.storybook-static/assets/Loader-BWGoT_xC.js +1 -0
  30. package/.storybook-static/assets/LogoBusinessBrandColours-CExzox1Z.js +1 -0
  31. package/.storybook-static/assets/LogoBusinessBrandColours-CeAaMKke.css +1 -0
  32. package/.storybook-static/assets/LogoBusinessBrandColours.stories-kuxAH8B8.js +36 -0
  33. package/.storybook-static/assets/Masonry-C2MNiGg0.css +1 -0
  34. package/.storybook-static/assets/Masonry.stories-CTXJLQ_i.js +71 -0
  35. package/.storybook-static/assets/Modal-CGwEIF5R.css +1 -0
  36. package/.storybook-static/assets/Modal-CydTNprT.js +1 -0
  37. package/.storybook-static/assets/Modal.stories-DZiG5NGM.js +345 -0
  38. package/.storybook-static/assets/Notice.stories-ChOj8CWm.js +222 -0
  39. package/.storybook-static/assets/NumberStepper-Blffv09R.css +1 -0
  40. package/.storybook-static/assets/NumberStepper.stories-CVbKJ_oJ.js +64 -0
  41. package/.storybook-static/assets/PaymentConfigList-BpUMV6cp.css +1 -0
  42. package/.storybook-static/assets/PaymentConfigList.stories-DUD7OZBS.js +130 -0
  43. package/.storybook-static/assets/Picture-B8m1I9xN.js +1 -0
  44. package/.storybook-static/assets/Picture.stories-MMzybhJ6.js +119 -0
  45. package/.storybook-static/assets/Pill-DLXZ_TL8.js +1 -0
  46. package/.storybook-static/assets/Pill.stories-DCP7szJm.js +18 -0
  47. package/.storybook-static/assets/PillBar-os4mJV3M.css +1 -0
  48. package/.storybook-static/assets/PillBar.stories-Bry-zQ6f.js +41 -0
  49. package/.storybook-static/assets/Price-C4GZbDSa.js +1 -0
  50. package/.storybook-static/assets/Price.stories-CMHly9V0.js +337 -0
  51. package/.storybook-static/assets/PromoCard.stories-xsbFtADE.js +299 -0
  52. package/.storybook-static/assets/PublishBrandPageModal-Q9-mNG1q.css +1 -0
  53. package/.storybook-static/assets/PublishBrandPageModal.stories-C9XzW_1m.js +324 -0
  54. package/.storybook-static/assets/SearchBar.stories-DaIneOSz.js +12 -0
  55. package/.storybook-static/assets/Select-DnioWQmi.css +1 -0
  56. package/.storybook-static/assets/Select.stories-BmGYB4pw.js +108 -0
  57. package/.storybook-static/assets/SellDomainNameList.fixtures-LC6fjr_b.js +1 -0
  58. package/.storybook-static/assets/SellDomainNameListModal-DH6khE10.css +1 -0
  59. package/.storybook-static/assets/SellDomainNameListModal-ymtVclFP.js +1 -0
  60. package/.storybook-static/assets/SellDomainNameListModal.stories-DvGvylgx.js +71 -0
  61. package/.storybook-static/assets/SellDomainNameListSearchResult-Cpxq0jDA.css +1 -0
  62. package/.storybook-static/assets/SellDomainNameListSearchResult-D-1CrQyf.js +1 -0
  63. package/.storybook-static/assets/SellDomainNameSearchWithResults-bX--zu97.js +1 -0
  64. package/.storybook-static/assets/SellDomainNameSearchWithResults.stories-DRUJjSdH.js +37 -0
  65. package/.storybook-static/assets/SellDomainNameWidget.stories-CC3LX10s.js +36 -0
  66. package/.storybook-static/assets/SignIn-CPjf8_2O.css +1 -0
  67. package/.storybook-static/assets/SignIn-DI0DSDFe.js +1 -0
  68. package/.storybook-static/assets/Slider-Cog2FFdj.css +1 -0
  69. package/.storybook-static/assets/Slider.stories-B2KGwnJy.js +141 -0
  70. package/.storybook-static/assets/SparkleIcon.stories-Dk904hVE.js +547 -0
  71. package/.storybook-static/assets/StarRating-BtKh7pzm.css +1 -0
  72. package/.storybook-static/assets/StarRating.stories-d2mgOuo2.js +45 -0
  73. package/.storybook-static/assets/TabMenu.stories-Cg2yenqj.js +47 -0
  74. package/.storybook-static/assets/TextCopyField-B66NKTk_.js +1 -0
  75. package/.storybook-static/assets/TextCopyField.stories-B4_ZlfLU.js +47 -0
  76. package/.storybook-static/assets/TextInput-CMoUjT_5.js +1 -0
  77. package/.storybook-static/assets/TextInput.stories-oyyxxf3j.js +233 -0
  78. package/.storybook-static/assets/Textarea.stories-BvhZR6K2.js +207 -0
  79. package/.storybook-static/assets/Toggle.stories-yT5-rL2k.js +161 -0
  80. package/.storybook-static/assets/Tooltip-DyXIgFQH.css +1 -0
  81. package/.storybook-static/assets/Tooltip-ZukyujG5.js +1 -0
  82. package/.storybook-static/assets/Tooltip.stories-sJFylRS_.js +953 -0
  83. package/.storybook-static/assets/UploadYourLogoApplication-Dmw8QcH3.css +1 -0
  84. package/.storybook-static/assets/UploadYourLogoApplication.stories-C9AvzHO_.js +186 -0
  85. package/.storybook-static/assets/UploadYourLogoDropzone-B1ffcicv.js +24 -0
  86. package/.storybook-static/assets/UploadYourLogoDropzone-DQqACf-e.css +1 -0
  87. package/.storybook-static/assets/UploadYourLogoDropzone.stories-D1Dt2ord.js +55 -0
  88. package/.storybook-static/assets/UploadedLogoSearchResultCard.stories-D8oF1Yrx.js +79 -0
  89. package/.storybook-static/assets/WebsiteContextualUpgradeModal-8u1zOZrW.css +1 -0
  90. package/.storybook-static/assets/WebsiteContextualUpgradeModal.stories-mtcvWOAg.js +211 -0
  91. package/.storybook-static/assets/_commonjsHelpers-CE1G-McA.js +1 -0
  92. package/.storybook-static/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
  93. package/.storybook-static/assets/api-lSJGRrF2.js +1 -0
  94. package/.storybook-static/assets/axe-DrS73Vi2.js +20 -0
  95. package/.storybook-static/assets/brand-crowd-api.client-D45NKshX.js +1 -0
  96. package/.storybook-static/assets/bundled-translations-BoWhEDU_.js +1 -0
  97. package/.storybook-static/assets/bundled-translations.de-DE-C4lqla4O.js +1 -0
  98. package/.storybook-static/assets/bundled-translations.es-ES-BxMIllUH.js +1 -0
  99. package/.storybook-static/assets/bundled-translations.fr-CA-MxZpyz0w.js +1 -0
  100. package/.storybook-static/assets/bundled-translations.fr-FR-N7UPCZVr.js +1 -0
  101. package/.storybook-static/assets/bundled-translations.pt-BR-C8tscYuG.js +1 -0
  102. package/.storybook-static/assets/bundled-translations.pt-PT-Dszj5Xfa.js +1 -0
  103. package/.storybook-static/assets/carousel-BelyIYOK.css +1 -0
  104. package/.storybook-static/assets/carousel.stories-CJw3-Iy6.js +668 -0
  105. package/.storybook-static/assets/event-constants-CMO9VQVu.js +1 -0
  106. package/.storybook-static/assets/iframe-B3A6OXQU.js +1104 -0
  107. package/.storybook-static/assets/index-B-eiLVzF.js +7 -0
  108. package/.storybook-static/assets/index-QquxUozE.js +6 -0
  109. package/.storybook-static/assets/matchers-5TDFFDYO-HJu_DfWo.js +14 -0
  110. package/.storybook-static/assets/mediaQueryMixin-CISNqd93.js +1 -0
  111. package/.storybook-static/assets/preload-helper-PPVm8Dsz.js +1 -0
  112. package/.storybook-static/assets/tracking-ATsLLehC.js +1 -0
  113. package/.storybook-static/css/tailwind-brandCrowd.css +2508 -0
  114. package/.storybook-static/css/tailwind-brandPage.css +2188 -0
  115. package/.storybook-static/css/tailwind-crazyDomains.css +2508 -0
  116. package/.storybook-static/css/tailwind-designCom.css +2508 -0
  117. package/.storybook-static/css/tailwind-designCrowd.css +2508 -0
  118. package/.storybook-static/favicon-wrapper.svg +46 -0
  119. package/.storybook-static/favicon.svg +1 -0
  120. package/.storybook-static/iframe.html +713 -0
  121. package/.storybook-static/index.html +148 -0
  122. package/.storybook-static/index.json +1 -0
  123. package/.storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  124. package/.storybook-static/nunito-sans-bold.woff2 +0 -0
  125. package/.storybook-static/nunito-sans-italic.woff2 +0 -0
  126. package/.storybook-static/nunito-sans-regular.woff2 +0 -0
  127. package/.storybook-static/project.json +1 -0
  128. package/.storybook-static/sb-addons/a11y-1/manager-bundle.js +57 -0
  129. package/.storybook-static/sb-addons/links-2/manager-bundle.js +3 -0
  130. package/.storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +628 -0
  131. package/.storybook-static/sb-addons/themes-3/manager-bundle.js +3 -0
  132. package/.storybook-static/sb-common-assets/favicon-wrapper.svg +46 -0
  133. package/.storybook-static/sb-common-assets/favicon.svg +1 -0
  134. package/.storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  135. package/.storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  136. package/.storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  137. package/.storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  138. package/.storybook-static/sb-manager/globals-runtime.js +77935 -0
  139. package/.storybook-static/sb-manager/globals.js +24 -0
  140. package/.storybook-static/sb-manager/manager-stores.js +23 -0
  141. package/.storybook-static/sb-manager/runtime.js +20404 -0
  142. package/.storybook-static/vite-inject-mocker-entry.js +2 -0
  143. package/CLAUDE.md +12 -4
  144. package/README.md +20 -7
  145. package/dist/css/tailwind-brandCrowd.css +4 -59
  146. package/dist/css/tailwind-brandPage.css +3 -46
  147. package/dist/css/tailwind-crazyDomains.css +4 -59
  148. package/dist/css/tailwind-designCom.css +4 -59
  149. package/dist/css/tailwind-designCrowd.css +4 -59
  150. package/package.json +1 -1
  151. package/public/css/tailwind-brandCrowd.css +2563 -0
  152. package/public/css/tailwind-brandPage.css +2231 -0
  153. package/public/css/tailwind-crazyDomains.css +2563 -0
  154. package/public/css/tailwind-designCom.css +2563 -0
  155. package/public/css/tailwind-designCrowd.css +2563 -0
  156. package/scripts/publish-uat.sh +149 -0
  157. package/src/atoms/components/VoiceToTextButton/VoiceToTextButton.vue +3 -0
  158. package/src/useVoiceToText.ts +12 -4
  159. package/.claude/skills/playwright-cli/SKILL.md +0 -278
  160. package/.claude/skills/playwright-cli/references/request-mocking.md +0 -87
  161. package/.claude/skills/playwright-cli/references/running-code.md +0 -232
  162. package/.claude/skills/playwright-cli/references/session-management.md +0 -169
  163. package/.claude/skills/playwright-cli/references/storage-state.md +0 -275
  164. package/.claude/skills/playwright-cli/references/test-generation.md +0 -88
  165. package/.claude/skills/playwright-cli/references/tracing.md +0 -139
  166. package/.claude/skills/playwright-cli/references/video-recording.md +0 -43
@@ -1,232 +0,0 @@
1
- # Running Custom Playwright Code
2
-
3
- Use `run-code` to execute arbitrary Playwright code for advanced scenarios not covered by CLI commands.
4
-
5
- ## Syntax
6
-
7
- ```bash
8
- playwright-cli run-code "async page => {
9
- // Your Playwright code here
10
- // Access page.context() for browser context operations
11
- }"
12
- ```
13
-
14
- ## Geolocation
15
-
16
- ```bash
17
- # Grant geolocation permission and set location
18
- playwright-cli run-code "async page => {
19
- await page.context().grantPermissions(['geolocation']);
20
- await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
21
- }"
22
-
23
- # Set location to London
24
- playwright-cli run-code "async page => {
25
- await page.context().grantPermissions(['geolocation']);
26
- await page.context().setGeolocation({ latitude: 51.5074, longitude: -0.1278 });
27
- }"
28
-
29
- # Clear geolocation override
30
- playwright-cli run-code "async page => {
31
- await page.context().clearPermissions();
32
- }"
33
- ```
34
-
35
- ## Permissions
36
-
37
- ```bash
38
- # Grant multiple permissions
39
- playwright-cli run-code "async page => {
40
- await page.context().grantPermissions([
41
- 'geolocation',
42
- 'notifications',
43
- 'camera',
44
- 'microphone'
45
- ]);
46
- }"
47
-
48
- # Grant permissions for specific origin
49
- playwright-cli run-code "async page => {
50
- await page.context().grantPermissions(['clipboard-read'], {
51
- origin: 'https://example.com'
52
- });
53
- }"
54
- ```
55
-
56
- ## Media Emulation
57
-
58
- ```bash
59
- # Emulate dark color scheme
60
- playwright-cli run-code "async page => {
61
- await page.emulateMedia({ colorScheme: 'dark' });
62
- }"
63
-
64
- # Emulate light color scheme
65
- playwright-cli run-code "async page => {
66
- await page.emulateMedia({ colorScheme: 'light' });
67
- }"
68
-
69
- # Emulate reduced motion
70
- playwright-cli run-code "async page => {
71
- await page.emulateMedia({ reducedMotion: 'reduce' });
72
- }"
73
-
74
- # Emulate print media
75
- playwright-cli run-code "async page => {
76
- await page.emulateMedia({ media: 'print' });
77
- }"
78
- ```
79
-
80
- ## Wait Strategies
81
-
82
- ```bash
83
- # Wait for network idle
84
- playwright-cli run-code "async page => {
85
- await page.waitForLoadState('networkidle');
86
- }"
87
-
88
- # Wait for specific element
89
- playwright-cli run-code "async page => {
90
- await page.waitForSelector('.loading', { state: 'hidden' });
91
- }"
92
-
93
- # Wait for function to return true
94
- playwright-cli run-code "async page => {
95
- await page.waitForFunction(() => window.appReady === true);
96
- }"
97
-
98
- # Wait with timeout
99
- playwright-cli run-code "async page => {
100
- await page.waitForSelector('.result', { timeout: 10000 });
101
- }"
102
- ```
103
-
104
- ## Frames and Iframes
105
-
106
- ```bash
107
- # Work with iframe
108
- playwright-cli run-code "async page => {
109
- const frame = page.locator('iframe#my-iframe').contentFrame();
110
- await frame.locator('button').click();
111
- }"
112
-
113
- # Get all frames
114
- playwright-cli run-code "async page => {
115
- const frames = page.frames();
116
- return frames.map(f => f.url());
117
- }"
118
- ```
119
-
120
- ## File Downloads
121
-
122
- ```bash
123
- # Handle file download
124
- playwright-cli run-code "async page => {
125
- const [download] = await Promise.all([
126
- page.waitForEvent('download'),
127
- page.click('a.download-link')
128
- ]);
129
- await download.saveAs('./downloaded-file.pdf');
130
- return download.suggestedFilename();
131
- }"
132
- ```
133
-
134
- ## Clipboard
135
-
136
- ```bash
137
- # Read clipboard (requires permission)
138
- playwright-cli run-code "async page => {
139
- await page.context().grantPermissions(['clipboard-read']);
140
- return await page.evaluate(() => navigator.clipboard.readText());
141
- }"
142
-
143
- # Write to clipboard
144
- playwright-cli run-code "async page => {
145
- await page.evaluate(text => navigator.clipboard.writeText(text), 'Hello clipboard!');
146
- }"
147
- ```
148
-
149
- ## Page Information
150
-
151
- ```bash
152
- # Get page title
153
- playwright-cli run-code "async page => {
154
- return await page.title();
155
- }"
156
-
157
- # Get current URL
158
- playwright-cli run-code "async page => {
159
- return page.url();
160
- }"
161
-
162
- # Get page content
163
- playwright-cli run-code "async page => {
164
- return await page.content();
165
- }"
166
-
167
- # Get viewport size
168
- playwright-cli run-code "async page => {
169
- return page.viewportSize();
170
- }"
171
- ```
172
-
173
- ## JavaScript Execution
174
-
175
- ```bash
176
- # Execute JavaScript and return result
177
- playwright-cli run-code "async page => {
178
- return await page.evaluate(() => {
179
- return {
180
- userAgent: navigator.userAgent,
181
- language: navigator.language,
182
- cookiesEnabled: navigator.cookieEnabled
183
- };
184
- });
185
- }"
186
-
187
- # Pass arguments to evaluate
188
- playwright-cli run-code "async page => {
189
- const multiplier = 5;
190
- return await page.evaluate(m => document.querySelectorAll('li').length * m, multiplier);
191
- }"
192
- ```
193
-
194
- ## Error Handling
195
-
196
- ```bash
197
- # Try-catch in run-code
198
- playwright-cli run-code "async page => {
199
- try {
200
- await page.click('.maybe-missing', { timeout: 1000 });
201
- return 'clicked';
202
- } catch (e) {
203
- return 'element not found';
204
- }
205
- }"
206
- ```
207
-
208
- ## Complex Workflows
209
-
210
- ```bash
211
- # Login and save state
212
- playwright-cli run-code "async page => {
213
- await page.goto('https://example.com/login');
214
- await page.fill('input[name=email]', 'user@example.com');
215
- await page.fill('input[name=password]', 'secret');
216
- await page.click('button[type=submit]');
217
- await page.waitForURL('**/dashboard');
218
- await page.context().storageState({ path: 'auth.json' });
219
- return 'Login successful';
220
- }"
221
-
222
- # Scrape data from multiple pages
223
- playwright-cli run-code "async page => {
224
- const results = [];
225
- for (let i = 1; i <= 3; i++) {
226
- await page.goto(\`https://example.com/page/\${i}\`);
227
- const items = await page.locator('.item').allTextContents();
228
- results.push(...items);
229
- }
230
- return results;
231
- }"
232
- ```
@@ -1,169 +0,0 @@
1
- # Browser Session Management
2
-
3
- Run multiple isolated browser sessions concurrently with state persistence.
4
-
5
- ## Named Browser Sessions
6
-
7
- Use `-s` flag to isolate browser contexts:
8
-
9
- ```bash
10
- # Browser 1: Authentication flow
11
- playwright-cli -s=auth open https://app.example.com/login
12
-
13
- # Browser 2: Public browsing (separate cookies, storage)
14
- playwright-cli -s=public open https://example.com
15
-
16
- # Commands are isolated by browser session
17
- playwright-cli -s=auth fill e1 "user@example.com"
18
- playwright-cli -s=public snapshot
19
- ```
20
-
21
- ## Browser Session Isolation Properties
22
-
23
- Each browser session has independent:
24
- - Cookies
25
- - LocalStorage / SessionStorage
26
- - IndexedDB
27
- - Cache
28
- - Browsing history
29
- - Open tabs
30
-
31
- ## Browser Session Commands
32
-
33
- ```bash
34
- # List all browser sessions
35
- playwright-cli list
36
-
37
- # Stop a browser session (close the browser)
38
- playwright-cli close # stop the default browser
39
- playwright-cli -s=mysession close # stop a named browser
40
-
41
- # Stop all browser sessions
42
- playwright-cli close-all
43
-
44
- # Forcefully kill all daemon processes (for stale/zombie processes)
45
- playwright-cli kill-all
46
-
47
- # Delete browser session user data (profile directory)
48
- playwright-cli delete-data # delete default browser data
49
- playwright-cli -s=mysession delete-data # delete named browser data
50
- ```
51
-
52
- ## Environment Variable
53
-
54
- Set a default browser session name via environment variable:
55
-
56
- ```bash
57
- export PLAYWRIGHT_CLI_SESSION="mysession"
58
- playwright-cli open example.com # Uses "mysession" automatically
59
- ```
60
-
61
- ## Common Patterns
62
-
63
- ### Concurrent Scraping
64
-
65
- ```bash
66
- #!/bin/bash
67
- # Scrape multiple sites concurrently
68
-
69
- # Start all browsers
70
- playwright-cli -s=site1 open https://site1.com &
71
- playwright-cli -s=site2 open https://site2.com &
72
- playwright-cli -s=site3 open https://site3.com &
73
- wait
74
-
75
- # Take snapshots from each
76
- playwright-cli -s=site1 snapshot
77
- playwright-cli -s=site2 snapshot
78
- playwright-cli -s=site3 snapshot
79
-
80
- # Cleanup
81
- playwright-cli close-all
82
- ```
83
-
84
- ### A/B Testing Sessions
85
-
86
- ```bash
87
- # Test different user experiences
88
- playwright-cli -s=variant-a open "https://app.com?variant=a"
89
- playwright-cli -s=variant-b open "https://app.com?variant=b"
90
-
91
- # Compare
92
- playwright-cli -s=variant-a screenshot
93
- playwright-cli -s=variant-b screenshot
94
- ```
95
-
96
- ### Persistent Profile
97
-
98
- By default, browser profile is kept in memory only. Use `--persistent` flag on `open` to persist the browser profile to disk:
99
-
100
- ```bash
101
- # Use persistent profile (auto-generated location)
102
- playwright-cli open https://example.com --persistent
103
-
104
- # Use persistent profile with custom directory
105
- playwright-cli open https://example.com --profile=/path/to/profile
106
- ```
107
-
108
- ## Default Browser Session
109
-
110
- When `-s` is omitted, commands use the default browser session:
111
-
112
- ```bash
113
- # These use the same default browser session
114
- playwright-cli open https://example.com
115
- playwright-cli snapshot
116
- playwright-cli close # Stops default browser
117
- ```
118
-
119
- ## Browser Session Configuration
120
-
121
- Configure a browser session with specific settings when opening:
122
-
123
- ```bash
124
- # Open with config file
125
- playwright-cli open https://example.com --config=.playwright/my-cli.json
126
-
127
- # Open with specific browser
128
- playwright-cli open https://example.com --browser=firefox
129
-
130
- # Open in headed mode
131
- playwright-cli open https://example.com --headed
132
-
133
- # Open with persistent profile
134
- playwright-cli open https://example.com --persistent
135
- ```
136
-
137
- ## Best Practices
138
-
139
- ### 1. Name Browser Sessions Semantically
140
-
141
- ```bash
142
- # GOOD: Clear purpose
143
- playwright-cli -s=github-auth open https://github.com
144
- playwright-cli -s=docs-scrape open https://docs.example.com
145
-
146
- # AVOID: Generic names
147
- playwright-cli -s=s1 open https://github.com
148
- ```
149
-
150
- ### 2. Always Clean Up
151
-
152
- ```bash
153
- # Stop browsers when done
154
- playwright-cli -s=auth close
155
- playwright-cli -s=scrape close
156
-
157
- # Or stop all at once
158
- playwright-cli close-all
159
-
160
- # If browsers become unresponsive or zombie processes remain
161
- playwright-cli kill-all
162
- ```
163
-
164
- ### 3. Delete Stale Browser Data
165
-
166
- ```bash
167
- # Remove old browser data to free disk space
168
- playwright-cli -s=oldsession delete-data
169
- ```
@@ -1,275 +0,0 @@
1
- # Storage Management
2
-
3
- Manage cookies, localStorage, sessionStorage, and browser storage state.
4
-
5
- ## Storage State
6
-
7
- Save and restore complete browser state including cookies and storage.
8
-
9
- ### Save Storage State
10
-
11
- ```bash
12
- # Save to auto-generated filename (storage-state-{timestamp}.json)
13
- playwright-cli state-save
14
-
15
- # Save to specific filename
16
- playwright-cli state-save my-auth-state.json
17
- ```
18
-
19
- ### Restore Storage State
20
-
21
- ```bash
22
- # Load storage state from file
23
- playwright-cli state-load my-auth-state.json
24
-
25
- # Reload page to apply cookies
26
- playwright-cli open https://example.com
27
- ```
28
-
29
- ### Storage State File Format
30
-
31
- The saved file contains:
32
-
33
- ```json
34
- {
35
- "cookies": [
36
- {
37
- "name": "session_id",
38
- "value": "abc123",
39
- "domain": "example.com",
40
- "path": "/",
41
- "expires": 1735689600,
42
- "httpOnly": true,
43
- "secure": true,
44
- "sameSite": "Lax"
45
- }
46
- ],
47
- "origins": [
48
- {
49
- "origin": "https://example.com",
50
- "localStorage": [
51
- { "name": "theme", "value": "dark" },
52
- { "name": "user_id", "value": "12345" }
53
- ]
54
- }
55
- ]
56
- }
57
- ```
58
-
59
- ## Cookies
60
-
61
- ### List All Cookies
62
-
63
- ```bash
64
- playwright-cli cookie-list
65
- ```
66
-
67
- ### Filter Cookies by Domain
68
-
69
- ```bash
70
- playwright-cli cookie-list --domain=example.com
71
- ```
72
-
73
- ### Filter Cookies by Path
74
-
75
- ```bash
76
- playwright-cli cookie-list --path=/api
77
- ```
78
-
79
- ### Get Specific Cookie
80
-
81
- ```bash
82
- playwright-cli cookie-get session_id
83
- ```
84
-
85
- ### Set a Cookie
86
-
87
- ```bash
88
- # Basic cookie
89
- playwright-cli cookie-set session abc123
90
-
91
- # Cookie with options
92
- playwright-cli cookie-set session abc123 --domain=example.com --path=/ --httpOnly --secure --sameSite=Lax
93
-
94
- # Cookie with expiration (Unix timestamp)
95
- playwright-cli cookie-set remember_me token123 --expires=1735689600
96
- ```
97
-
98
- ### Delete a Cookie
99
-
100
- ```bash
101
- playwright-cli cookie-delete session_id
102
- ```
103
-
104
- ### Clear All Cookies
105
-
106
- ```bash
107
- playwright-cli cookie-clear
108
- ```
109
-
110
- ### Advanced: Multiple Cookies or Custom Options
111
-
112
- For complex scenarios like adding multiple cookies at once, use `run-code`:
113
-
114
- ```bash
115
- playwright-cli run-code "async page => {
116
- await page.context().addCookies([
117
- { name: 'session_id', value: 'sess_abc123', domain: 'example.com', path: '/', httpOnly: true },
118
- { name: 'preferences', value: JSON.stringify({ theme: 'dark' }), domain: 'example.com', path: '/' }
119
- ]);
120
- }"
121
- ```
122
-
123
- ## Local Storage
124
-
125
- ### List All localStorage Items
126
-
127
- ```bash
128
- playwright-cli localstorage-list
129
- ```
130
-
131
- ### Get Single Value
132
-
133
- ```bash
134
- playwright-cli localstorage-get token
135
- ```
136
-
137
- ### Set Value
138
-
139
- ```bash
140
- playwright-cli localstorage-set theme dark
141
- ```
142
-
143
- ### Set JSON Value
144
-
145
- ```bash
146
- playwright-cli localstorage-set user_settings '{"theme":"dark","language":"en"}'
147
- ```
148
-
149
- ### Delete Single Item
150
-
151
- ```bash
152
- playwright-cli localstorage-delete token
153
- ```
154
-
155
- ### Clear All localStorage
156
-
157
- ```bash
158
- playwright-cli localstorage-clear
159
- ```
160
-
161
- ### Advanced: Multiple Operations
162
-
163
- For complex scenarios like setting multiple values at once, use `run-code`:
164
-
165
- ```bash
166
- playwright-cli run-code "async page => {
167
- await page.evaluate(() => {
168
- localStorage.setItem('token', 'jwt_abc123');
169
- localStorage.setItem('user_id', '12345');
170
- localStorage.setItem('expires_at', Date.now() + 3600000);
171
- });
172
- }"
173
- ```
174
-
175
- ## Session Storage
176
-
177
- ### List All sessionStorage Items
178
-
179
- ```bash
180
- playwright-cli sessionstorage-list
181
- ```
182
-
183
- ### Get Single Value
184
-
185
- ```bash
186
- playwright-cli sessionstorage-get form_data
187
- ```
188
-
189
- ### Set Value
190
-
191
- ```bash
192
- playwright-cli sessionstorage-set step 3
193
- ```
194
-
195
- ### Delete Single Item
196
-
197
- ```bash
198
- playwright-cli sessionstorage-delete step
199
- ```
200
-
201
- ### Clear sessionStorage
202
-
203
- ```bash
204
- playwright-cli sessionstorage-clear
205
- ```
206
-
207
- ## IndexedDB
208
-
209
- ### List Databases
210
-
211
- ```bash
212
- playwright-cli run-code "async page => {
213
- return await page.evaluate(async () => {
214
- const databases = await indexedDB.databases();
215
- return databases;
216
- });
217
- }"
218
- ```
219
-
220
- ### Delete Database
221
-
222
- ```bash
223
- playwright-cli run-code "async page => {
224
- await page.evaluate(() => {
225
- indexedDB.deleteDatabase('myDatabase');
226
- });
227
- }"
228
- ```
229
-
230
- ## Common Patterns
231
-
232
- ### Authentication State Reuse
233
-
234
- ```bash
235
- # Step 1: Login and save state
236
- playwright-cli open https://app.example.com/login
237
- playwright-cli snapshot
238
- playwright-cli fill e1 "user@example.com"
239
- playwright-cli fill e2 "password123"
240
- playwright-cli click e3
241
-
242
- # Save the authenticated state
243
- playwright-cli state-save auth.json
244
-
245
- # Step 2: Later, restore state and skip login
246
- playwright-cli state-load auth.json
247
- playwright-cli open https://app.example.com/dashboard
248
- # Already logged in!
249
- ```
250
-
251
- ### Save and Restore Roundtrip
252
-
253
- ```bash
254
- # Set up authentication state
255
- playwright-cli open https://example.com
256
- playwright-cli eval "() => { document.cookie = 'session=abc123'; localStorage.setItem('user', 'john'); }"
257
-
258
- # Save state to file
259
- playwright-cli state-save my-session.json
260
-
261
- # ... later, in a new session ...
262
-
263
- # Restore state
264
- playwright-cli state-load my-session.json
265
- playwright-cli open https://example.com
266
- # Cookies and localStorage are restored!
267
- ```
268
-
269
- ## Security Notes
270
-
271
- - Never commit storage state files containing auth tokens
272
- - Add `*.auth-state.json` to `.gitignore`
273
- - Delete state files after automation completes
274
- - Use environment variables for sensitive data
275
- - By default, sessions run in-memory mode which is safer for sensitive operations