My electron app works as expected but it keeps on opening new windows when I run spectron test that tests for number of windows opened.
Electron version – v8.0.2 , “spectron”: “^10.0.1” . I am not sure how to check exact version of spectron.
I am just running a small demo, below I will give code snippet
Note: I am running the spectron test pointing to .exe file generated by electron-packager.
Does Anyone have an idea what is the issue if possible how to solve it?
main.js
const { app, BrowserWindow } = require('electron')
function createWindow () {
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
index.js
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
test.js
const assert = require('assert');
const path = require('path');
const Application = require('spectron').Application;
const electronPath = require('electron');
const app = new Application({
path: 'C:/demoElectronApp/winx64/demoelectronapp-win32-x64/demoelectronapp.exe',
});
describe('client_settings_app', function () {
this.timeout(10000);
beforeEach(() => {
return app.start();
});
it('shows only one initial window', async () => {
const count = await app.client.getWindowCount();
return assert.equal(count, 1);
});
})
package.json
{
"name": "demoelectronapp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"electronpackage": "electron-packager . --out winx64"
},
"author": "",
"license": "ISC",
"dependencies": {
"path": "^0.12.7"
},
"devDependencies": {
"electron": "^8.2.2",
"electron-packager": "^14.2.1",
"assert": "^2.0.0",
"mocha": "^7.1.1",
"spectron": "^10.0.1"
}
}
prednisone 5092 – cost of prednisone 40 mg prednisone 40 mg rx
provigil vs nuvigil – modafinil 100 mg modafinil for sale
can you buy accutane online uk – buy accutane 10 mg accutane canada
amoxicillin for sale for humans 500 mg – buy amoxicillin 500 mg online buy amoxicillin 500 mg online mexico
levitra for sale – levitraplg.com cheap vardenafil
stromectol tab 3mg – ivermectin tablets for humans buy stromectol usa
order cialis 20mg – tadalafil tablets 20 mg buy cialis generic online
stromectol online pharmacy – ivermectin buy australia
buy accutane from canada – accutane 30 mg accutane price without insurance
800 mg lyrica – lyrica pills price generic viagra online canadian pharmacy
amoxicillin – amoxicillin without a doctor’s prescription buy amoxicilin noscript canada
best viagra tablets in india – sildenafil 100mg tab where can i buy viagra canada
buy cialis over the counter – cialis from canada compare prices cialis 20mg
medication prednisone – buy prednisone 10mg 50 mg prednisone from canada
a modafinil prescription – modafinil and weight loss modafinil buy
buy azithromycin 500mg – buy azithromycin zithromax zithromax order online uk
lasix 500 mg tab – furosemide australia lasix 500 mg tablet price
buy cheap viagra online us – buying viagra over the counter in usa generic viagra price canada
ventolin uk price – albuterol sulfate inhaler ventolin pills
buy cytotec uk – cytotec over the counter south africa cytotec price online
rx cialis online – tadalafil can you buy cialis in canada
cipla generic vardenafil – buy vardenafil online cheap buy vardenafil australia
accutane online prescription cost – buy accutane online singapore order accutane online canada
amoxicilin usa – where to buy amoxicillin 500 mg amoxil for uti
medicine methylprednisolone – lyrica 300 medication lyrica 75 mg
furosemide 40mg – buy generic furosemide furosemide 40 mg daily
ventolin uk price – ventolin inhaler ventolin price usa
how to get cytotec in usa – buy cytotec pills online cheap buy cytotec no prescription
generic name for ivermectin – stromectol 2mg stromectol for sale
sildenafil from india – sildenafil for women cheap sildenafil online canadian pharmacy
buy generic tadalafil online – tadalafil 20 mg tadalafil liquid
pay for essay – good academic writing thesis writer
female viagra pill canada – generic viagra sildenafil citrate cialis mexico pharmacy
cheap vardenafil – vardenafil cost best ed treatment
orlistat medication coupon – generic xenical alli orlistat dosis
cost of ivermectin 1% cream – ivermectin for humans stromectol online canada
cialis pills online canada – usa cialis generic cialis soft tabs online
ivermectin 3mg pill – cost of stromectol medicine stromectol tablets for humans for sale
money can t buy everything essay – how to write an essay about my life order research papers
online prescription – canada online pharmacy canadian pharmacy king reviews
prednisone canadian pharmacy – buy prednisone without prescription prednisone 50 mg coupon
prednisone without prescription medication – prednisone 20mg for sale generic prednisone tablets
accutane 40 – accutane 20mg accutane cost in india
plaquenil drug – order generic hydroxychloroquine order valacyclovir sale
purchase sildalis generic – purchase finasteride online buy glucophage pill
order ampicillin 250mg without prescription – order cipro online hydroxychloroquine 400mg cheap
hydroxychloroquine price – hydroxychloroquine price hydroxychloroquine pill
viagra 50mg price – viagra pills 25mg oral cialis 40mg
where to buy stromectol – tadalafil 10mg fГјr frauen buy ivermectin 6 mg