Skip to content

Commit

Permalink
Merge pull request #249 from dhanyn10/cicd-webdriverio
Browse files Browse the repository at this point in the history
use webdriverio for testing
  • Loading branch information
dhanyn10 authored Oct 20, 2024
2 parents 0fa1cfe + 626f735 commit c0bf5ea
Show file tree
Hide file tree
Showing 8 changed files with 390 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2.1

jobs:
build:
docker:
- image: cimg/node:20.16-browsers
steps:
- checkout

- run:
name: Install dependencies
working_directory: ./app
command: npm install

- run:
name: Build Electron apps
working_directory: ./app
command: npm run app:dir
- run:
name: Running X virtual framebuffer
command: Xvfb :99 -ac & export DISPLAY=:99
background: true
- run:
name: Run WebdriverIO tests
working_directory: ./app
command: npx wdio run wdio.conf.js

workflows:
version: 2
build_and_test:
jobs:
- build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
token.json
/app/dist
Binary file modified app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="container mx-auto px-4 mt-4">
<div class="grid grid-cols-12 gap-2">
<div class="col-span-4">
<button id="authorize" id="authorize" class="
<button id="authorize" class="
text-gray-900 text-center bg-white border border-gray-300 focus:outline-none
hover:bg-gray-100 font-medium
rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-gray-800
Expand Down
18 changes: 14 additions & 4 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"main": "main.js",
"scripts": {
"start": "electron .",
"css": "npx tailwindcss -i ./css/input.css -o ./css/output.css --minify --watch"
"css": "npx tailwindcss -i ./css/input.css -o ./css/output.css --minify --watch",
"app:dir": "electron-builder --dir",
"app:dist": "electron-builder"
},
"repository": "https://github.com/dhanyn10/mfm-gdrive.git",
"author": {
Expand All @@ -13,14 +15,22 @@
},
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.48.0",
"@wdio/cli": "^9.2.1",
"@wdio/local-runner": "^9.2.1",
"@wdio/mocha-framework": "^9.1.3",
"@wdio/spec-reporter": "^9.1.3",
"electron": "^28.1.0",
"tailwindcss": "^3.4.13"
"electron-builder": "^25.1.8",
"tailwindcss": "^3.4.13",
"wdio-electron-service": "^7.1.0"
},
"dependencies": {
"@google-cloud/local-auth": "^3.0.1",
"bottleneck": "^2.19.5",
"google-auth-library": "^9.14.2",
"googleapis": "^144.0.0",
"sweetalert2": "^11.14.3"
"sweetalert2": "^11.14.3",
"wdio": "^6.0.1"
}
}
}
8 changes: 8 additions & 0 deletions app/test/specs/test.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { browser, $, expect } from '@wdio/globals'

describe('Electron Testing', () => {
it('should print application title', async () => {
var title = await browser.getTitle()
await expect(title).toEqual("MFM Gdrive")
})
})
30 changes: 30 additions & 0 deletions app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"target": "es2022",
"lib": [
"es2022",
"dom"
],
"types": [
"node",
"@wdio/globals/types",
"expect-webdriverio",
"@wdio/mocha-framework"
],
"skipLibCheck": true,
"noEmit": true,
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"test",
"wdio.conf.ts"
]
}
Loading

0 comments on commit c0bf5ea

Please sign in to comment.