Skip to content

Commit

Permalink
add and read awsuiDebu.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cansuaa committed Jan 14, 2025
1 parent 293d6a4 commit b39703f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ export default function Chat() {
}, waitTimeBeforeResponse + waitTimeBeforeLoading);
};

if (!(window as any).__awsuiDebug?.logs) {

Check warning on line 85 in src/pages/chat/chat.tsx

View workflow job for this annotation

GitHub Actions / build / build

Unexpected any. Specify a different type
(window as any).__awsuiDebug = { logs: [] };

Check warning on line 86 in src/pages/chat/chat.tsx

View workflow job for this annotation

GitHub Actions / build / build

Unexpected any. Specify a different type
}
(window as any).__awsuiDebug.logs.push('isVR demos: ' + isVisualRefresh);

Check warning on line 88 in src/pages/chat/chat.tsx

View workflow job for this annotation

GitHub Actions / build / build

Unexpected any. Specify a different type

return (
<div className={`chat-container ${!isVisualRefresh && 'classic'}`}>
{showAlert && (
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const setupTest = (testFn: { (page: Page): Promise<void> }) => {
});
console.log('html log 2: ', html);

// console.log('useVisualRefresh: ', (window as any).__awsuiDebug?.logs);
const useVisualRefresh = await browser.execute(() => {
return (window as any).__awsuiDebug?.logs;
});
console.log('__awsuiDebug.logs: ', useVisualRefresh);

await expect(page.isPromptInputExisting()).resolves.toBeTruthy();
await expect(page.isPromptInputDisplayedInViewport()).resolves.toBeTruthy();
await expect(page.isPromptInputClickable()).resolves.toBeTruthy();
Expand Down

0 comments on commit b39703f

Please sign in to comment.