Skip to content

Commit

Permalink
Merge pull request #943 from factly/tests
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
shreeharsha-factly authored Jun 27, 2024
2 parents b7137df + 373ef5f commit b3f0431
Show file tree
Hide file tree
Showing 32 changed files with 17,390 additions and 13,558 deletions.
27 changes: 27 additions & 0 deletions .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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,9 @@ dist/

setupConfig.sh

postgres
postgres
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
volumes
140 changes: 140 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "dega",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"repository": {
"type": "git",
"url": "git+https://github.com/factly/dega.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/factly/dega/issues"
},
"homepage": "https://github.com/factly/dega#readme",
"devDependencies": {
"@playwright/test": "^1.44.1",
"@types/node": "^20.14.2"
}
}
79 changes: 79 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// @ts-check
const { defineConfig, devices } = require('@playwright/test');

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

/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = 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,
// },
});

35 changes: 35 additions & 0 deletions state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"cookies": [
{
"name": "csrf_token_2d785ea2f6536900108362e9bfff73eef3a32be3921b3abc74b0a990093487c9",
"value": "ZuCBOfqeHHkR+fp3CumXSiUZHMeT/8PlRDFiyqiN7Go=",
"domain": "127.0.0.1",
"path": "/",
"expires": 1749818658.186398,
"httpOnly": true,
"secure": false,
"sameSite": "Lax"
},
{
"name": "ory_kratos_session",
"value": "MTcxODI4MjY1OHxKOWpGMERiNkpIaEhtVm1pa09NZkFxdVJkdTFtby1jOTJNcWNhZVBYMjlJRmVzWW1HdHllMlNKd0luc3NLWVJqYnZ1WmJaM0VaSFZ3UGVTX01Mb3dxdHRjaF9qWFpldmVBRFNoOThxaFdlZHBGaUp6NTk4M3pNaGVhWE1vYnlVd1pBdTVxZDJzREE9PXztrznqKo_KUBN2bi893EUAy67CSGX4doSttWyWUrCRyg==",
"domain": "127.0.0.1",
"path": "/",
"expires": 1718369058.186497,
"httpOnly": true,
"secure": false,
"sameSite": "Lax"
}
],
"origins": [
{
"origin": "http://127.0.0.1:4455",
"localStorage": [
{
"name": "returnTo",
"value": "http://127.0.0.1:4455/.factly/dega/studio/"
}
]
}
]
}
2 changes: 1 addition & 1 deletion studio/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pull official base image
FROM node:16-alpine
FROM node:18-alpine

# set working directory
ARG CACHEBUST=100
Expand Down
2 changes: 1 addition & 1 deletion studio/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14.17.1-alpine as build
FROM node:18-alpine as build
WORKDIR /app

# install node modules
Expand Down
9 changes: 9 additions & 0 deletions studio/e2e_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
Loading

0 comments on commit b3f0431

Please sign in to comment.