diff --git a/.github/workflows/typescript_test.yml b/.github/workflows/typescript_test.yml index bd06b5dab..8b91001ca 100644 --- a/.github/workflows/typescript_test.yml +++ b/.github/workflows/typescript_test.yml @@ -1,16 +1,11 @@ name: Run Frontend Tests on: - workflow_dispatch: - inputs: - branch: - description: "Branch to run tests on" - required: true - type: string - + pull_request: + merge_group: env: - POETRY_VERSION: "1.8.2" + POETRY_VERSION: "1.8.3" NODE_VERSION: "21" PYTHON_VERSION: "3.12" # Define the directory where Playwright browsers will be installed. @@ -19,18 +14,19 @@ env: jobs: setup-and-test: - name: Run Frontend Tests on branch ${{ inputs.branch }} + name: Run Playwright Tests runs-on: ubuntu-latest strategy: fail-fast: false matrix: - shardIndex: [1, 2, 3, 4] - shardTotal: [4] + shardIndex: [1, 2, 3, 4, 5, 6, 7, 8] + shardTotal: [8] + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + STORE_API_KEY: ${{ secrets.STORE_API_KEY }} steps: - name: Checkout code uses: actions/checkout@v4 - with: - ref: ${{ inputs.branch }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -52,14 +48,15 @@ jobs: cd src/frontend npm ci if: ${{ steps.setup-node.outputs.cache-hit != 'true' }} - - - name: Cache playwright binaries - uses: actions/cache@v4 + - name: Get Playwright version + run: echo "PLAYWRIGHT_VERSION=$(jq '.devDependencies["@playwright/test"]' src/frontend/package.json -r)" >> $GITHUB_ENV + - name: Cache Playwright binaries id: playwright-cache + uses: actions/cache@v4 with: - path: | - ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/package-lock.json') }} + path: ~/.cache/ms-playwright + key: playwright-browsers-${{ runner.os }}-${{ env.PLAYWRIGHT_VERSION }} + - name: Install Frontend dependencies run: | cd src/frontend diff --git a/src/frontend/playwright.config.ts b/src/frontend/playwright.config.ts index d6ecfd6ac..fa1df86e3 100644 --- a/src/frontend/playwright.config.ts +++ b/src/frontend/playwright.config.ts @@ -15,11 +15,11 @@ dotenv.config({ path: path.resolve(__dirname, "../../.env") }); export default defineConfig({ testDir: "./tests", /* Run tests in files in parallel */ - fullyParallel: true, + fullyParallel: false, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, + retries: process.env.CI ? 2 : 3, /* Opt out of parallel tests on CI. */ workers: 2, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index 9e5825155..a77877a2f 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -229,6 +229,7 @@ export default function CollectionCardComponent({ render={({ field }) => ( { await page .getByTestId("popover-anchor-input-openai_api_key") .fill(process.env.OPENAI_API_KEY ?? ""); + + await page.getByTestId("dropdown-model_name").click(); + await page.getByTestId("gpt-4o-0-option").click(); + + await page.waitForTimeout(2000); await page.getByTestId("button_run_chat output").first().click(); await page.waitForTimeout(2000); diff --git a/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/textAreaWrapper/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/textAreaWrapper/index.tsx index 29f88453a..0a9ba4a7e 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/textAreaWrapper/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/textAreaWrapper/index.tsx @@ -45,6 +45,7 @@ const TextAreaWrapper = ({ return (