Change ui test resolution
This commit is contained in:
@@ -15,7 +15,7 @@ if (!isDev) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isDebugEnabled = Boolean(process.argv.find(arg => arg === 'debug'))
|
const isDebugEnabled = Boolean(process.argv.find(arg => arg === 'debug'))
|
||||||
const isFullscreen = Boolean(process.argv.find(arg => arg === '--fullscreen'))
|
const runningUiTestOnCi = Boolean(process.argv.find(arg => arg === '--runningUiTestOnCi'))
|
||||||
|
|
||||||
require('electron-debug')({ enabled: isDebugEnabled })
|
require('electron-debug')({ enabled: isDebugEnabled })
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ function createWindow() {
|
|||||||
const iconPath = path.join(__dirname, 'icon.png')
|
const iconPath = path.join(__dirname, 'icon.png')
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 1024,
|
width: runningUiTestOnCi ? 1280 : 1024,
|
||||||
height: 700,
|
height: runningUiTestOnCi ? 720 : 700,
|
||||||
show: false,
|
show: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
@@ -48,7 +48,7 @@ function createWindow() {
|
|||||||
|
|
||||||
mainWindow.once('ready-to-show', () => {
|
mainWindow.once('ready-to-show', () => {
|
||||||
if (mainWindow) {
|
if (mainWindow) {
|
||||||
isFullscreen && mainWindow.setFullScreen(true)
|
runningUiTestOnCi && mainWindow.setFullScreen(true)
|
||||||
mainWindow.show()
|
mainWindow.show()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { showMenu } from './scenarios/showMenu'
|
|||||||
import { createFakeMousePointer, sleep, showText, hideText, clickOnHistory } from './util'
|
import { createFakeMousePointer, sleep, showText, hideText, clickOnHistory } from './util'
|
||||||
|
|
||||||
const binary = os.platform() === 'darwin' ? 'Electron.app/Contents/MacOS/Electron' : 'electron'
|
const binary = os.platform() === 'darwin' ? 'Electron.app/Contents/MacOS/Electron' : 'electron'
|
||||||
const fullscreen = os.platform() === 'darwin' ? [] : ['--fullscreen']
|
const runningUiTestOnCi = os.platform() === 'darwin' ? [] : ['--runningUiTestOnCi']
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
host: 'localhost', // Use localhost as chrome driver server
|
host: 'localhost', // Use localhost as chrome driver server
|
||||||
@@ -30,7 +30,7 @@ const options = {
|
|||||||
browserName: 'electron',
|
browserName: 'electron',
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
binary: `${__dirname}/../../../node_modules/electron/dist/${binary}`,
|
binary: `${__dirname}/../../../node_modules/electron/dist/${binary}`,
|
||||||
args: [`--app=${__dirname}/../../..`, '--force-device-scale-factor=1', '--no-sandbox', '--disable-dev-shm-usage', '--disable-extensions'].concat(fullscreen),
|
args: [`--app=${__dirname}/../../..`, '--force-device-scale-factor=1', '--no-sandbox', '--disable-dev-shm-usage', '--disable-extensions'].concat(runningUiTestOnCi),
|
||||||
},
|
},
|
||||||
windowTypes: ['app', 'webview'],
|
windowTypes: ['app', 'webview'],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user