Skip to content

Commit

Permalink
Fix test tsconfig.json linking for frontend
Browse files Browse the repository at this point in the history
Fix screenshot/playwright report path

Add screenshot/playwright-report to .gitignore
  • Loading branch information
xbtmatt committed Nov 5, 2024
1 parent a0ca536 commit 4d0cd80
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/frontend-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
uses: 'actions/upload-artifact@v4'
with:
name: 'playwright-screenshots'
path: 'src/typescript/screenshots/'
path: 'src/typescript/frontend/screenshots/'
- if: '${{ !cancelled() }}'
name: 'Upload Playwright report as artifact'
uses: 'actions/upload-artifact@v4'
with:
name: 'playwright-report'
path: 'src/typescript/playwright-report/'
path: 'src/typescript/frontend/playwright-report/'
retention-days: 30
timeout-minutes: 15
name: 'Run the frontend tests'
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
},
ecmaVersion: "latest",
sourceType: "module",
project: ["tsconfig.json"],
project: ["tsconfig.json", "tests/tsconfig.json"],
warnOnUnsupportedTypeScriptVersion: false,
},
plugins: ["@typescript-eslint", "import", "prettier"],
Expand Down
3 changes: 3 additions & 0 deletions src/typescript/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ yarn.lock
/playwright-report/
/blob-report/
/playwright/.cache/

screenshots
playwright-report
4 changes: 2 additions & 2 deletions src/typescript/frontend/tests/e2e/market-order.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ test("check sorting order", async ({ page }) => {
await bumpOrder.waitFor({ state: "visible", timeout: 5000 });
expect(bumpOrder).toBeVisible();

await page.screenshot({ path: "screenshots/test-failure.png" });
await page.screenshot({ path: "screenshots/market-order-1.png" });

// Sort by bump order.
await bumpOrder.click();

// Expect the markets to be in bump order.
marketGridItems = page.locator("#emoji-grid a").getByTitle(/RAT,/);
await marketGridItems.first().waitFor({ state: "visible", timeout: 5000 });
await page.screenshot({ path: "screenshots/test-failure-2.png" });
await page.screenshot({ path: "screenshots/market-order-2.png" });
expect(marketGridItems.first()).toBeVisible();
expect(marketGridItems).toHaveText(patterns.reverse());
});
7 changes: 7 additions & 0 deletions src/typescript/frontend/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"include": [
"**/*.ts",
"../playwright.config.ts"
]
}
3 changes: 1 addition & 2 deletions src/typescript/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"./src/**/*.ts",
"./src/**/*.tsx",
".next/types/**/*.ts",
"./dist/types/**/*.ts",
"playwright.config.ts"
"./dist/types/**/*.ts"
]
}

0 comments on commit 4d0cd80

Please sign in to comment.