Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE#19] add CI config - auto-trigger tests run on CI before merging changes to the base branch (main) #63

Merged
merged 22 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
42fb764
feat: CI init config
bugITwhisperer Nov 28, 2023
4f1bb38
feat: CI init config - Docker attempt
bugITwhisperer Nov 28, 2023
8e1c333
feat: CI init config - Docker attempt2
bugITwhisperer Nov 28, 2023
e8d0fd9
feat: CI init config - Docker attempt3
bugITwhisperer Nov 28, 2023
24f75c2
feat: CI init config - Docker attempt4
bugITwhisperer Nov 28, 2023
58b787a
feat: CI init config - Docker attempt5
bugITwhisperer Nov 28, 2023
f82acde
feat: CI init config - Docker attempt6
bugITwhisperer Nov 28, 2023
06cad93
feat: CI init config - Docker attempt7
bugITwhisperer Nov 28, 2023
76ad7f9
feat: CI init config - Docker attempt8
bugITwhisperer Nov 28, 2023
e21d0df
feat: CI init config - Docker attempt9 - decrease sleep time
bugITwhisperer Nov 28, 2023
9a0eb29
feat: CI init config - Docker attempt9 - remove sleep step
bugITwhisperer Nov 28, 2023
f73bf0e
feat: CI init config - Docker attempt10 - typo
bugITwhisperer Nov 28, 2023
958f011
feat: CI init config - Docker attempt11 - remove redundant docker exect
bugITwhisperer Nov 28, 2023
f75fe0c
feat: CI init config - Docker attempt12 - create and delete .env file
bugITwhisperer Nov 28, 2023
885db48
feat: CI init config - Docker attempt13 - create and delete .env file
bugITwhisperer Nov 28, 2023
f58a96b
feat: CI init config - Docker attempt14 - create and delete .env file
bugITwhisperer Nov 28, 2023
e6704db
feat: CI init config - remove running on pr creation
bugITwhisperer Nov 28, 2023
1130ba9
tests: articles-id-get.spec.ts - add temporary fixme
bugITwhisperer Nov 28, 2023
7ad551c
tests: articles-id-patch.spec.ts - add temporary fixme
bugITwhisperer Nov 28, 2023
2351859
tests: articles-post.spec.ts - add temporary fixme
bugITwhisperer Nov 28, 2023
4c1adcb
feat: CI init config - create .env file
bugITwhisperer Nov 28, 2023
4cef44e
Merge branch 'main' into feat/ISSUE-19_CI_init_config
bugITwhisperer Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/pw-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run Playwright API Auto-Checks on CI

on:
push:
branches: [ "main" ]

jobs:
playwright-api-auto-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Run GAD in Docker Image
run: docker run -p 3000:3000 -d jaktestowac/gad
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Chromium Browser
run: npx playwright install --with-deps chromium
- name: Create .env file
run: |
echo "BASE_URL='http://localhost:3000'\nUSER_EMAIL='[email protected]'\nUSER_PASSWORD='test1'" > .env
- name: Run API checks
run: npx playwright test
- name: Archive tests results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-report
path: |
./playwright-report/**/*.*
./test-results/**/*.*
- name: Delete .env
run: |
rm -f .env
2 changes: 1 addition & 1 deletion tests/api/articles-id-get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { test, expect, APIResponse } from "@playwright/test";
test.describe.skip("GET/articles/{id} Get by ID", () => {
const baseURL: string = process.env.BASE_URL;

test("returns OK status code and correct article data", async ({ request }) => {
test.fixme("returns OK status code and correct article data", async ({ request }) => {
const statusCode = 200;
const articleID = 3;
const articleUserID = 3;
Expand Down