diff --git a/.github/workflows/playwright-onDemand.yml b/.github/workflows/playwright-onDemand.yml deleted file mode 100644 index 29f096d..0000000 --- a/.github/workflows/playwright-onDemand.yml +++ /dev/null @@ -1,94 +0,0 @@ - -# This is a basic workflow to help you get started with Actions - -name: Playwright tests - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - schedule: - # nightly - - cron: '0 0 * * *' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - test: - # Runs on an ubuntu runner - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x, 16.x, 18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - - 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 playwright tests - run: npm run playwright_test - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - name: Upload HTML report as Artifact - uses: actions/upload-artifact@v2 - env: - TAG_NAME: test-report-${{ steps.date.outputs.date }} - if: always() - with: - name: onDemand - path: pw-report/ - - storeReports: - name: Store reports - if: ${{ always() }} - needs: test - runs-on: ubuntu-latest - steps: - - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 - id: download - - name: Publish to external repo - if: always() - uses: peaceiris/actions-gh-pages@v3.7.3 - with: - external_repository: mspnp/intern-js-pipeline - publish_branch: gh-pages - personal_token: ${{ secrets.PAT_TOKEN }} - publish_dir: ${{steps.download.outputs.download-path}} - destination_dir: test-reports/${{ github.repository }} - keep_files: true - user_name: "github-actions[bot]" - user_email: "github-actions[bot]@users.noreply.github.com" - - notify-dashboard: - name: Notify Dashboard - if: ${{ always() }} - needs: [test, storeReports] - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - # Runs a single command using the runners shell - - name: Notify docusaurus repo - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - run: | - gh api repos/mspnp/intern-js-pipeline/dispatches \ - --raw-field event_type=rebuild-site diff --git a/.github/workflows/playwright-scheduled.yml b/.github/workflows/playwright-scheduled.yml deleted file mode 100644 index a3e2a9c..0000000 --- a/.github/workflows/playwright-scheduled.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Scheduled Playwright tests - -# Controls when the workflow will run -on: - # Triggers the workflow nightly - schedule: - # nightly - - cron: '0 0 * * *' - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - test: - # Runs on an ubuntu runner - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x, 16.x, 18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - - 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 playwright tests - run: npm run playwright_test - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - name: Upload HTML report as Artifact - uses: actions/upload-artifact@v2 - env: - TAG_NAME: test-report-${{ steps.date.outputs.date }} - if: always() - with: - name: ${{ steps.date.outputs.date }} - path: pw-report/ - - storeReports: - name: Store reports - if: ${{ always() }} - needs: test - runs-on: ubuntu-latest - steps: - - name: Download all workflow run artifacts - uses: actions/download-artifact@v3 - id: download - - name: Publish to external repo - if: always() - uses: peaceiris/actions-gh-pages@v3.7.3 - with: - external_repository: mspnp/intern-js-pipeline - publish_branch: gh-pages - personal_token: ${{ secrets.PAT_TOKEN }} - publish_dir: ${{steps.download.outputs.download-path}} - destination_dir: test-reports/${{ github.repository }} - keep_files: true - user_name: "github-actions[bot]" - user_email: "github-actions[bot]@users.noreply.github.com" - - notify-dashboard: - name: Notify Dashboard - if: ${{ always() }} - needs: [test, storeReports] - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - # Runs a single command using the runners shell - - name: Notify dashboard repo - env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} - run: | - gh api repos/mspnp/intern-js-pipeline/dispatches \ - --raw-field event_type=rebuild-site \ No newline at end of file diff --git a/.gitignore b/.gitignore index d87e3eb..e6b2cfe 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,7 @@ speed-measure-plugin*.json .history/* # misc -/.angular/cache +/.angular/cache /.sass-cache /connect.lock /coverage @@ -44,10 +44,4 @@ testem.log # System Files .DS_Store -Thumbs.db -/test-results/ -/playwright-report/ -/playwright/.cache/ -/test-results/ -/playwright-report/ -/playwright/.cache/ +Thumbs.db diff --git a/package.json b/package.json index 57739d7..030952f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "start": "ng serve", "build": "ng build --configuration production", "test": "ng test", - "playwright_test": "playwright test", "lint": "ng lint", "e2e": "ng e2e", "swa:start": "swa start app", @@ -33,7 +32,6 @@ "@angular/compiler-cli": "~13.2.5", "@angular/language-service": "~13.2.5", "@azure/static-web-apps-cli": "*", - "@playwright/test": "^1.22.2", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", diff --git a/playwright.config.ts b/playwright.config.ts deleted file mode 100644 index 3e378c6..0000000 --- a/playwright.config.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { PlaywrightTestConfig } from '@playwright/test'; -import { devices } from '@playwright/test'; - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// require('dotenv').config(); - -/** - * See https://playwright.dev/docs/test-configuration. - */ -const config: PlaywrightTestConfig = { - testDir: './tests', - /* Maximum time one test can run for. */ - timeout: 30 * 1000, - expect: { - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 5000 - }, - /* Run tests in files in parallel */ - fullyParallel: true, - /* 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, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: [ - ['html', { outputFolder: 'pw-report' }], - ['json', { outputFolder: 'pw-report', outputFile: 'report.json' }] - ], - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 0, - /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://localhost:4200/', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { - ...devices['Desktop Chrome'], - }, - }, - - { - name: 'firefox', - use: { - ...devices['Desktop Firefox'], - }, - }, - - { - name: 'webkit', - use: { - ...devices['Desktop Safari'], - }, - }, - ], - - /* Run your local dev server before starting the tests */ - webServer: { - command: 'npm run start', - port: 4200, - } -}; - -export default config; diff --git a/tests/Test.README.md b/tests/Test.README.md deleted file mode 100644 index a7ac92e..0000000 --- a/tests/Test.README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Testing - -To run unit tests use `npm run test`. -To run end to end tests use `npm run e2e`. -To run playwright tests use `npm run playwright_test`. \ No newline at end of file diff --git a/tests/playwright.spec.ts b/tests/playwright.spec.ts deleted file mode 100644 index 98eddac..0000000 --- a/tests/playwright.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test('basic test', async ({ page }) => { - await page.goto('/'); - await page.waitForSelector('div'); - await expect(page.locator('div')).toContainText('Hello World'); -}) \ No newline at end of file