mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-26 02:40:24 -06:00
Electron-308 - Fixed and updated the Spectron test cases
This commit is contained in:
parent
f23ed615a7
commit
de4b00c21f
@ -136,7 +136,7 @@ describe('Tests for Always on top', () => {
|
||||
robot.setMouseDelay(200);
|
||||
robot.moveMouse(190, 0);
|
||||
robot.mouseClick();
|
||||
for (let i = 0; i < 8; i++) {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
robot.keyTap('down');
|
||||
}
|
||||
robot.keyTap('enter');
|
||||
|
@ -108,7 +108,7 @@ describe('Tests for Full screen', () => {
|
||||
robot.moveMouseSmooth(205, 10);
|
||||
robot.mouseClick();
|
||||
robot.setKeyboardDelay(100);
|
||||
for (let i = 0; i < 6; i++) {
|
||||
for (let i = 0; i < 8; i++) {
|
||||
robot.keyTap('down');
|
||||
}
|
||||
robot.keyTap('enter');
|
||||
|
@ -16,6 +16,7 @@ class App {
|
||||
}
|
||||
|
||||
App.copyConfigPath();
|
||||
App.copyLibraryDir();
|
||||
|
||||
this.app = new Application(this.options);
|
||||
}
|
||||
@ -40,27 +41,52 @@ class App {
|
||||
}
|
||||
|
||||
static readConfig(configPath) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
fs.readFile(configPath, function (err, data) {
|
||||
|
||||
if (!fs.existsSync(configPath)) {
|
||||
return this.copyConfigPath();
|
||||
} else {
|
||||
return new Promise(function (resolve) {
|
||||
fs.readFile(configPath, 'utf-8', function (err, data) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
throw new Error("Unable to read user config file " + err);
|
||||
}
|
||||
resolve(JSON.parse(data));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static copyConfigPath() {
|
||||
return new Promise((resolve) => {
|
||||
if (isMac) {
|
||||
ncp('config', 'node_modules/electron/dist/Electron.app/Contents/config', function (err) {
|
||||
if (err) {
|
||||
throw(err);
|
||||
throw new Error("Unable to copy config file to Electron dir " + err);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
ncp('config', 'node_modules/electron/dist/config', function (err) {
|
||||
if (err) {
|
||||
throw(err);
|
||||
throw new Error("Unable to copy config file to Electron dir " + err);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static copyLibraryDir() {
|
||||
if (isMac) {
|
||||
ncp('library', 'node_modules/electron/dist/Electron.app/Contents/library', function (err) {
|
||||
if (err) {
|
||||
throw new Error("Unable to copy Swift search library dir " + err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ncp('library', 'node_modules/electron/dist/library', function (err) {
|
||||
if (err) {
|
||||
throw new Error("Unable to copy Swift search library dir " + err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ describe('Tests for spellChecker', () => {
|
||||
it('should invoke context menu ', (done) => {
|
||||
if (isMac) {
|
||||
app.browserWindow.getBounds().then((bounds) => {
|
||||
let x = bounds.x + 45;
|
||||
let y = bounds.y + 398;
|
||||
let x = bounds.x + 55;
|
||||
let y = bounds.y + 430;
|
||||
|
||||
robot.moveMouseSmooth(x, y);
|
||||
robot.setMouseDelay(200);
|
||||
@ -114,7 +114,7 @@ describe('Tests for spellChecker', () => {
|
||||
return app.client
|
||||
.windowByIndex(0)
|
||||
.getValue('#tag').then((value) => {
|
||||
expect(value).toBe('coming ');
|
||||
expect(value !== 'comming').toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user