Skip to content

Commit

Permalink
Merge pull request #1009 from AppQuality/develop
Browse files Browse the repository at this point in the history
new release
  • Loading branch information
d-beezee authored Oct 7, 2024
2 parents 8891921 + 082ca53 commit 7836b80
Show file tree
Hide file tree
Showing 125 changed files with 8,620 additions and 3,819 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
REACT_APP_GTM_ID=GTM-WVXPS94
REACT_APP_GTM_AUTH=HjeAxSQB9e685mi-_8YiDw
REACT_APP_GTM_ENV=env-4
REACT_APP_API_URL=/api
REACT_APP_API_URL=https://dev.unguess.io/api
REACT_APP_TRYBER_URL=https://dev.tryber.me
REACT_ZAPIER_WEBHOOK=https://hooks.zapier.com/hooks/catch/5196925/bkxm1k6/
REACT_APP_STRAPI_URL=https://admin.unguess.io
Expand Down
9 changes: 9 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
REACT_APP_GTM_ID=

REACT_APP_API_URL=https://dev.unguess.io/api

REACT_APP_DEFAULT_TOKEN=

REACT_APP_CROWD_WP_URL=https://dev.tryber.me

REACT_APP_DATADOG_CLIENT_TOKEN=
61 changes: 61 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Run E2E Tests
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
push:
branches: [main, master, develop]

jobs:
basicTests:
if: ${{ (github.event.pull_request.draft == false) || (github.event_name == 'push' ) || github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
# run 2 copies of the job in parallel
shard: [1, 2]

name: "Playwright Tests - pwc"
timeout-minutes: 20
runs-on: ubuntu-22.04
container: mcr.microsoft.com/playwright:v1.39.0-jammy

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

# https://github.com/actions/runner-images/issues/6775
- run: |
echo "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Extract hash commit
shell: bash
run: |
COMMIT=$(git rev-parse --short HEAD)
echo "##[set-output name=commit;]$COMMIT"
id: extract_commit

- uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Install dependencies
run: |
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc
npm install -g yarn && yarn install --frozen-lockfile
npx playwright install chrome
- name: Run Tests
continue-on-error: false
env:
CURRENTS_PROJECT_ID: ${{ secrets.CURRENTS_PROJECT_ID }}
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}

run: |
npx pwc --ci-build-id ${{ steps.extract_commit.outputs.commit }} --shard=${{ matrix.shard }}/${{ strategy.job-total }}
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16.x
- run: yarn --frozen-lockfile
- run: yarn --frozen-lockfile --ignore-engines
- run: yarn validate

build:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ generate-devel-token-*.json
.vscode
# Sentry Config File
.sentryclirc
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG SENTRY_AUTH_TOKEN

COPY package.json ./
COPY yarn.lock ./
RUN ["yarn", "install", "--frozen-lockfile", "--ignore-scripts"]
RUN ["yarn", "install", "--frozen-lockfile", "--ignore-scripts", "--ignore-engines"]
RUN rm -f .npmrc

COPY . .
Expand Down
7 changes: 4 additions & 3 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const resolvedAliases = Object.fromEntries(

module.exports = {
webpack: {
alias: resolvedAliases,
// alias: resolvedAliases,
configure: (webpackConfig) => {
webpackConfig.module.rules.push({
test: /\.mjs$/,
Expand All @@ -31,8 +31,9 @@ module.exports = {
babel: {
presets: ['@babel/preset-env'],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-transform-optional-chaining',
'@babel/plugin-transform-nullish-coalescing-operator',
'@babel/plugin-transform-logical-assignment-operators',
],
},
};
48 changes: 31 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "1.4.0",
"private": true,
"dependencies": {
"@appquality/unguess-design-system": "3.1.107",
"@appquality/unguess-design-system": "3.1.114",
"@headwayapp/react-widget": "^0.0.4",
"@reduxjs/toolkit": "^1.8.0",
"@rtk-query/codegen-openapi": "1.2.0",
"@sentry/react": "^7.85.0",
"@sentry/react": "^8.32.0",
"@zendeskgarden/react-datepickers": "8.49.0",
"@zendeskgarden/react-dropdowns": "8.49.0",
"@zendeskgarden/react-forms": "8.49.0",
Expand All @@ -17,19 +17,19 @@
"date-fns": "^2.28.0",
"formik": "^2.2.9",
"i18n-iso-countries": "^7.3.0",
"i18next": "^21.6.14",
"i18next-browser-languagedetector": "^6.1.3",
"i18next": "^23.15.1",
"i18next-browser-languagedetector": "^8.0.0",
"qs": "^6.10.3",
"query-string": "^7.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
"react-i18next": "^11.15.7",
"react-i18next": "^15.0.2",
"react-redux": "^7.2.6",
"react-router-dom": "^6.4.0",
"react-scripts": "4.0.3",
"react-scroll": "^1.8.7",
"react-scroll": "^1.9.0",
"styled-components": "^6.1.1",
"typescript": "^4.6.2",
"uuid": "^10.0.0",
Expand All @@ -41,11 +41,14 @@
"start:ssl": "craco --openssl-legacy-provider start",
"build": "craco build",
"test": "react-scripts test",
"test:e2e:ui": "npx playwright test --headed",
"test:watch": "react-scripts test --watch",
"test:e2e": "npx playwright test",
"recover": "yarn install --check-files",
"eject": "react-scripts eject",
"translate": "i18next 'src/**/*.{js,jsx,ts,tsx}' ",
"generate-schema": ". ./.env.local; npx openapi-typescript $REACT_APP_API_URL/reference/ --output src/common/schema.ts ",
"generate-api": ". ./.env.local; API_URL=$REACT_APP_API_URL/reference/ npx @rtk-query/codegen-openapi src/features/api/config.ts",
"generate-fixtures": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/; npx @appquality/fixture-generator -u $API_URL && npx prettier --write 'tests/api/**/*.json'",
"generate-schema": ". ./.env.local; npx openapi-typescript $REACT_APP_API_URL/reference/ --output src/common/schema.ts ",
"generate-strapi": "npx @rtk-query/codegen-openapi src/features/backoffice/config.ts",
"type:check": "tsc",
"prettier": "prettier 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
Expand All @@ -69,18 +72,25 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/core": "7.16.0",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-logical-assignment-operators": "^7.24.7",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7",
"@babel/plugin-transform-optional-chaining": "^7.24.8",
"@babel/preset-env": "7.16.0",
"@craco/craco": "6.4.2",
"@currents/playwright": "^1.5.6",
"@playwright/test": "^1.46.0",
"@sentry/cli": "^2.23.0",
"@sentry/types": "^8.32.0",
"@testing-library/jest-dom": "^5.16.2",
"@types/node": "^22.7.4",
"@types/qs": "^6.9.7",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/react": "^18.3.9",
"@types/react-dom": "^18.3.0",
"@types/react-gtm-module": "^2.0.1",
"@types/react-helmet": "^6.1.5",
"@types/react-scroll": "^1.8.3",
"@types/react-scroll": "^1.8.10",
"@types/react-transition-group": "^4.4.5",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.26.0",
Expand All @@ -101,6 +111,7 @@
"lint-staged": ">=10",
"npm-run-all": "^4.1.5",
"openapi-typescript": "^5.1.0",
"playwright-i18next-fixture": "^1.0.0",
"prettier": "^2.6.2",
"ts-node": "^10.9.1"
},
Expand All @@ -112,9 +123,12 @@
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773",
"react-error-overlay": "6.0.9",
"styled-components": "^6.1.1"
"styled-components": "^6.1.1",
"@types/react": "18.3.9",
"@babel/core": "7.16.0"
},
"lint-staged": {
"*.{tsx,ts,js,css,md}": "prettier --write"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
85 changes: 85 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* 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: process.env.CI ? 'github' : 'list',
/* 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: process.env.CI ? 'on' : 'on-first-retry',
video: process.env.CI ? 'on' : 'off',
screenshot: process.env.CI ? 'on' : 'off',
testIdAttribute: 'data-qa',
baseURL: 'http://localhost:3000',
},

/* 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: process.env.CI
? 'export NODE_ENV=test && yarn start:ssl'
: 'export NODE_ENV=test && yarn start:ssl',
url: 'http://127.0.0.1:3000',
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
},
});
Loading

0 comments on commit 7836b80

Please sign in to comment.