Compare commits
1 Commits
electron-b
...
electron-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a92d088432 |
@@ -617,8 +617,7 @@ The Electron build process follows a multi-stage approach:
|
|||||||
#### **Stage 2: Capacitor Sync**
|
#### **Stage 2: Capacitor Sync**
|
||||||
|
|
||||||
- Copies web assets to Electron app directory
|
- Copies web assets to Electron app directory
|
||||||
- Uses Electron-specific Capacitor configuration (not copied from main config)
|
- Syncs Capacitor configuration and plugins
|
||||||
- Syncs Capacitor plugins for Electron platform
|
|
||||||
- Prepares native module bindings
|
- Prepares native module bindings
|
||||||
|
|
||||||
#### **Stage 3: TypeScript Compile**
|
#### **Stage 3: TypeScript Compile**
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
import { CapacitorConfig } from '@capacitor/cli';
|
|
||||||
|
|
||||||
const config: CapacitorConfig = {
|
|
||||||
appId: 'app.timesafari',
|
|
||||||
appName: 'TimeSafari',
|
|
||||||
webDir: 'dist',
|
|
||||||
server: {
|
|
||||||
cleartext: true
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
App: {
|
|
||||||
appUrlOpen: {
|
|
||||||
handlers: [
|
|
||||||
{
|
|
||||||
url: 'timesafari://*',
|
|
||||||
autoVerify: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
SplashScreen: {
|
|
||||||
launchShowDuration: 3000,
|
|
||||||
launchAutoHide: true,
|
|
||||||
backgroundColor: '#ffffff',
|
|
||||||
androidSplashResourceName: 'splash',
|
|
||||||
androidScaleType: 'CENTER_CROP',
|
|
||||||
showSpinner: false,
|
|
||||||
androidSpinnerStyle: 'large',
|
|
||||||
iosSpinnerStyle: 'small',
|
|
||||||
spinnerColor: '#999999',
|
|
||||||
splashFullScreen: true,
|
|
||||||
splashImmersive: true
|
|
||||||
},
|
|
||||||
CapSQLite: {
|
|
||||||
iosDatabaseLocation: 'Library/CapacitorDatabase',
|
|
||||||
iosIsEncryption: false,
|
|
||||||
iosBiometric: {
|
|
||||||
biometricAuth: false,
|
|
||||||
biometricTitle: 'Biometric login for TimeSafari'
|
|
||||||
},
|
|
||||||
androidIsEncryption: false,
|
|
||||||
androidBiometric: {
|
|
||||||
biometricAuth: false,
|
|
||||||
biometricTitle: 'Biometric login for TimeSafari'
|
|
||||||
},
|
|
||||||
electronIsEncryption: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ios: {
|
|
||||||
contentInset: 'never',
|
|
||||||
allowsLinkPreview: true,
|
|
||||||
scrollEnabled: true,
|
|
||||||
limitsNavigationsToAppBoundDomains: true,
|
|
||||||
backgroundColor: '#ffffff',
|
|
||||||
allowNavigation: [
|
|
||||||
'*.timesafari.app',
|
|
||||||
'*.jsdelivr.net',
|
|
||||||
'api.endorser.ch'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
android: {
|
|
||||||
allowMixedContent: true,
|
|
||||||
captureInput: true,
|
|
||||||
webContentsDebuggingEnabled: false,
|
|
||||||
allowNavigation: [
|
|
||||||
'*.timesafari.app',
|
|
||||||
'*.jsdelivr.net',
|
|
||||||
'api.endorser.ch',
|
|
||||||
'10.0.2.2:3000'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
electron: {
|
|
||||||
deepLinking: {
|
|
||||||
schemes: ['timesafari']
|
|
||||||
},
|
|
||||||
buildOptions: {
|
|
||||||
appId: 'app.timesafari',
|
|
||||||
productName: 'TimeSafari',
|
|
||||||
directories: {
|
|
||||||
output: 'dist-electron-packages'
|
|
||||||
},
|
|
||||||
files: [
|
|
||||||
'dist/**/*',
|
|
||||||
'electron/**/*'
|
|
||||||
],
|
|
||||||
mac: {
|
|
||||||
category: 'public.app-category.productivity',
|
|
||||||
target: [
|
|
||||||
{
|
|
||||||
target: 'dmg',
|
|
||||||
arch: ['x64', 'arm64']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
win: {
|
|
||||||
target: [
|
|
||||||
{
|
|
||||||
target: 'nsis',
|
|
||||||
arch: ['x64']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
linux: {
|
|
||||||
target: [
|
|
||||||
{
|
|
||||||
target: 'AppImage',
|
|
||||||
arch: ['x64']
|
|
||||||
}
|
|
||||||
],
|
|
||||||
category: 'Utility'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
1
electron/package-lock.json
generated
1
electron/package-lock.json
generated
@@ -56,6 +56,7 @@
|
|||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor-community/sqlite/-/sqlite-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor-community/sqlite/-/sqlite-6.0.2.tgz",
|
||||||
"integrity": "sha512-sj+2SPLu7E/3dM3xxcWwfNomG+aQHuN96/EFGrOtp4Dv30/2y5oIPyi6hZGjQGjPc5GDNoTQwW7vxWNzybjuMg==",
|
"integrity": "sha512-sj+2SPLu7E/3dM3xxcWwfNomG+aQHuN96/EFGrOtp4Dv30/2y5oIPyi6hZGjQGjPc5GDNoTQwW7vxWNzybjuMg==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jeep-sqlite": "^2.7.2"
|
"jeep-sqlite": "^2.7.2"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compileOnSave": true,
|
"compileOnSave": true,
|
||||||
"include": ["./src/**/*"],
|
"include": ["./src/**/*", "./capacitor.config.ts", "./capacitor.config.js"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ sync_capacitor() {
|
|||||||
copy_web_assets() {
|
copy_web_assets() {
|
||||||
log_info "Copying web assets to Electron"
|
log_info "Copying web assets to Electron"
|
||||||
safe_execute "Copying assets" "cp -r dist/* electron/app/"
|
safe_execute "Copying assets" "cp -r dist/* electron/app/"
|
||||||
# Note: Electron has its own capacitor.config.ts file, so we don't copy the main config
|
safe_execute "Copying config" "cp capacitor.config.json electron/capacitor.config.json"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compile TypeScript
|
# Compile TypeScript
|
||||||
|
|||||||
@@ -23,11 +23,36 @@ test('New offers for another user', async ({ page }) => {
|
|||||||
await page.getByPlaceholder('URL or DID, Name, Public Key').fill(autoCreatedDid + ', A Friend');
|
await page.getByPlaceholder('URL or DID, Name, Public Key').fill(autoCreatedDid + ', A Friend');
|
||||||
await expect(page.locator('button > svg.fa-plus')).toBeVisible();
|
await expect(page.locator('button > svg.fa-plus')).toBeVisible();
|
||||||
await page.locator('button > svg.fa-plus').click();
|
await page.locator('button > svg.fa-plus').click();
|
||||||
await page.locator('div[role="alert"] button:has-text("No")').click(); // don't register
|
await page.locator('div[role="alert"]:has-text("Register") button:has-text("No")').click(); // don't register
|
||||||
await expect(page.locator('div[role="alert"] h4:has-text("Success")')).toBeVisible();
|
await expect(page.locator('div[role="alert"] h4:has-text("Success")')).toBeVisible();
|
||||||
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
||||||
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
||||||
|
|
||||||
|
// Wait for any dialogs to appear and dismiss them systematically
|
||||||
|
await page.waitForTimeout(1000); // Give time for any dialogs to appear
|
||||||
|
|
||||||
|
// Check for and dismiss export dialog
|
||||||
|
const exportDialog = page.locator('div[role="alert"]:has-text("Export Your Data")');
|
||||||
|
if (await exportDialog.isVisible()) {
|
||||||
|
await page.locator('div[role="alert"]:has-text("Export Your Data") button:has-text("No, Not Now")').click();
|
||||||
|
await expect(exportDialog).toBeHidden();
|
||||||
|
await page.waitForTimeout(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for any other modal overlays that might be blocking
|
||||||
|
const modalOverlay = page.locator('div[class*="bg-slate-900"]');
|
||||||
|
if (await modalOverlay.isVisible()) {
|
||||||
|
// Try to find and click any close buttons in the overlay
|
||||||
|
const closeButtons = page.locator('div[class*="bg-slate-900"] button');
|
||||||
|
if (await closeButtons.count() > 0) {
|
||||||
|
await closeButtons.first().click();
|
||||||
|
await page.waitForTimeout(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure no dialogs are blocking before proceeding
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
// show buttons to make offers directly to people
|
// show buttons to make offers directly to people
|
||||||
await page.getByRole('button').filter({ hasText: /See Actions/i }).click();
|
await page.getByRole('button').filter({ hasText: /See Actions/i }).click();
|
||||||
|
|
||||||
@@ -39,8 +64,8 @@ test('New offers for another user', async ({ page }) => {
|
|||||||
await page.getByTestId('inputOfferAmount').locator('input').fill('1');
|
await page.getByTestId('inputOfferAmount').locator('input').fill('1');
|
||||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||||
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
||||||
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
await page.locator('div[role="alert"]:has-text("That offer was recorded") button > svg.fa-xmark').click(); // dismiss info alert
|
||||||
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
await expect(page.locator('div[role="alert"]:has-text("That offer was recorded") button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
||||||
|
|
||||||
// make another offer to user 1
|
// make another offer to user 1
|
||||||
const randomString2 = Math.random().toString(36).substring(2, 5);
|
const randomString2 = Math.random().toString(36).substring(2, 5);
|
||||||
@@ -49,8 +74,8 @@ test('New offers for another user', async ({ page }) => {
|
|||||||
await page.getByTestId('inputOfferAmount').locator('input').fill('3');
|
await page.getByTestId('inputOfferAmount').locator('input').fill('3');
|
||||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||||
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
||||||
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
|
await page.locator('div[role="alert"]:has-text("That offer was recorded") button > svg.fa-xmark').click(); // dismiss info alert
|
||||||
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
await expect(page.locator('div[role="alert"]:has-text("That offer was recorded") button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
||||||
|
|
||||||
// Switch back to the auto-created DID (the "another user") to see the offers
|
// Switch back to the auto-created DID (the "another user") to see the offers
|
||||||
await switchToUser(page, autoCreatedDid);
|
await switchToUser(page, autoCreatedDid);
|
||||||
|
|||||||
@@ -157,11 +157,11 @@ export async function generateAndRegisterEthrUser(page: Page): Promise<string> {
|
|||||||
.getByPlaceholder("URL or DID, Name, Public Key")
|
.getByPlaceholder("URL or DID, Name, Public Key")
|
||||||
.fill(`${newDid}, ${contactName}`);
|
.fill(`${newDid}, ${contactName}`);
|
||||||
await page.locator("button > svg.fa-plus").click();
|
await page.locator("button > svg.fa-plus").click();
|
||||||
// register them
|
// register them - be more specific to avoid multiple button matches
|
||||||
await page.locator('div[role="alert"] button:has-text("Yes")').click();
|
await page.locator('div[role="alert"]:has-text("Register") button:has-text("Yes")').click();
|
||||||
// wait for it to disappear because the next steps may depend on alerts being gone
|
// wait for it to disappear because the next steps may depend on alerts being gone
|
||||||
await expect(
|
await expect(
|
||||||
page.locator('div[role="alert"] button:has-text("Yes")')
|
page.locator('div[role="alert"]:has-text("Register") button:has-text("Yes")')
|
||||||
).toBeHidden();
|
).toBeHidden();
|
||||||
await expect(page.locator("li", { hasText: contactName })).toBeVisible();
|
await expect(page.locator("li", { hasText: contactName })).toBeVisible();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user