Skip to content

[DO NOT MERGE] feat (locators): include more locators for iOS and Android #50

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions lib/locators.d.ts
Original file line number Diff line number Diff line change
@@ -4,8 +4,12 @@ export declare class Locator {
private _elementsList;
constructor(_platformName: string, _platformVersion: any);
readonly button: string;
readonly imageButton: string;
readonly listView: string;
readonly textField: string;
readonly textView: string;
readonly image: string;
readonly nsImage: string;
readonly allELementsList: Map<string, string>;
getElementByName(name: any): string;
private loadAndroidElements();
17 changes: 17 additions & 0 deletions lib/locators.ts
Original file line number Diff line number Diff line change
@@ -17,15 +17,30 @@ export class Locator {
return this.getElementByName("button");
}

get imageButton() {
return this.getElementByName("image-button");
}

get listView() {
return this.getElementByName("listview");
}

get textField() {
return this.getElementByName("textfield");
}

get textView() {
return this.getElementByName("textview");
}

get image() {
return this.getElementByName("image");
}

get nsImage() {
return this.getElementByName("ns-image");
}

get allELementsList() {
return this._elementsList;
}
@@ -42,6 +57,7 @@ export class Locator {
this._elementsList.set("activityindicator", "android.widget.ProgressBar");
this._elementsList.set("button", "android.widget.Button");
this._elementsList.set("image", "android.widget.ImageView");
this._elementsList.set("ns-image", "org.nativescript.widget.ImageView");
this._elementsList.set("image-button", "android.widget.ImageButton");
this._elementsList.set("imagebutton", "android.widget.ImageButton");
this._elementsList.set("datepicker", "android.widget.DatePicker");
@@ -79,6 +95,7 @@ export class Locator {
this._elementsList.set("datepicker", this.createIosElement("DatePicker"));
this._elementsList.set("htmlview", this.createIosElement("TextView"));
this._elementsList.set("image", this.createIosElement("Image"));
this._elementsList.set("ns-image", this.createIosElement("Image"));
this._elementsList.set("label", this.createIosElement("StaticText"));
this._elementsList.set("absolutelayout", this.createIosElement("View"));
this._elementsList.set("docklayout", this.createIosElement("View"));
98 changes: 48 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,51 @@
{
"name": "nativescript-dev-appium",
"version": "3.0.0",
"description": "A NativeScript plugin to help integrate and run Appium tests",
"author": "Telerik",
"license": "MIT",
"main": "./index.js",
"directories": {
"lib": "./lib"
},
"repository": {
"type": "git",
"url": "https://github.com/NativeScript/nativescript-dev-appium.git"
},
"keywords": [
"nativescript",
"appium",
"test"
],
"maintainers": [
{
"name": "hdeshev",
"email": "hristo.deshev@telerik.com"
"name": "nativescript-dev-appium",
"version": "3.0.0",
"description": "A NativeScript plugin to help integrate and run Appium tests",
"author": "Telerik",
"license": "MIT",
"main": "./index.js",
"directories": {
"lib": "./lib"
},
{
"name": "SvetoslavTsenov",
"email": "tsenov@progress.com"
"repository": {
"type": "git",
"url": "https://github.com/NativeScript/nativescript-dev-appium.git"
},
"keywords": [
"nativescript",
"appium",
"test"
],
"maintainers": [{
"name": "hdeshev",
"email": "hristo.deshev@telerik.com"
},
{
"name": "SvetoslavTsenov",
"email": "tsenov@progress.com"
}
],
"dependencies": {
"app-root-path": "^2.0.1",
"portastic": "^1.0.1",
"mobile-devices-controller": "^0.0.3",
"colors": "^1.1.2",
"blink-diff": "^1.0.13",
"glob": "*",
"wd": "^1.4.0",
"webdriverio": "^4.8.0",
"yargs": "^8.0.2",
"chai": "~4.1.1",
"chai-as-promised": "~7.1.1"
},
"devDependencies": {
"@types/node": "^7.0.5",
"@types/webdriverio": "^4.8.4",
"typescript": "^2.5.0"
},
"scripts": {
"postinstall": "node ./postinstall.js",
"compile": "tsc --watch"
}
],
"dependencies": {
"app-root-path": "^2.0.1",
"portastic": "^1.0.1",
"mobile-devices-controller": "^0.0.3",
"colors": "^1.1.2",
"blink-diff": "^1.0.13",
"glob": "*",
"wd": "^1.4.0",
"webdriverio": "^4.8.0",
"yargs": "^8.0.2",
"chai": "~4.1.1",
"chai-as-promised": "~7.1.1"
},
"devDependencies": {
"@types/node": "^7.0.5",
"@types/webdriverio": "^4.8.4",
"typescript": "^2.5.0"
},
"scripts": {
"postinstall": "node ./postinstall.js",
"compile": "tsc --watch",
"e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts --"
}
}
}