Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI with Azure Pipelines #2

Open
wants to merge 156 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
477b9a7
add ability to launch a playback window, and hook it up to server mon…
jlipps Feb 7, 2018
5c0bb70
get playback library actions and reducers and component stubbed out
jlipps Feb 7, 2018
5dbfd50
add server type tabs to playback library window
jlipps Feb 7, 2018
8056a3c
design basic PlaybackLibrary component with an empty set of tests and…
jlipps Feb 8, 2018
c1bd702
work on save tests modal
jlipps Feb 8, 2018
46615b5
add saved tests modal and list+delete, playback still to come
jlipps Feb 13, 2018
ec17166
add ability to show caps for a test
jlipps Feb 13, 2018
5c89155
WIP: rudimentary playback with a bit of status feedback
jlipps Feb 14, 2018
793f000
get playback working with nice results modal
jlipps Feb 15, 2018
a403552
add elapsed time for steps and test
jlipps Feb 15, 2018
764eaca
show errors nicely during playback, and start saving test results
jlipps Feb 15, 2018
b706340
show some test metadata too
jlipps Feb 15, 2018
6cf3f4d
refactor TestRun
jlipps Feb 15, 2018
c9b24f8
round out rest of command support, multiple element support, etc...
jlipps Feb 16, 2018
66398df
ensure each window knows about saved test updates
jlipps Feb 16, 2018
66fdd7a
track session id so we can show a link to cloud provider test page
jlipps Feb 16, 2018
c0655bf
show appPackage for android tests
jlipps Feb 16, 2018
82178c1
move screenshot delay into screenshot conditional
jlipps Feb 20, 2018
2acba80
Fix broken CI script
dpgraham Feb 28, 2018
7d151b2
Check NPM and Node versions before packaging (#432)
dpgraham Mar 3, 2018
d7537bb
Autoupdate overhaul (#435)
dpgraham Mar 5, 2018
593d1c8
1.3.10
dpgraham Mar 6, 2018
65c35b8
Fix windows autoupdater (#444)
dpgraham Mar 6, 2018
34b364f
Prepare v1.4.1 (#445)
dpgraham Mar 6, 2018
b02c650
Fix autoupdater on dev (#446)
dpgraham Mar 7, 2018
5ec6be5
Fix broken integration test
dpgraham Mar 7, 2018
34cd5ac
Fix platform checker and remove MacOS from Travis (#448)
dpgraham Mar 7, 2018
d8c4c67
mock out a unified ui using cards
jlipps Mar 8, 2018
524cea0
start to move playback stuff back into session, and re-do saved tests…
jlipps Mar 8, 2018
a078496
fix up css for scrolling content inside tabs/cards
jlipps Mar 8, 2018
3c9c80b
get test running working along with sending caps to caps editor
jlipps Mar 8, 2018
06df1a0
finish porting playback features: test results and styling
jlipps Mar 8, 2018
7b735e4
fix bug with updating action status
jlipps Mar 8, 2018
0fff0fc
Mac fixes (#452)
dpgraham Mar 8, 2018
ffeb173
Windows fixes (#453)
dpgraham Mar 8, 2018
069b2a2
init screenshot as null
jlipps Mar 17, 2018
29f56fa
Merge branch 'master' into playback
jlipps Mar 17, 2018
37d692c
remove option to open a playback window
jlipps Mar 17, 2018
5c8cad4
action param check should be nullish, not null-exact
jlipps Mar 23, 2018
272fcf9
show coordinate info for tap in testrun
jlipps Mar 23, 2018
7e0553c
also show info for sendkeys
jlipps Mar 23, 2018
014c25c
should just json stringify selector
jlipps Mar 23, 2018
ff51343
Clear the variable names failed (#475)
canfeit Mar 23, 2018
26eeee1
Allow unauthorized SSL and Proxy (#469)
dpgraham Apr 2, 2018
5cac2f5
Prepare for v1.5.0
dpgraham Apr 2, 2018
9d79055
Get Screen Size using WindowSize rather than coordinates of root elem…
simongranger Apr 9, 2018
f352e6e
Update known-issues (#484)
dpgraham Apr 9, 2018
4f0e624
Use Yarn (#492)
dpgraham Apr 10, 2018
4a804d0
Remove unneeded form fields (#487)
dpgraham Apr 13, 2018
7aebc28
if we couldn't find an element during playback, that's an error
jlipps Apr 15, 2018
847be1c
Code generation fixes (#505)
dpgraham Apr 24, 2018
f25b05a
browserstack server tab
mohitmun Apr 10, 2018
d8508fc
set window minWidth to 1080 so browserstack tab is visible
mohitmun Apr 24, 2018
9dd88bc
Revert 492 dpgraham yarn installation (#506) (#507)
dpgraham Apr 24, 2018
ba14775
Add internal session keep-alive (#509)
dpgraham Apr 25, 2018
f7eaa8c
Upgrade electron 1.7.11 ~> 1.7.13 (#511)
dpgraham Apr 25, 2018
2a31d3d
Change minWidth of inspector window to 1080
mohitmun Apr 26, 2018
231be7b
Merge pull request #510 from browserstack/browserstack_server_tab
jlipps Apr 26, 2018
f609c39
Rename capType from json_object to object prevent exception (#513)
dpgraham Apr 26, 2018
e3ad103
Prepare for v1.6.0
dpgraham Apr 26, 2018
a2abe09
Use Appium 1.8
dpgraham Apr 26, 2018
22e57bb
Merge branch 'master' into playback
jlipps May 2, 2018
fcc05cf
leftover merge tasks
jlipps May 3, 2018
3622564
send caps from a selected test automatically to caps editor
jlipps May 3, 2018
f20bd8b
show count of saved tests and results
jlipps May 3, 2018
19062d1
some more merge fixes
jlipps May 3, 2018
f57c557
make sure we bind appium client for playback
jlipps May 3, 2018
39d3ac1
ensure that caps shown for running and already-run test are those use…
jlipps May 4, 2018
c4c0c97
Fix 'getCapsObject' problem (#517)
dpgraham May 4, 2018
8e6b11a
Prepare for 1.6.0 (#522)
dpgraham May 5, 2018
29166d5
Don't show quit error if quit initiated by user (#527)
dpgraham May 8, 2018
6a6902a
Fixes for keepAlive (#526)
dpgraham May 8, 2018
b8522c3
Merge branch 'master' into playback
dpgraham May 8, 2018
bdee5e1
Merge pull request #466 from jlipps/playback
dpgraham May 8, 2018
b301ce2
Revert "Record & Playback" (#532)
dpgraham May 9, 2018
4cd2767
Re-enable package-lock (#533)
dpgraham May 14, 2018
fb32fc2
Build updates (#531)
dpgraham May 14, 2018
bd62432
Fix small typo in README.md (#548)
cjoe May 25, 2018
f857cd7
Add VSCode debugging to dev (#540)
dpgraham Jun 6, 2018
e635398
Greenkeeper locks (#561)
dpgraham Jun 7, 2018
9eba9e6
Fix: .env properly loads based on target (#562)
dpgraham Jun 7, 2018
9ca409a
Bump Appium to 1.8.1
dpgraham Jun 7, 2018
c71589a
Prepare for 1.6.2
dpgraham Jun 7, 2018
e30769c
CI fixes
dpgraham Jun 8, 2018
004eccb
Don't show alerts when e2e test
dpgraham Jun 8, 2018
2bc4a76
Use absolute coordinates for 'swipe'
dpgraham Jun 8, 2018
63c9e74
Fix env issues in dev
dpgraham Jun 11, 2018
17813fd
Fix: Close sessionWin when mainWin closed (#572)
dpgraham Jul 3, 2018
bbc6243
Add RobotFramework export option on the recorder (#574)
NeoMorfeo Jul 9, 2018
36d4432
Don't set 'interactions not available' until we've tried all strategi…
dpgraham Jul 9, 2018
54e5745
Fix: Show scroll buttons on expanded paths change (#580)
dpgraham Jul 16, 2018
b370875
Missing closing bracket in touchAction (#583)
Jul 16, 2018
c50aea5
Add support for copying source XML to clipboard (#586)
caguilar187 Jul 24, 2018
3bf7847
Add cloud provider visibility menu (#581)
dpgraham Jul 27, 2018
ed95075
Add stubs to actions/ and components/
dpgraham Jul 24, 2018
2a6460a
Add config pages
dpgraham Jul 24, 2018
795762a
Add raw config form
dpgraham Jul 24, 2018
3cd0c48
Set environment variables in Redux
dpgraham Jul 24, 2018
0472697
Gets process.env from main thread and sets as defaults
dpgraham Jul 24, 2018
ad76e81
Make it restart after saving ENV changes
dpgraham Jul 24, 2018
4e25ad3
Confirm before restart
dpgraham Jul 24, 2018
b2b44af
Make browser window opener a helper method
dpgraham Jul 24, 2018
240ead1
Open config from menu
dpgraham Jul 24, 2018
da27c8f
Config button
dpgraham Jul 24, 2018
383f565
Fix error on variable generation and params
NeoMorfeo Jul 31, 2018
f015afe
Merge pull request #591 from NeoMorfeo/master
jlipps Jul 31, 2018
e638b06
PR fixes
dpgraham Aug 2, 2018
5239840
Merge pull request #588 from appium/dpgraham-android-home-variable
dpgraham Aug 2, 2018
cb26e61
Prepare for 1.6.3
dpgraham Aug 2, 2018
f06fcb0
Add Bitbar to cloud providers (#594)
Walther Aug 14, 2018
f1b565b
Fix two typos in Browserstack tab; fixes env var usage (#602)
Walther Aug 14, 2018
ac93b44
Replace Bitbar company logo with the testing cloud specific one (#603)
Walther Aug 16, 2018
564359c
Fix: Call fix-path after settting UI saved env variables (#604)
dpgraham Aug 16, 2018
45654ec
Skip integration tests if no GITHUB_TOKEN (#606)
dpgraham Aug 27, 2018
0f30bc1
Added React Native testID to Strategy Mappings (#614)
simongranger Aug 29, 2018
06cbe88
Add 'relaxed security' flag to UI (#607)
dpgraham Aug 29, 2018
f61dd5b
Unbind ipc renderer listeners (#612)
dpgraham Aug 29, 2018
94c5073
Appium 1.9.0
dpgraham Aug 30, 2018
49bdef5
Prepare for 1.7.0
dpgraham Aug 30, 2018
a976898
Remove getParser code (#616)
dpgraham Sep 5, 2018
436f24b
Update readme with cloud provider information
Walther Sep 6, 2018
dcfc51c
Merge pull request #618 from bitbar/2018-09-readme-update-providers
jlipps Sep 6, 2018
24d3343
Fix
dpgraham Feb 28, 2018
2698b00
Set up CI with Azure Pipelines
azure-pipelines[bot] Sep 11, 2018
2b12f94
Testing
dpgraham Mar 1, 2018
b976faf
Package lock
dpgraham Apr 9, 2018
fdc185f
Yarn
dpgraham Apr 9, 2018
083bef0
Pipelines
dpgraham Sep 12, 2018
2dc3aae
Pipelines
dpgraham Sep 12, 2018
043bf6c
Pipelines
dpgraham Sep 12, 2018
6dd9397
Pipelines
dpgraham Sep 12, 2018
b1449d1
Pipelines
dpgraham Sep 12, 2018
bd282e1
Pipelines
dpgraham Sep 12, 2018
2ca0984
Pipelines
dpgraham Sep 12, 2018
c20060b
Pipelines
dpgraham Sep 12, 2018
8c1e982
Pipelines
dpgraham Sep 12, 2018
f33603c
Pipelines
dpgraham Sep 19, 2018
e70fa91
Pipelines
dpgraham Sep 19, 2018
cac930b
Mac build
dpgraham Sep 19, 2018
8d6cc37
Fix
dpgraham Sep 19, 2018
d6d3734
Fix
dpgraham Sep 19, 2018
ef1f0ae
Fix
dpgraham Sep 19, 2018
2effc87
Fix
dpgraham Sep 19, 2018
d7215cb
Fix
dpgraham Sep 19, 2018
810e3d1
Fix
dpgraham Sep 20, 2018
7390253
CI
dpgraham Sep 24, 2018
655b88b
Fix
dpgraham Sep 24, 2018
649bf30
Fix
dpgraham Sep 24, 2018
06647b2
Fix
dpgraham Sep 24, 2018
714b28e
Fix
dpgraham Sep 24, 2018
e6afbae
Fix
dpgraham Sep 24, 2018
6ee1209
Remove
dpgraham Sep 24, 2018
e61d2c8
Blank
dpgraham Sep 24, 2018
fc96629
Blank
dpgraham Sep 24, 2018
de79e69
Commit
dpgraham Sep 24, 2018
30f5b11
update
dpgraham Sep 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
package-lock.json

dist
release
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false
package-lock=true
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@ os:
- linux
- osx
node_js:
- '7'
- '9'
before_install:
- nvm install 9
- npm install -g [email protected]
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends
-y icnsutils graphicsmagick xz-utils; fi
addons:
apt:
packages:
- xvfb
before_script:
- greenkeeper-lockfile-update
- node --version
- npm install
- npm install -g electron
- node --version
- npm --version
- travis_wait 30 npm run package-ci # This command takes a long time, so increased the time limit to 30 minutes (default is 10 minutes)
- greenkeeper-lockfile-upload
cache:
directories:
- node_modules
- "$HOME/.electron"
- "$HOME/.cache"
install:
- nvm install 7
- npm ci
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
dist: trusty
Expand Down
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "dev",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "npm",
"env": {
"NODE_ENV": "development"
},
"runtimeArgs": [
"run-script", "dev"
],
"port": 5858
}
]
}
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
## [1.7.0](https://github.com/appium/appium-desktop/compare/v1.7.0...v1.6.3) (2018-08-30)

### Changes
* Feature: Upgrade to Appium 1.9.0
* Feature: Add relaxed security flag (#607)
* Feature: Add Bitbar to cloud providers (#603)
* Feature: Add React Native testID to strategy mappings (#614)
* Fix: Remove unneeded ipc binding (#612)


## [1.6.3](https://github.com/appium/appium-desktop/compare/v1.6.3...v1.6.2) (2018-08-02)

### Changes
* Feature: Make ANDROID_HOME and JAVA_HOME settable from the UI
* Feature: Add icon for copying source XML to clipboard
* Fix: Close session window when main window is closed

## [1.6.2](https://github.com/appium/appium-desktop/compare/v1.6.2...v1.6.1) (2018-06-08)

### Changes
* Feature: Upgrade to Appium 1.8.1
* Fix: Use absolute coordinates for 'swipe'

## [1.6.1](https://github.com/appium/appium-desktop/compare/v1.6.1...v1.5.0) (2018-05-08)

### Changes
* Feature: Upgrade to Appium 1.8.0
* Feature: Upgrade Electron to 2.0.0
* Feature: Add internal session keep-alive (#509)
* Feature: Add BrowserStack as a cloud provider

## [1.5.0](https://github.com/appium/appium-desktop/compare/v1.4.1...v1.5.0) (2018-04-02)

### Changes
* Feature: Allow unauthorized SSL and set custom proxy (#469)

## [1.4.1](https://github.com/appium/appium-desktop/compare/v1.4.0...v1.4.1) (2018-03-06)

### Changes
* Fix: Replace electron-builder autoupdater with Zeit Hazel server plus native updater (#435)


## [1.4.0](https://github.com/appium/appium-desktop/compare/v1.3.2...v1.4.0) (2018-02-27)

### Changes
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,29 @@ To run the e2e tests call
npm run e2e
```

### Debugging

#### Renderer
* The renderer uses Chromium and can be debugged using Chrome DevTools the same way a webpage is debugged
* When you run dev (`npm run dev`) the Chrome DevTools window is opened on startup.
* To open it again, after it has been closed, right click on the window and select `Inspect Element`

#### Main
* In Chrome Dev Tools
* Run dev (`npm run dev`). This sets an --inspect port at 5858
* Running in dev sets up an inspector port at 5858
* Open chrome://inspect in your chrome browser
* Click `Open dedicated DevTools for Node`
* Add a connection `localhost:5858`
* Start inspecting code under other tabs
* In VSCode
* In the debug tab, run 'dev'
* Set breakpoints directly in VSCode
* For reference on NodeJS debugging see:
* https://electronjs.org/docs/tutorial/debugging-main-process-vscode
* https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27


### Packaging and Releasing

Appium Desktop uses [Electron Builder](https://github.com/electron-userland/electron-builder/) to build app. Read this document for instructions on how to set up your local environment so that you can build and package the app: https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ from the downloaded DMG file to your own file system (the best place is the
not supported, and will not work.

## Known Issues
* Auto updater is not working (https://github.com/appium/appium-desktop/issues/74)
* Some Windows 10 Users experience a `PathTooLongException` when installing the EXE. The workaround for this is to update the setting on Windows to [enable long paths](https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing)

## Usage Instructions

Expand Down Expand Up @@ -108,9 +108,15 @@ this case, attaching to the local server will be disabled.

These are the options for launching a session against a non-local Appium server:

* A custom host/port configuration: this is useful if you want to launch an Inspector session against an Appium server running on another machine in your network, for example.
* Sauce Labs: if you don't have access to, say, iOS simulators on your machine, you can leverage your [Sauce Labs](https://saucelabs.com) account to start an Appium session in the cloud.
* TestObject: you can also utilize [TestObject](https://testobject.com)'s cloud of real devices for a real device-based Inspector session.
| Endpoint | Description |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Automatic server | Automatically utilizes the currently-running Appium server |
| Custom Server | Launch a session on an Appium server running on another machine over the network |
| Sauce Labs | Launch a session on the [Sauce Labs](https://saucelabs.com) cloud. [Documentation](https://wiki.saucelabs.com/) |
| TestObject | Launch a session on the [TestObject](https://testobject.com) cloud. [Documentation](https://wiki.saucelabs.com/) |
| Headspin | Launch a session on the [Headspin](https://headspin.com) cloud. [Documentation](https://docs.headspin.io/) |
| BrowserStack | Launch a session on the [Browserstack](https://browserstack.com) cloud. [Documentation](https://www.browserstack.com/docs) |
| Bitbar | Launch a session on the [Bitbar](https://bitbar.com) cloud. [Documentation](http://docs.bitbar.com/) |

It should be straightforward to get set up with any of these options. Simply
enter your details in the input fields provided.
Expand All @@ -121,7 +127,9 @@ Desired capabilities are how you configure your Appium session. They tell the
Appium server what kind of platform and app you want to automate. If you are
unfamiliar with the concept of desired capabilities, or which desired
capabilities are required to launch Appium sessions of various types, you
should consult the Appium documentation.
should consult the Appium documentation. Additionally, if you're using one of
the cloud providers, consult their documentation for possible vendor-specific
details.

Appium Desktop does not restrict your creation of desired capabilities in any
way, nor will it validate them for you. It simply provides a nice UI for
Expand Down
10 changes: 10 additions & 0 deletions app/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let env = {};

// DefinePlugin doesn't work in dev so if _ENV_ is undefined, assume it's a development environment
if (typeof(_ENV_) === "undefined") {
env = require('../env/.env-dev');
} else {
env = _ENV_; // eslint-disable-line no-undef
}

export default env;
83 changes: 76 additions & 7 deletions app/main/appium-method-handler.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,61 @@
import Bluebird from 'bluebird';
import _ from 'lodash';
import wd from 'wd';

const isDevelopment = process.env.NODE_ENV === 'development';

const KEEP_ALIVE_PING_INTERVAL = 5 * 1000;
const NO_NEW_COMMAND_LIMIT = isDevelopment ? 30 * 1000 : 5 * 60 * 1000;
const WAIT_FOR_USER_KEEP_ALIVE = 30 * 1000;

export default class AppiumMethodHandler {
constructor (driver) {
constructor (driver, sender) {
this.driver = driver;
this.sender = sender;
this.elementCache = {};
this.elVariableCounter = 1;
this.elArrayVariableCounter = 1;
this._lastActiveMoment = +(new Date());
}

/**
* Ping server every 30 seconds to prevent `newCommandTimeout` from killing session
*/
runKeepAliveLoop () {
this.keepAlive = setInterval(() => {
this.driver.sessionCapabilities(); // Pings the Appium server to keep it alive
const now = +(new Date());

// If the new command limit has been surpassed, prompt user if they want to keep session going
// Give them 30 seconds to respond
if (now - this._lastActiveMoment > NO_NEW_COMMAND_LIMIT) {
this.sender.send('appium-prompt-keep-alive');

// After the time limit kill the session (this timeout will be killed if they keep it alive)
this.waitForUserTimeout = setTimeout(() => {
this.close('Session closed due to inactivity');
}, WAIT_FOR_USER_KEEP_ALIVE);
}
}, KEEP_ALIVE_PING_INTERVAL);
}

/**
* Get rid of the intervals to keep the session alive
*/
killKeepAliveLoop () {
clearInterval(this.keepAlive);
if (this.waitForUserTimeout) {
clearTimeout(this.waitForUserTimeout);
}
}

/**
* Reset the new command clock and kill the wait for user timeout
*/
keepSessionAlive () {
this._lastActiveMoment = +(new Date());
if (this.waitForUserTimeout) {
clearTimeout(this.waitForUserTimeout);
}
}

async fetchElement (strategy, selector) {
Expand Down Expand Up @@ -59,6 +107,7 @@ export default class AppiumMethodHandler {
}

async _execute ({elementId, methodName, args, skipScreenshotAndSource}) {
this._lastActiveMoment = +(new Date());
let cachedEl;
let res = {};

Expand All @@ -76,7 +125,7 @@ export default class AppiumMethodHandler {
.tap({x: args[0], y: args[1]})
.perform();
} else if (methodName === 'swipe') {
const [startX, startY, endX, endY] = args;
const [startX, startY, endX, endY] = args;
res = await (new wd.TouchAction(this.driver))
.press({x: startX, y: startY})
.moveTo({x: endX, y: endY})
Expand Down Expand Up @@ -111,7 +160,7 @@ export default class AppiumMethodHandler {
}

async _getSourceAndScreenshot () {
let source, sourceError, screenshot, screenshotError;
let source, sourceError, screenshot, screenshotError, windowSize, windowSizeError;
try {
source = await this.driver.source();
} catch (e) {
Expand All @@ -129,13 +178,23 @@ export default class AppiumMethodHandler {
}
screenshotError = e;
}

try {
windowSize = await this.driver.getWindowSize();

} catch (e) {
if (e.status === 6) {
throw e;
}
windowSizeError = e;
}

return {source, sourceError, screenshot, screenshotError};
return {source, sourceError, screenshot, screenshotError, windowSize, windowSizeError};
}

restart () {
// Clear the variable names and start over (el1, el2, els1, els2, etc...)
for (let elCache of _.toPairs(this.elementCache)) {
for (const elCache of Object.values(this.elementCache)) {
delete elCache.variableName;
}

Expand All @@ -144,4 +203,14 @@ export default class AppiumMethodHandler {
this.elArrayVariableCounter = 1;
}

}
async close (reason, killedByUser=false) {
this.killKeepAliveLoop();
this.sender.send('appium-session-done', {reason, killedByUser});
if (!this.driver._isAttachedSession) {
try {
await this.driver.quit();
} catch (ign) { }
}
}

}
Loading