From 3ef0f15aa80c18ed18aa78568450300364d76d51 Mon Sep 17 00:00:00 2001 From: Sarah Schwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:32:40 -0600 Subject: [PATCH] fix: interactive cli --- .github/workflows/playwright.yaml | 9 +++++++-- tests/utils/runCommand.ts | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml index 7eb5eaa..cda3d60 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright.yaml @@ -11,7 +11,7 @@ jobs: matrix: tutorial: - "tests/erc20-paymaster.spec.ts" - - "tests/how-to-test-contracts.spec.ts" + - "tests/how-to-test-contracts.spec.ts" steps: - uses: actions/checkout@v4 @@ -22,4 +22,9 @@ jobs: - name: Install Playwright Browsers run: bun playwright install chromium --with-deps - name: Run test for ${{ matrix.tutorial }} - run: bun test:github ${{ matrix.tutorial }} + run: | + export TERM=xterm-256color + export COLUMNS=80 + export LINES=24 + script -q -c "bun test:github ${{ matrix.tutorial }}" + diff --git a/tests/utils/runCommand.ts b/tests/utils/runCommand.ts index 1dae351..32e342b 100644 --- a/tests/utils/runCommand.ts +++ b/tests/utils/runCommand.ts @@ -103,11 +103,12 @@ export async function runWithPrompts(page: Page, command: string, prompts: strin }); ptyProcess.onData((data) => { - process.stdout.write(data); + console.log('DATA:', data); for (let index = 0; index < promptsArray.length; index++) { const promptObject = promptsArray[index]; if (data.includes(promptObject.prompt)) { + console.log('FOUND PROMPT:', promptObject.prompt); ptyProcess.write(promptObject.answer + '\r'); } } @@ -115,5 +116,6 @@ export async function runWithPrompts(page: Page, command: string, prompts: strin ptyProcess.write(command + '\r'); - await page.waitForTimeout(5000); + await page.waitForTimeout(35000); + console.log('waited 35 seconds'); }