rockmelonqa / rockmelonqa-ide

Test Automation IDE that generates and runs Playwright and Selenium code
MIT License
4 stars 3 forks source link

1 Rockmelon QA (IDE)

New revolution for software automation testing

2 Get Started

You will need to have Node.js installed.

3 Development

3.1 Setup

Clone the repo:

Source code structure:

Changing code in common folder

3.2 Run Modes

There are several settings to switch between production (default) and development mode when the electron app starts.

The default mode is production.

3.3 Run in Electron and Svelte Development Mode

Use this setup when you need to change both electron and svelte files.

  1. 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
  2. Open terminal window and run npm run dev.

    • Compiles your Svelte app and serve from the development server.
    • Watches for file changes and re-compiles.
  3. Open another terminal window and run npm run nodemon.

    • Starts the electron app
    • Watches for file changes and re-starts.
  4. Debugging

    • Type in Ctrl-Shift-I to open the Chrome developer tools
    • Use debugger to set break points
    • Use console.log() in the Svelte code to display messages in the Chrome developer tool console
    • Use console.log() in the Electron code to display messages in the terminal window

3.4 Run in Svelte Development Mode

Use this setup when you are only changing svelte files. Debugging and reloading for changes in electron is disabled.

  1. 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
  2. Open terminal window and run npm run dev.

    • Starts the sveltekit dev server
    • Watches for file changes and re-compiles.
  3. Open another terminal window and run npm run start.

    • Starts the electron app
    • Watches for file changes and re-starts.
  4. Debugging

    • Type in Ctrl-Shift-I to open the Chrome developer tools
    • Use debugger to set break points
    • Use console.log() in the Svelte code to display messages in the Chrome developer tool console
    • Use console.log() in the Electron code to display messages in the terminal window

3.5 Run using Svelte Production Builds

Use this setup when you are only changing svelte files but you want to test using production svelte code (i.e. with optimization and minification).

  1. 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
  2. Open terminal window and run npm run svelte:build.

    • Compiles your Svelte app into dist/www folder
    • Watches for file changes and re-compiles.
  3. Open another terminal window and run npm run start.

    • Starts the electron app
    • Watches for file changes and re-starts.
  4. Debugging

    • Type in Ctrl-Shift-I to open the Chrome developer tools
    • Use debugger to set break points
    • Use console.log() in the Svelte code to display messages in the Chrome developer tool console
    • Use console.log() in the Electron code to display messages in the terminal window
  5. If you change your svelte source code, you will need to run npm run svelte:build again.

    • Electron will automatically reload after the build.

3.6 Run in Production Mode

In this mode, changes in svelte or electron files will NOT cause the app to reload.

  1. 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
  2. Open terminal window and run:

    npm run svelte:build
    npm run start

3.7 Publishing

See release process here

4 Running Unit Tests

5 Troubleshooting

5.1 Manually install 'playwright msedge' in Linux

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

6 Debugging Electron code using Chrome

6.1 Reqirements

6.2 Launch IDE

-- 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.

6.3 Launch Chrome inspection

-- 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.

Tips