Skip to content

Commit

Permalink
modify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaiwat10 committed May 9, 2024
1 parent 1ba71c6 commit 57bb3c6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/checkout@v4
- name: CI Setup
uses: ./.github/actions/ci-setup
with:
node-version: ${{ matrix.env.version || 20 }}
- name: Run Fuel Node
run: (cd templates/nextjs && pnpm run fuels:dev) &
- name: Run Next.js server
run: (cd templates/nextjs && pnpm run dev) &
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
18 changes: 9 additions & 9 deletions e2e-tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
await page.goto('http://localhost:3000/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
await expect(page).toHaveTitle(/Fuel/);
});

test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// test('get started link', async ({ page }) => {
// await page.goto('https://playwright.dev/');

// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// // Click the get started link.
// await page.getByRole('link', { name: 'Get started' }).click();

// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
// // Expects page to have a heading with the name of Installation.
// await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
// });

0 comments on commit 57bb3c6

Please sign in to comment.