diff --git a/.github/workflows/playwright.js.yml b/.github/workflows/playwright.js.yml deleted file mode 100644 index 21f6e57..0000000 --- a/.github/workflows/playwright.js.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Playwright tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - schedule: - # nightly - - cron: '0 0 * * *' - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x, 16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Install dependencies - run: npm ci - - name: Install Playwright - run: npx playwright install --with-deps - - name: Build production build - run: npm run build - - name: Run your tests - run: npm run test - \ No newline at end of file diff --git a/README.md b/README.md index e6ba2e3..bcc7aaf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![E2E tests](https://github.com/staticwebdev/nextjs-starter/actions/workflows/playwright.js.yml/badge.svg)](https://github.com/staticwebdev/nextjs-starter/actions/workflows/playwright.js.yml) - # Next.js starter [Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/overview) allows you to easily build [Next.js](https://nextjs.org/) apps in minutes. Use this repo with the [Next.js tutorial](https://docs.microsoft.com/azure/static-web-apps/deploy-nextjs) to build and customize a new static site. diff --git a/package.json b/package.json index 7c86d4c..faae7cc 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "dev": "next dev", "fix": "next lint --fix", "lint": "next lint", - "start": "next start", - "test": "playwright test" + "start": "next start" }, "dependencies": { "isomorphic-unfetch": "^3.0.0", @@ -17,7 +16,6 @@ "react-dom": "^17.0.2" }, "devDependencies": { - "@playwright/test": "^1.20.0", "eslint": "^8.11.0", "eslint-config-next": "^12.1.0", "eslint-config-prettier": "^8.5.0", diff --git a/playwright.config.ts b/playwright.config.ts deleted file mode 100644 index 079f626..0000000 --- a/playwright.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { PlaywrightTestConfig } from '@playwright/test'; -const config: PlaywrightTestConfig = { - use: { - baseURL: "http://localhost:3000/" - }, - webServer: { - command: 'npm run start', - port: 3000, - timeout: 120 * 1000, - reuseExistingServer: !process.env.CI, - }, -}; -export default config; \ No newline at end of file diff --git a/test/integration.spec.ts b/test/integration.spec.ts deleted file mode 100644 index b1059dc..0000000 --- a/test/integration.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('should navigate to the react page', async ({ page }) => { - // Start from the index page (the baseURL is set via the webServer in the playwright.config.ts) - await page.goto('/') - // Find an element with the text 'About Page' and click on it - await page.click('text=React') - // The new url should be "/project/facebook-react/" (baseURL is used there) - await expect(page).toHaveURL('/project/facebook-react/') - // The new page should contain an h3 with "You can deploy..." - await expect(page.locator('.project')).toContainText('Home') -}) - -test('should have stats', async ({ page }) => { - // Start from the index page (the baseURL is set via the webServer in the playwright.config.ts) - await page.goto('/project/facebook-react/') - // The new page should contain stats, there should be more than 100k starts for react - const numberOfStars = await page.innerText('.stats-details:first-of-type div p') - expect(Number(numberOfStars)).toBeGreaterThan(100000); -})