Skip to content

Commit 4343ec0

Browse files
authored
fix(tests): use positional arg syntax in browser search tests (#302)
Replace redundant --keyword/--query named flags with positional arg syntax for all search commands that declare positional: true. Also fix --query usage in tiktok.md docs example. Affected: - bilibili, weibo, zhihu, reuters, youtube, smzdm, boss, coupang, xiaohongshu search (browser-public.test.ts) - linux-do search (browser-auth.test.ts) - tiktok search (docs/adapters/browser/tiktok.md)
1 parent f00a5d1 commit 4343ec0

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

docs/adapters/browser/tiktok.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
opencli tiktok profile --username tiktok
3030

3131
# Search videos
32-
opencli tiktok search --query "cooking" --limit 10
32+
opencli tiktok search "cooking" --limit 10
3333

3434
# Trending explore videos
3535
opencli tiktok explore --limit 20

tests/e2e/browser-auth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('login-required commands — graceful failure', () => {
101101
}, 60_000);
102102

103103
it('linux-do search fails gracefully without login', async () => {
104-
await expectGracefulAuthFailure(['linux-do', 'search', '--keyword', 'test', '--limit', '3', '-f', 'json'], 'linux-do search');
104+
await expectGracefulAuthFailure(['linux-do', 'search', 'test', '--limit', '3', '-f', 'json'], 'linux-do search');
105105
}, 60_000);
106106

107107
// ── xiaohongshu (requires login) ──

tests/e2e/browser-public.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('browser public-data commands E2E', () => {
9292
}, 60_000);
9393

9494
it('bilibili search returns results', async () => {
95-
const data = await tryBrowserCommand(['bilibili', 'search', '--keyword', 'typescript', '--limit', '3', '-f', 'json']);
95+
const data = await tryBrowserCommand(['bilibili', 'search', 'typescript', '--limit', '3', '-f', 'json']);
9696
expectDataOrSkip(data, 'bilibili search');
9797
}, 60_000);
9898

@@ -103,7 +103,7 @@ describe('browser public-data commands E2E', () => {
103103
}, 60_000);
104104

105105
it('weibo search returns results', async () => {
106-
const data = await tryBrowserCommand(['weibo', 'search', '--keyword', 'openai', '--limit', '3', '-f', 'json']);
106+
const data = await tryBrowserCommand(['weibo', 'search', 'openai', '--limit', '3', '-f', 'json']);
107107
expectDataOrSkip(data, 'weibo search');
108108
}, 60_000);
109109

@@ -117,7 +117,7 @@ describe('browser public-data commands E2E', () => {
117117
}, 60_000);
118118

119119
it('zhihu search returns results', async () => {
120-
const data = await tryBrowserCommand(['zhihu', 'search', '--keyword', 'playwright', '--limit', '3', '-f', 'json']);
120+
const data = await tryBrowserCommand(['zhihu', 'search', 'playwright', '--limit', '3', '-f', 'json']);
121121
expectDataOrSkip(data, 'zhihu search');
122122
}, 60_000);
123123

@@ -151,25 +151,25 @@ describe('browser public-data commands E2E', () => {
151151

152152
// ── reuters (browser: true) ──
153153
it('reuters search returns articles', async () => {
154-
const data = await tryBrowserCommand(['reuters', 'search', '--keyword', 'technology', '--limit', '3', '-f', 'json']);
154+
const data = await tryBrowserCommand(['reuters', 'search', 'technology', '--limit', '3', '-f', 'json']);
155155
expectDataOrSkip(data, 'reuters search');
156156
}, 60_000);
157157

158158
// ── youtube (browser: true) ──
159159
it('youtube search returns videos', async () => {
160-
const data = await tryBrowserCommand(['youtube', 'search', '--keyword', 'typescript tutorial', '--limit', '3', '-f', 'json']);
160+
const data = await tryBrowserCommand(['youtube', 'search', 'typescript tutorial', '--limit', '3', '-f', 'json']);
161161
expectDataOrSkip(data, 'youtube search');
162162
}, 60_000);
163163

164164
// ── smzdm (browser: true) ──
165165
it('smzdm search returns deals', async () => {
166-
const data = await tryBrowserCommand(['smzdm', 'search', '--keyword', '键盘', '--limit', '3', '-f', 'json']);
166+
const data = await tryBrowserCommand(['smzdm', 'search', '键盘', '--limit', '3', '-f', 'json']);
167167
expectDataOrSkip(data, 'smzdm search');
168168
}, 60_000);
169169

170170
// ── boss (browser: true) ──
171171
it('boss search returns jobs', async () => {
172-
const data = await tryBrowserCommand(['boss', 'search', '--keyword', 'golang', '--limit', '3', '-f', 'json']);
172+
const data = await tryBrowserCommand(['boss', 'search', 'golang', '--limit', '3', '-f', 'json']);
173173
expectDataOrSkip(data, 'boss search');
174174
}, 60_000);
175175

@@ -181,13 +181,13 @@ describe('browser public-data commands E2E', () => {
181181

182182
// ── coupang (browser: true) ──
183183
it('coupang search returns products', async () => {
184-
const data = await tryBrowserCommand(['coupang', 'search', '--keyword', 'laptop', '--limit', '3', '-f', 'json']);
184+
const data = await tryBrowserCommand(['coupang', 'search', 'laptop', '--limit', '3', '-f', 'json']);
185185
expectDataOrSkip(data, 'coupang search');
186186
}, 60_000);
187187

188188
// ── xiaohongshu (browser: true) ──
189189
it('xiaohongshu search returns notes', async () => {
190-
const data = await tryBrowserCommand(['xiaohongshu', 'search', '--keyword', '美食', '--limit', '3', '-f', 'json']);
190+
const data = await tryBrowserCommand(['xiaohongshu', 'search', '美食', '--limit', '3', '-f', 'json']);
191191
expectDataOrSkip(data, 'xiaohongshu search');
192192
}, 60_000);
193193

0 commit comments

Comments
 (0)