Skip to content

Commit

Permalink
Init playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhenningersrb committed May 8, 2024
1 parent f0164c8 commit b485d04
Show file tree
Hide file tree
Showing 8 changed files with 723 additions and 8 deletions.
27 changes: 27 additions & 0 deletions UI5_Quality_Checks_App/.github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
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 ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
6 changes: 5 additions & 1 deletion UI5_Quality_Checks_App/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ mergedManifestDescriptor.json
APIExternalProducer.js
.*/APIExternalProducer.js
/mta_archives/
/node_modules
/node_modules
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[
{
"name": "Strawberry",
"id": 3
},
{
"name": "Banana",
"id": 1
},
{
"name": "Tomato",
"id": 5
},
{
"name": "Pear",
"id": 4
},
{
"name": "Blackberry",
"id": 64
},
{
"name": "Kiwi",
"id": 66
},
{
"name": "Pineapple",
"id": 10
},
{
"name": "Passionfruit",
"id": 70
},
{
"name": "Orange",
"id": 2
},
{
"name": "Raspberry",
"id": 23
},
{
"name": "Watermelon",
"id": 25
},
{
"name": "Lemon",
"id": 26
},
{
"name": "Mango",
"id": 27
},
{
"name": "Blueberry",
"id": 33
},
{
"name": "Apple",
"id": 6
},
{
"name": "Melon",
"id": 41
},
{
"name": "Lime",
"id": 44
}
]
83 changes: 83 additions & 0 deletions UI5_Quality_Checks_App/hars/fruit.har
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"log": {
"version": "1.2",
"creator": {
"name": "Playwright",
"version": "1.44.0"
},
"browser": {
"name": "webkit",
"version": "17.4"
},
"entries": [
{
"startedDateTime": "2024-05-08T11:37:59.908Z",
"time": 1.303,
"request": {
"method": "GET",
"url": "https://demo.playwright.dev/api-mocking/api/v1/fruits",
"httpVersion": "HTTP/2.0",
"cookies": [],
"headers": [
{ "name": "Referer", "value": "https://demo.playwright.dev/api-mocking/" },
{ "name": "Accept", "value": "*/*" },
{ "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15" },
{ "name": "Cache-Control", "value": "max-age=0" },
{ "name": "Accept-Language", "value": "en-US" },
{ "name": "Accept-Encoding", "value": "gzip, deflate, br" },
{ "name": "Sec-Fetch-Dest", "value": "empty" },
{ "name": "Sec-Fetch-Mode", "value": "cors" },
{ "name": "Sec-Fetch-Site", "value": "same-origin" },
{ "name": "Host", "value": "demo.playwright.dev" }
],
"queryString": [],
"headersSize": -1,
"bodySize": -1
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/2.0",
"cookies": [],
"headers": [
{ "name": "Content-Type", "value": "application/octet-stream" },
{ "name": "Last-Modified", "value": "Tue" },
{ "name": "Last-Modified", "value": "24 Oct 2023 19:11:34 GMT" },
{ "name": "Access-Control-Allow-Origin", "value": "*" },
{ "name": "ETag", "value": "\"653816e6-2fa\"" },
{ "name": "Expires", "value": "Wed" },
{ "name": "Expires", "value": "08 May 2024 11:46:34 GMT" },
{ "name": "Cache-Control", "value": "max-age=600" },
{ "name": "Accept-Ranges", "value": "bytes" },
{ "name": "Date", "value": "Wed" },
{ "name": "Date", "value": "08 May 2024 11:37:59 GMT" },
{ "name": "Via", "value": "1.1 varnish" },
{ "name": "Age", "value": "26" },
{ "name": "Vary", "value": "Accept-Encoding" },
{ "name": "Content-Length", "value": "762" },
{ "name": "Server", "value": "GitHub.com" },
{ "name": "x-proxy-cache", "value": "MISS" },
{ "name": "x-github-request-id", "value": "0D56:235561:29671F6:2A76616:663B63C1" },
{ "name": "x-served-by", "value": "cache-ams21020-AMS" },
{ "name": "x-cache", "value": "HIT" },
{ "name": "x-cache-hits", "value": "1" },
{ "name": "x-timer", "value": "S1715168280.908031" },
{ "name": "x-timer", "value": "VS0" },
{ "name": "x-timer", "value": "VE2" },
{ "name": "x-fastly-request-id", "value": "07b221540a5cee9735c91771dc9d2609c2350845" }
],
"content": {
"size": -1,
"mimeType": "application/octet-stream",
"_file": "25cc30e4a440111abd545551113b7bf2e2cad209.bin"
},
"headersSize": -1,
"bodySize": -1,
"redirectURL": ""
},
"cache": {},
"timings": { "send": -1, "wait": -1, "receive": 1.303 }
}
]
}
}
16 changes: 9 additions & 7 deletions UI5_Quality_Checks_App/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@
"start": "node server.js"
},
"devDependencies": {
"@playwright/test": "^1.44.0",
"@types/node": "^20.12.10",
"@ui5/cli": "^2.10.0",
"browserify": "*",
"eslint": "^7.22.0",
"nwabap-ui5uploader": "^1.1.0",
"prettier": "2.2.1",
"ui5-middleware-simpleproxy": "^0.2.1",
"browserify": "*"
"ui5-middleware-simpleproxy": "^0.2.1"
},
"ui5": {
"dependencies": [
"ui5-middleware-simpleproxy"
]
},
"dependencies": {
"html2canvas": "^1.4.1",
"srbinfoandsupportjs": "^1.0.8",
"srbjslogger": "^1.5.1",
"uglify-js": "^3.17.4",
"axios": "^0.24.0",
"body-parser": "^1.19.1",
"express": "^4.17.1",
"puppeteer": "^13.1.0"
"html2canvas": "^1.4.1",
"puppeteer": "^13.1.0",
"srbinfoandsupportjs": "^1.0.8",
"srbjslogger": "^1.5.1",
"uglify-js": "^3.17.4"
}
}
77 changes: 77 additions & 0 deletions UI5_Quality_Checks_App/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* 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',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
Loading

0 comments on commit b485d04

Please sign in to comment.