Skip to content

Commit

Permalink
fix: title test in playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timeowilliams committed Sep 28, 2024
1 parent ebe1614 commit d811cf3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 51 deletions.
2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mac:
dmg:
artifactName: ${name}-${version}.${ext}
win:
executableName: deepfocus
executableName: Deep Focus
nsis:
artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deepfocus",
"version": "1.1.0",
"name": "deepFocus",
"version": "1.2.0",
"description": "DeepFocus is a productivity tool that helps you stay focused and productive by tracking your time spent on your computer.",
"main": "./out/main/main.js",
"author": "Timeo Williams",
Expand Down
2 changes: 1 addition & 1 deletion scripts/deleteUserData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path'
import fs from 'fs'
import os from 'os'

const appName = 'deepfocus' // Replace with your actual app name
const appName = 'Deep Focus' // Replace with your actual app name
const appDataPath = path.join(os.homedir(), 'Library', 'Application Support', appName)
console.log(appDataPath) // /Users/timeo/Library/Application Support/deepfocus

Expand Down
47 changes: 0 additions & 47 deletions tests/e2e/userflow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,5 @@ test.describe('Electron App', () => {
// Ensure the Electron app loads correctly
const title = await window.title()
expect(title).toBe('deepFocus')

await window.waitForSelector('span')
const text = await window.$eval('span', (el) => el.textContent)
expect(text).toBe('deep')
})
})

/*
test('should handle user login', async () => {
// Interact with the login form
await window.title()
await window.click('xpath=/html/body/div/header/nav/a[2]', { delay: 1500 })
await window.click('input[name="email"]')
await window.fill('input[name="email"]', '[email protected]', { force: true })
await window.click('input[name="password"]')
await window.fill('input[name="password"]', 'test', { force: true })
await window.click('button:has-text("Login")')
// Validate login success by checking the URL
const currentURL = window.url()
expect(currentURL).toBe('http://localhost:5173/') // Adjust the expected URL as needed
})
// test('should send data via IPC', async () => {
// // Simulate sending data from the renderer process to the main process
// await window.evaluate(() => {
// const user = {
// username: '[email protected]',
// language: 'English',
// country: 'USA',
// firstName: 'Timeo',
// lastName: 'Williams'
// }
// window.sendUserData(user) // Use the exposed API from the preload script
// })
// // Simulate listening on the main process for the IPC event
// const userData: User = await electronApp.evaluate(({ ipcMain }) => {
// return new Promise((resolve) => {
// ipcMain.on('send-user-data', (_, data) => resolve(data))
// })
// })
// expect(userData.username).toBe('[email protected]')
// })
*/

0 comments on commit d811cf3

Please sign in to comment.