diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright_admin.yaml similarity index 94% rename from .github/workflows/playwright.yaml rename to .github/workflows/playwright_admin.yaml index 5b78012d6..73ec1f2fe 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright_admin.yaml @@ -1,4 +1,7 @@ -on: pull_request +on: + pull_request: + paths: + - "assets/admin/**" name: Test @@ -36,7 +39,7 @@ jobs: CI: "true" run: | docker compose run --rm playwright npx playwright install --with-deps - docker compose run --rm playwright npx playwright test + docker compose run --rm playwright npx playwright test admin - uses: actions/upload-artifact@v4 if: always() diff --git a/.github/workflows/playwright_template.yaml b/.github/workflows/playwright_template.yaml new file mode 100644 index 000000000..6288f6a74 --- /dev/null +++ b/.github/workflows/playwright_template.yaml @@ -0,0 +1,49 @@ +on: + pull_request: + paths: + - "assets/template/**" + +name: Test + +env: + COMPOSE_USER: runner + +jobs: + frontend-build-and-test: + name: Playwright + runs-on: ubuntu-latest + strategy: + fail-fast: true + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup network + run: docker network create frontend + + - name: Composer install + run: | + docker compose run --rm phpfpm composer install + + - name: Copy fixture assets to public/fixtures + run: | + docker compose run --rm phpfpm cp -r fixtures/public/fixtures public/fixtures + + - name: Build assets + run: | + docker compose run --rm node npm install + docker compose run --rm node npm run build + + - name: Run playwright + env: + CI: "true" + run: | + docker compose run --rm playwright npx playwright install --with-deps + docker compose run --rm playwright npx playwright test template + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/assets/admin/components/slide/slide-manager.jsx b/assets/admin/components/slide/slide-manager.jsx index b7a725930..916cc7f70 100644 --- a/assets/admin/components/slide/slide-manager.jsx +++ b/assets/admin/components/slide/slide-manager.jsx @@ -45,6 +45,7 @@ function SlideManager({ const dispatch = useDispatch(); const navigate = useNavigate(); + const test = "test"; // Context const context = useContext(UserContext);