You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by alsorokin <gi...@git.apache.org> on 2016/03/30 10:41:58 UTC
[GitHub] cordova-medic pull request: Appium runner improvements
GitHub user alsorokin opened a pull request:
https://github.com/apache/cordova-medic/pull/85
Appium runner improvements
* Changed ios device in appium config to match the emulator on osx slave
* Added 'common' folder to the search paths for Appium runner
* Save appium log
* Pass helpers to tests
* Untied from mobilespec
* Extended wdHelper with getWebviewContext() function
* Added InjectLibraries function to wdHelper
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MSOpenTech/cordova-medic ui-tests
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-medic/pull/85.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #85
----
commit bf529ccc610305d74587626185623f3b4df40401
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2016-03-16T15:31:53Z
Changed ios device in appium config to match the emulator on osx slave
commit d154730402dd51b0a4dd34d11f6af3d519787d36
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2016-03-16T15:38:02Z
Added 'common' folder to the search paths for Appium runner
commit 6c70053056ff6b801ade67526de1cad3859ac914
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2016-03-18T16:17:33Z
Save appium log
commit ad02b054eef4f45a44caf5f53396ff462b9d90d9
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2016-03-23T15:07:50Z
Appium tests: pass helpers to tests,
Actually untie from mobilespec
commit 557b003c3f1b5c78ce199705cfb98863d715f8e8
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2016-03-28T16:30:28Z
extended wdHelper with getWebviewContext() function
commit f4be2c475924536ff61fe793c9445ad0770192e9
Author: Alexander Sorokin <al...@akvelon.com>
Date: 2016-03-29T15:28:39Z
Added InjectLibraries function to wdHelper
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r57861718
--- Diff: medic/medic-appium.js ---
@@ -197,9 +214,10 @@ function parseArgs() {
return options;
}
-function getLocalCLI() {
- if (util.isWindows()) {
- return "cordova.bat";
+function getLocalCLI(appPath) {
+ if (util.isWindows() || !fs.existsSync(path.join(getFullAppPath(appPath), "./cordova"))) {
--- End diff --
Why we fall back to default on Windows? I can see `cordova.bat` in mobilespec directory on Windows
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by alsorokin <gi...@git.apache.org>.
Github user alsorokin commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r58009291
--- Diff: buildbot-conf/cordova-config.json.sample ---
@@ -12,8 +12,8 @@
"appium": {
"androidDeviceName": "Galaxy_Nexus",
"androidPlatformVersion": "19",
- "iosDeviceName": "iPhone 5",
- "iosPlatformVersion": "8.4",
+ "iosDeviceName": "iPhone 6s",
+ "iosPlatformVersion": "9.1",
"timeout": 2400,
--- End diff --
Thanks for the reminder, it's already there.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by alsorokin <gi...@git.apache.org>.
Github user alsorokin commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r57862046
--- Diff: medic/medic-appium.js ---
@@ -197,9 +214,10 @@ function parseArgs() {
return options;
}
-function getLocalCLI() {
- if (util.isWindows()) {
- return "cordova.bat";
+function getLocalCLI(appPath) {
+ if (util.isWindows() || !fs.existsSync(path.join(getFullAppPath(appPath), "./cordova"))) {
--- End diff --
Windows doesn't need the dot-slash to execute this .bat
So basically, on windows "cordova" command would execute .bat and if it's not there, will execute global cordova.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r57860875
--- Diff: lib/appium/helpers/wdHelper.js ---
@@ -0,0 +1,112 @@
+/* jshint node: true */
+/* global navigator */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+'use strict';
+
+var APPIUM_SERVER_HOST = 'localhost';
+var APPIUM_SERVER_PORT = 4723;
+var WEBVIEW_WAIT_TIMEOUT = 5000;
+var IMPLICIT_WAIT_TIMEOUT = 10000;
+
+var fs = require('fs');
+var path = require('path');
+
+module.exports.getDriver = function (platform) {
--- End diff --
Is the driver instance supposed to be a singleton?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r57871214
--- Diff: medic/medic-appium.js ---
@@ -197,9 +214,10 @@ function parseArgs() {
return options;
}
-function getLocalCLI() {
- if (util.isWindows()) {
- return "cordova.bat";
+function getLocalCLI(appPath) {
+ if (util.isWindows() || !fs.existsSync(path.join(getFullAppPath(appPath), "./cordova"))) {
--- End diff --
Right, thanks for clarification.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/cordova-medic/pull/85
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r57860571
--- Diff: lib/appium/helpers/wdHelper.js ---
@@ -0,0 +1,112 @@
+/* jshint node: true */
+/* global navigator */
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+'use strict';
+
+var APPIUM_SERVER_HOST = 'localhost';
+var APPIUM_SERVER_PORT = 4723;
+var WEBVIEW_WAIT_TIMEOUT = 5000;
+var IMPLICIT_WAIT_TIMEOUT = 10000;
+
+var fs = require('fs');
+var path = require('path');
+
+module.exports.getDriver = function (platform) {
+ var normalizedPlatform;
+ switch (platform.toLowerCase()) {
+ case 'android':
+ normalizedPlatform = 'Android';
+ break;
+ case 'ios':
+ normalizedPlatform = 'iOS';
+ break;
+ default:
+ throw 'Unknown platform: ' + platform;
+ }
+
+ var serverConfig = {
+ host: APPIUM_SERVER_HOST,
+ port: APPIUM_SERVER_PORT
+ };
+
+ var driverConfig = {
+ browserName: '',
+ 'appium-version': '1.5',
+ platformName: normalizedPlatform,
+ platformVersion: global.PLATFORM_VERSION || '',
+ deviceName: global.DEVICE_NAME || '',
+ app: global.PACKAGE_PATH,
+ autoAcceptAlerts: true,
+ };
+
+ var driver = global.WD.promiseChainRemote(serverConfig);
+ module.exports.configureLogging(driver);
+
+ return driver
+ .init(driverConfig)
+ .setImplicitWaitTimeout(IMPLICIT_WAIT_TIMEOUT);
+};
+
+module.exports.getWD = function () {
+ return global.WD;
+};
+
+module.exports.getWebviewContext = function (driver) {
--- End diff --
What if the webview couldn't be loaded somehow? Maybe we need to limit number of attempts?
```js
getWebviewContext = function (driver, maxAttempts) {
...
return getWebviewContext(driver, maxAttempts - 1);
});
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-medic pull request: Appium runner improvements
Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/85#discussion_r57990944
--- Diff: buildbot-conf/cordova-config.json.sample ---
@@ -12,8 +12,8 @@
"appium": {
"androidDeviceName": "Galaxy_Nexus",
"androidPlatformVersion": "19",
- "iosDeviceName": "iPhone 5",
- "iosPlatformVersion": "8.4",
+ "iosDeviceName": "iPhone 6s",
+ "iosPlatformVersion": "9.1",
"timeout": 2400,
--- End diff --
Just a friendly reminder to make this change in the actual file on the Buildbot server; this file is just a sample.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org