From dc2474e6b0183f4e1f5a66dc9b17ddf8f8affe08 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Fri, 22 Mar 2019 13:34:31 +0200 Subject: [PATCH 1/6] Update vue deps. --- demo-vue/package.json | 4 ++-- src/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo-vue/package.json b/demo-vue/package.json index 19a6d2d..2f1b626 100644 --- a/demo-vue/package.json +++ b/demo-vue/package.json @@ -14,7 +14,7 @@ "dependencies": { "nativescript-facebook": "../src", "nativescript-theme-core": "~1.0.4", - "nativescript-vue": "~2.0.0", + "nativescript-vue": "^2.0.0", "tns-core-modules": "~5.2.0" }, "devDependencies": { @@ -35,7 +35,7 @@ "nativescript-dev-appium": "5.0.0", "nativescript-dev-typescript": "~0.8.0", "nativescript-dev-webpack": "~0.20.0", - "nativescript-vue-template-compiler": "~2.0.2", + "nativescript-vue-template-compiler": "^2.0.2", "node-sass": "~4.9.0", "vue-loader": "~15.4.2" }, diff --git a/src/package.json b/src/package.json index 3f5d867..7f635d1 100644 --- a/src/package.json +++ b/src/package.json @@ -47,7 +47,7 @@ "tns-platform-declarations": "^5.2.0", "typescript": "~3.1.6", "nativescript-angular": "~7.2.1", - "nativescript-vue": "~2.0.2", + "nativescript-vue": "^2.0.2", "@angular/core": "~7.2.0", "@angular/common": "~7.2.0", "@angular/compiler": "~7.2.0", From d7d03337c9e7f320a554a5978bf8f7cbec5f95ec Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Fri, 22 Mar 2019 18:01:48 +0200 Subject: [PATCH 2/6] Fix: Add vue registerElement in install method as of 2.2.0 of nativescript-vue --- demo-vue/app/app.js | 3 +++ src/vue/facebook-vue-directives.ts | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/demo-vue/app/app.js b/demo-vue/app/app.js index 4767eda..a674dad 100644 --- a/demo-vue/app/app.js +++ b/demo-vue/app/app.js @@ -7,6 +7,9 @@ import { LoginBehavior } from 'nativescript-facebook'; +import FacebookPlugin from "nativescript-facebook/vue"; +Vue.use(FacebookPlugin); + Vue.config.silent = true; application.on(application.launchEvent, function (args) { diff --git a/src/vue/facebook-vue-directives.ts b/src/vue/facebook-vue-directives.ts index 486e539..388c4bc 100644 --- a/src/vue/facebook-vue-directives.ts +++ b/src/vue/facebook-vue-directives.ts @@ -1,5 +1,9 @@ -import * as Vue from "nativescript-vue"; +const FacebookPlugin = { + install(Vue, options) { + Vue.registerElement("FacebookLoginButton", () => require("../").LoginButton); + Vue.registerElement("FacebookShareButton", () => require('../').ShareButton); + Vue.registerElement("FacebookSendButton", () => require('../').SendButton); + } +} -Vue.registerElement("FacebookLoginButton", () => require("../").LoginButton); -Vue.registerElement("FacebookShareButton", () => require('../').ShareButton); -Vue.registerElement("FacebookSendButton", () => require('../').SendButton); \ No newline at end of file +export default FacebookPlugin; \ No newline at end of file From b59cae02159f12c2aeef26d39840fba535a099cd Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Fri, 22 Mar 2019 18:05:25 +0200 Subject: [PATCH 3/6] Fix: lint error in src/vue --- src/vue/facebook-vue-directives.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vue/facebook-vue-directives.ts b/src/vue/facebook-vue-directives.ts index 388c4bc..35d2c0b 100644 --- a/src/vue/facebook-vue-directives.ts +++ b/src/vue/facebook-vue-directives.ts @@ -4,6 +4,6 @@ const FacebookPlugin = { Vue.registerElement("FacebookShareButton", () => require('../').ShareButton); Vue.registerElement("FacebookSendButton", () => require('../').SendButton); } -} +}; export default FacebookPlugin; \ No newline at end of file From 08259bd332678788e07bc9978a47f845c27e4d3a Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 26 Mar 2019 12:05:06 +0200 Subject: [PATCH 4/6] Update element locator for continue button on android --- demo-vue/e2e/test.e2e.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/demo-vue/e2e/test.e2e.ts b/demo-vue/e2e/test.e2e.ts index b9fba90..3080f86 100644 --- a/demo-vue/e2e/test.e2e.ts +++ b/demo-vue/e2e/test.e2e.ts @@ -96,7 +96,13 @@ describe("Facebook tests", async function () { await logInButton.click(); await driver.wait(2000); } - const continueButton = await driver.findElementByText("Continue", SearchOptions.exact); + let continueButton; + if(driver.isAndroid){ + continueButton = await driver.findElementByAccessibilityId("Continue") + } + else{ + continueButton = await driver.findElementByText("Continue", SearchOptions.exact); + } await continueButton.click(); await driver.wait(1000); const userNameLabel = await driver.findElementByText("Nativescript User", SearchOptions.contains); From 7fb4ef25ca8cd30d30d63035a3f7190ce77266d4 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 26 Mar 2019 13:55:07 +0200 Subject: [PATCH 5/6] Fix: capabilities for demo-vue android --- demo-vue/e2e/config/appium.capabilities.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/demo-vue/e2e/config/appium.capabilities.json b/demo-vue/e2e/config/appium.capabilities.json index 5129fcb..b13beb2 100644 --- a/demo-vue/e2e/config/appium.capabilities.json +++ b/demo-vue/e2e/config/appium.capabilities.json @@ -18,13 +18,7 @@ "platformVersion": "7.0", "deviceName": "Android GoogleAPI Emulator", "appiumVersion": "1.9.1", - "noReset": true, - "lt": 60000, - "newCommandTimeout": 720, - "appium-version": "1.9.1", - "fullReset": false, - "idleTimeout": 120, - "automationName": "Appium" + "noReset": true }, "android25": { "platformName": "Android", From 837d37ede15d5a9022f59615953dfee4c64b6fe0 Mon Sep 17 00:00:00 2001 From: Dimitar Todorov Date: Tue, 26 Mar 2019 15:04:46 +0200 Subject: [PATCH 6/6] Fix: continue btn to be found by class name --- demo-vue/e2e/test.e2e.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-vue/e2e/test.e2e.ts b/demo-vue/e2e/test.e2e.ts index 3080f86..d959a97 100644 --- a/demo-vue/e2e/test.e2e.ts +++ b/demo-vue/e2e/test.e2e.ts @@ -98,7 +98,7 @@ describe("Facebook tests", async function () { } let continueButton; if(driver.isAndroid){ - continueButton = await driver.findElementByAccessibilityId("Continue") + continueButton = await driver.findElementByClassName("android.widget.Button") } else{ continueButton = await driver.findElementByText("Continue", SearchOptions.exact);