mirror of
https://github.com/xodio/xod.git
synced 2026-03-03 07:24:03 +01:00
56 lines
1.3 KiB
JavaScript
Executable File
56 lines
1.3 KiB
JavaScript
Executable File
#!/usr/bin/env node --experimental-repl-await
|
|
|
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
/* eslint-disable no-console */
|
|
|
|
require('babel-register');
|
|
const repl = require('repl');
|
|
const Application = require('spectron').Application;
|
|
const {
|
|
createPageObject,
|
|
} = require('../packages/xod-client-electron/test-func/pageObject');
|
|
|
|
const app = new Application({
|
|
path: './node_modules/.bin/electron',
|
|
args: ['./packages/xod-client-electron'],
|
|
chromeDriverArgs: ['remote-debugging-port=9222'],
|
|
});
|
|
|
|
console.log('Starting XOD IDE...');
|
|
|
|
app
|
|
.start()
|
|
.then(() => {
|
|
console.log('\nIDE started.\n');
|
|
console.log(
|
|
'Use `app`, `client` and `page` objects to control the application'
|
|
);
|
|
console.log('For reference see:');
|
|
console.log('- https://github.com/electron/spectron');
|
|
console.log('- http://webdriver.io/api.html');
|
|
console.log('');
|
|
})
|
|
.then(() => {
|
|
const page = createPageObject(app.client);
|
|
|
|
const r = repl.start('> ');
|
|
|
|
Object.defineProperty(r.context, 'app', {
|
|
configurable: false,
|
|
enumerable: true,
|
|
value: app,
|
|
});
|
|
|
|
Object.defineProperty(r.context, 'client', {
|
|
configurable: false,
|
|
enumerable: true,
|
|
value: app.client,
|
|
});
|
|
|
|
Object.defineProperty(r.context, 'page', {
|
|
configurable: false,
|
|
enumerable: true,
|
|
value: page,
|
|
});
|
|
});
|