Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test: simplify conditional skips in playwright specs

Steven Enamakel04804276d90f
diff --git a/app/test/playwright/specs/chat-scroll-stick.spec.ts b/app/test/playwright/specs/chat-scroll-stick.spec.ts
index c191bf2b9e..12574b6a73 100644
--- a/app/test/playwright/specs/chat-scroll-stick.spec.ts
+++ b/app/test/playwright/specs/chat-scroll-stick.spec.ts
@@ -225,11 +225,8 @@ test.describe('Chat transcript stick-to-bottom', () => {
await completeTurn(page, FIRST_PROMPT, 'FIRST-REPLY-END');
const overflowing = await scrollState(page);
- test.skip(
- /* https://github.com/tinyhumansai/openhuman/issues/6563 */
- overflowing.scrollHeight <= overflowing.clientHeight + 200,
- 'transcript did not overflow enough to scroll — viewport too tall for this fixture'
- );
+ const fixtureTooShort = overflowing.scrollHeight <= overflowing.clientHeight + 200;
+ test.skip(fixtureTooShort, 'fixture too short'); // https://github.com/tinyhumansai/openhuman/issues/6563
// Park the reader well above the bottom, past the 80px stick threshold.
const parkedTop = Math.max(0, overflowing.scrollHeight - overflowing.clientHeight - 600);
@@ -292,11 +289,8 @@ test.describe('Chat transcript stick-to-bottom', () => {
await completeTurn(page, FIRST_PROMPT, 'FIRST-REPLY-END');
const first = await scrollState(page);
- test.skip(
- /* https://github.com/tinyhumansai/openhuman/issues/6563 */
- first.scrollHeight <= first.clientHeight + 200,
- 'transcript did not overflow enough to scroll — viewport too tall for this fixture'
- );
+ const firstFixtureTooShort = first.scrollHeight <= first.clientHeight + 200;
+ test.skip(firstFixtureTooShort, 'fixture too short'); // https://github.com/tinyhumansai/openhuman/issues/6563
await scrollTo(page, first.scrollHeight);
expect((await scrollState(page)).distanceFromBottom).toBeLessThanOrEqual(80);
@@ -386,11 +380,8 @@ test.describe('Chat transcript stick-to-bottom', () => {
expect(threadA, 'thread A must have an id').not.toBeNull();
const overflowing = await scrollState(page);
- test.skip(
- /* https://github.com/tinyhumansai/openhuman/issues/6563 */
- overflowing.scrollHeight <= overflowing.clientHeight + 200,
- 'transcript did not overflow enough to scroll — viewport too tall for this fixture'
- );
+ const threadFixtureTooShort = overflowing.scrollHeight <= overflowing.clientHeight + 200;
+ test.skip(threadFixtureTooShort, 'fixture too short'); // https://github.com/tinyhumansai/openhuman/issues/6563
// Thread B. Leaving A is what puts A's messages in the cache.
await startNewThread(page);
diff --git a/app/test/playwright/specs/settings-feature-preferences.spec.ts b/app/test/playwright/specs/settings-feature-preferences.spec.ts
index d7746bcaf3..df7ab9d8d6 100644
--- a/app/test/playwright/specs/settings-feature-preferences.spec.ts
+++ b/app/test/playwright/specs/settings-feature-preferences.spec.ts
@@ -286,20 +286,16 @@ test.describe('Settings - Feature Preferences', () => {
await openAuthenticatedRoute(page, 'pw-settings-mascot-voice', '/settings/voice');
await expect(page.getByText('Mascot Voice')).toBeVisible();
- test.skip(
- /* https://github.com/tinyhumansai/openhuman/issues/1762 */
+ const customVoiceOptionUnavailable =
(await page
.locator('[data-testid="mascot-voice-select"] option[value="__custom__"]')
- .count()) === 0,
- 'custom mascot voice option is unavailable in this build'
- );
+ .count()) === 0;
+ test.skip(customVoiceOptionUnavailable, 'option unavailable'); // https://github.com/tinyhumansai/openhuman/issues/1762
await page.getByTestId('mascot-voice-select').selectOption('__custom__');
- test.skip(
- /* https://github.com/tinyhumansai/openhuman/issues/1762 */
- (await page.getByTestId('mascot-voice-input').count()) === 0,
- 'custom mascot voice input did not appear after selecting __custom__'
- );
+ const customVoiceInputUnavailable =
+ (await page.getByTestId('mascot-voice-input').count()) === 0;
+ test.skip(customVoiceInputUnavailable, 'input unavailable'); // https://github.com/tinyhumansai/openhuman/issues/1762
await page.getByTestId('mascot-voice-input').fill('voice-e2e-custom');
await page.getByTestId('mascot-voice-save-paste').click();