Skip to content

Commit

Permalink
feat: built dmg w/ updated logic. setup initial e2e tests:
Browse files Browse the repository at this point in the history
  • Loading branch information
timeowilliams committed Sep 22, 2024
1 parent ef698fa commit 71d1be5
Show file tree
Hide file tree
Showing 23 changed files with 485 additions and 226 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Playwright Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox, webkit]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ out
package-lock.json
node_modules
.env
deepfocus.js
deepfocus.js
test-results
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</p>

[![Release](https://github.com/Tech-Nest-Ventures/deepFocus/actions/workflows/release.yml/badge.svg)](https://github.com/Tech-Nest-Ventures/deepFocus/actions/workflows/release.yml)
[![Integration Tests](https://github.com/Tech-Nest-Ventures/deepFocus/actions/workflows/integration_tests.yml/badge.svg)](https://github.com/Tech-Nest-Ventures/deepFocus/actions/workflows/integration_tests.yml)
[![Version](https://img.shields.io/npm/v/project.svg)](https://www.npmjs.com/package/project)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Expand Down
12 changes: 11 additions & 1 deletion electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite'
import solid from 'vite-plugin-solid'
import dotenv from 'dotenv'

dotenv.config()

export default defineConfig({
main: {
Expand All @@ -18,7 +21,11 @@ export default defineConfig({
},
// Externalize unnecessary dependencies from the worker
external: ['electron', 'path', 'fs', 'dotenv', '@electron-toolkit/utils', 'electron-store']
}
},

},
define: {
'process.env.API_BASE_URL': JSON.stringify(process.env.VITE_SERVER_URL_PROD || 'https://backend-production-5eec.up.railway.app'),
}
},
preload: {
Expand All @@ -39,6 +46,9 @@ export default defineConfig({
plugins: [solid()],
build: {
outDir: 'out/renderer'
},
define: {
'process.env.API_BASE_URL': JSON.stringify(process.env.VITE_SERVER_URL_PROD || 'https://backend-production-5eec.up.railway.app'),
}
}
})
75 changes: 75 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
"test": "npm run test:e2e",
"start": "electron-vite preview",
"dev": "electron-vite dev -- --inspect ",
"build": "NODE_ENV=production npm run typecheck && electron-vite build",
Expand Down Expand Up @@ -44,13 +45,15 @@
"@electron-toolkit/eslint-config-prettier": "^2.0.0",
"@electron-toolkit/eslint-config-ts": "^2.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
"@playwright/test": "^1.47.2",
"@solidjs/router": "^0.14.5",
"@solidjs/start": "^1.0.6",
"@types/electron-store": "^3.2.0",
"@types/node": "^20.16.5",
"autoprefixer": "^10.4.20",
"electron": "^32.1.2",
"electron-builder": "^24.13.3",
"electron-playwright-helpers": "^1.7.1",
"electron-vite": "^2.3.0",
"eslint": "^8.57.0",
"eslint-plugin-solid": "^0.14.1",
Expand Down
68 changes: 68 additions & 0 deletions playwright-report/index.html

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions playwright.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @ts-check
import { defineConfig } from "@playwright/test";
import path from "path";

export default defineConfig({
testDir: "./tests/e2e",
use: {
headless: false,
viewport: null,
use: {
video: "on",
},
},
timeout: 120000,
expect: {
timeout: 60000,
},
workers: 3,
fullyParallel: true,
retries: 0,
reporter: "html",
});
5 changes: 4 additions & 1 deletion src/main/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import dotenv from 'dotenv'
dotenv.config()

const isProduction = process.env.ENV === 'production'

export const API_BASE_URL = isProduction ? process.env.SERVER_URL_PROD : process.env.SERVER_URL_DEV
export const API_BASE_URL = isProduction ? process.env.VITE_SERVER_URL_PROD : process.env.VITE_SERVER_URL_DEV
2 changes: 1 addition & 1 deletion src/main/emailService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios'
import * as schedule from 'node-schedule'
import { TypedStore } from './types'
import { TypedStore } from './index'
import { app } from 'electron'
import path from 'path'
import fs from 'fs'
Expand Down
Loading

0 comments on commit 71d1be5

Please sign in to comment.