Skip to content

Commit

Permalink
Debugging electron test.
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Jan 29, 2020
1 parent fd13871 commit bb1a04a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/altair-electron/__tests__/index.js
Expand Up @@ -8,12 +8,15 @@ chai.use(chaiAsPromised);

let electronPath = path.join(__dirname, '../node_modules', '.bin', 'electron');
const appPath = path.join(__dirname, '../');

console.log(`Electron app path: ${appPath}`);

if (process.platform === 'win32') {
electronPath += '.cmd';
}
const app = new Application({
path: electronPath,
args: [appPath],
args: [ appPath ],
env: {
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,
Expand All @@ -23,9 +26,14 @@ const app = new Application({
requireName: 'electronRequire',

// Uncomment this line to debug
chromeDriverArgs: [ 'remote-debugging-port=' + Math.floor(Math.random() * (9999 - 9000) + 9000) ]
// chromeDriverArgs: [ 'remote-debugging-port=' + Math.floor(Math.random() * (9999 - 9000) + 9000) ]
});

app.start().then(() => {
console.log('Started successfully.');
}).catch(err => console.error(err))
.finally(() => app.isRunning() && app.stop());

const selectors = {
windowSwitcherSelector: '.window-switcher:not(.window-switcher--new-window)',
visibleWindowSelector: 'app-window:not(.hide)',
Expand Down

0 comments on commit bb1a04a

Please sign in to comment.