New revolution for software automation testing
You will need to have Node.js installed.
Clone the repo:
<project-folder>/common
, run npm install
and npm run build
for the first time. Run npm run build
after you make changes to common
code. You might need to close and reopen VSCode to help it update the intellisense cache.<project-folder>/svelte
, run npm install
for the first time<project folder>
, run npm install
for the first timeSource code structure:
electron
- contains all electron and bootup specific codesvelte
- contains the svelte appcommon
- contains the common codedist
- compiled electron and sevelte appdist/www
- compiled svelte app output filesChanging code in common
folder
npm run common:build
There are several settings to switch between production (default) and development mode when the electron app starts.
isInProduction
: true if is in production (default is true)serveSvelteDev
: true when you want run svelte development server and reload when files changewatchSvelteBuild
: true when you want run svelte builds and reload when files changeThe default mode is production.
Use this setup when you need to change both electron and svelte files.
Create a .env
file at root folder with following setting to override the default:
IS_IN_PRODUCTION=false
SERVE_SVELTE_DEV=true
WATCH_SVELTE_BUILD=false
Open terminal window and run npm run dev
.
Open another terminal window and run npm run nodemon
.
Debugging
Ctrl-Shift-I
to open the Chrome developer toolsdebugger
to set break pointsconsole.log()
in the Svelte code to display messages in the Chrome developer tool consoleconsole.log()
in the Electron code to display messages in the terminal windowUse this setup when you are only changing svelte files. Debugging and reloading for changes in electron is disabled.
Create a .env
file at root folder with following setting to override the default:
IS_IN_PRODUCTION=false
SERVE_SVELTE_DEV=true
WATCH_SVELTE_BUILD=false
Open terminal window and run npm run dev
.
Open another terminal window and run npm run start
.
Debugging
Ctrl-Shift-I
to open the Chrome developer toolsdebugger
to set break pointsconsole.log()
in the Svelte code to display messages in the Chrome developer tool consoleconsole.log()
in the Electron code to display messages in the terminal windowUse this setup when you are only changing svelte files but you want to test using production svelte code (i.e. with optimization and minification).
Create a .env
file at root folder with following setting to override the default:
IS_IN_PRODUCTION=false
SERVE_SVELTE_DEV=false
WATCH_SVELTE_BUILD=true
Open terminal window and run npm run svelte:build
.
dist/www
folderOpen another terminal window and run npm run start
.
Debugging
Ctrl-Shift-I
to open the Chrome developer toolsdebugger
to set break pointsconsole.log()
in the Svelte code to display messages in the Chrome developer tool consoleconsole.log()
in the Electron code to display messages in the terminal windowIf you change your svelte source code, you will need to run npm run svelte:build
again.
In this mode, changes in svelte or electron files will NOT cause the app to reload.
Setup the build paramters by delelte the .env
file or change the contents to
IS_IN_PRODUCTION=true
SERVE_SVELTE_DEV=false
WATCH_SVELTE_BUILD=false
Open terminal window and run:
npm run svelte:build
npm run start
See release process here
<project-folder>/codegen
, run npm test
To run tests from C# generated code, we have to install playwright browser by executing pwsh bin/Debug/playwright.ps1 install
. The IDE already covers this step during code generation stage.
However, it only installs Chromium, Firefox and Webkit (Safari). Therefore, to execute test cases with MS Edge & Google Chrome in Linux (which does not include MS Edge browser by default), we need to install MS Edge manually by pwsh bin/Debug/playwright.ps1 install msedge
-- Run npm run dev
in svelte folder
-- Run start:debug-electron
in the root folder. This will run electron --inspect=5858 .
, which launch the IDE with an "inpectable" website on localhost:5858
.
-- Open Chrome
-- Goto chrome://inspect/#devices
: The list "Remote Target" is empty initially
-- Click button Configure
-- The Target discovery settings dialog opens. Add localhost:5858
to list of inspectable sites. Click Done. The list "Remote Target" now contains 1 site for inspection, which is the Electron code
-- Click on the "Open dedicated DevTools for Node" link. A special Chrome DevTools windows appears
-- Navigate to the Sources tab and see the source code of Electron under file://
-- Locate the file you want to debug and start debugging.