Skip to content

Commit 36d4de4

Browse files
Lots of changes
1 parent a82675d commit 36d4de4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+192
-123
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea/
12
package-lock.json
23
node_modules
34
platforms/

Diff for: .travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ matrix:
4949
jdk: oraclejdk8
5050
before_install: nvm install 8.6.0
5151
script:
52-
- npm run ci.android.build
52+
- npm run android.build
5353
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE --data-binary @$ANDROID_PACKAGE_FOLDER/$ANDROID_PACKAGE"
5454
- os: osx
5555
env:
@@ -60,7 +60,7 @@ matrix:
6060
node_js: "8"
6161
jdk: oraclejdk8
6262
script:
63-
- npm run ci.ios.build
63+
- npm run ios.build
6464
- cd $IOS_PACKAGE_FOLDER && zip -r $IOS_PACKAGE nativescriptvueuitests.app/ &> /dev/null
6565
- echo $SAUCE_USER:$SAUCE_KEY
6666
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE --data-binary @$IOS_PACKAGE_FOLDER/$IOS_PACKAGE"

Diff for: README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# NativeScript-Vue UI tests
2+
This project uses Appium to test Vue UI components, and also serves as a source for the
3+
component screenshots at [nativescript-vue.org](https://nativescript-vue.org/).
4+
5+
## System requirements
6+
* Node 7.6 or higher (for async function support).
7+
* The [Appium](http://appium.io/) client. Just download and install the latest [from GitHub](https://github.com/appium/appium-desktop/releases/latest).
8+
9+
## Running the tests locally
10+
Start Appium, or you'll receive an error `127.0.0.1` can't be reached.
11+
12+
### Android
13+
```bash
14+
npm run android.build
15+
npm run android.screenshots
16+
```
17+
18+
### iOS
19+
```bash
20+
npm run ios.build
21+
npm run ios.screenshots
22+
```

Diff for: app/app.css

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.m-5 {
2+
margin: 5;
3+
}
4+
5+
.m-15 {
6+
margin: 15;
7+
}
8+
9+
.m-20 {
10+
margin: 20;
11+
}
12+
13+
.home-list Button {
14+
border-width: 1;
15+
border-color: #3e495c;
16+
border-radius: 4;
17+
margin: 6;
18+
font-size: 14;
19+
text-transform: none;
20+
height: 34;
21+
padding: 4 8;
22+
color: #fff;
23+
background-color: #52617a;
24+
}

Diff for: app/app.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -88,31 +88,29 @@ new Vue({
8888
component: () => require('./elements/dialogs/Confirm')
8989
},
9090
{
91-
name: 'LoginDialog',
92-
component: () => require('./elements/dialogs/Login')
91+
name: 'LoginDialog',
92+
component: () => require('./elements/dialogs/Login')
9393
},
9494
{
95-
name: 'PromptDialog',
96-
component: () => require('./elements/dialogs/Prompt')
95+
name: 'PromptDialog',
96+
component: () => require('./elements/dialogs/Prompt')
9797
},
9898
]
9999
},
100100

101101

102102
methods: {
103-
showElement(e) {
104-
const element = e.item;
103+
showElement(element) {
105104
this.$navigateTo(element.component())
106105
}
107106
},
108107

109108
template: `
110109
<Page>
111-
<ListView for="el in elements" @itemTap="showElement">
112-
<v-template>
113-
<Label :text="el.name" style="font-size: 15;" />
114-
</v-template>
115-
</ListView>
110+
<ActionBar title="Home"></ActionBar>
111+
<WrapLayout class="m-5 home-list">
112+
<Button :text="el.name" v-for="el in elements" @tap="showElement(el)" />
113+
</WrapLayout>
116114
</Page>
117115
`,
118116
}).$start();

Diff for: app/elements/components/ActivityIndicator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<ActivityIndicator busy="true"/>
55
</StackLayout>
66
`

Diff for: app/elements/components/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<Button text="Button"/>
55
</StackLayout>
66
`

Diff for: app/elements/components/DatePicker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<DatePicker/>
55
</StackLayout>
66
`

Diff for: app/elements/components/HtmlView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<HtmlView :html="html"/>
55
</StackLayout>
66
`,

Diff for: app/elements/components/Image.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<GridLayout rows="auto">
3+
<GridLayout rows="auto" class="m-20">
44
<Image src="res://icon" stretch="none"/>
55
</GridLayout>
66
`

Diff for: app/elements/components/Label.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<Label text="Label"/>
55
</StackLayout>
66
`

Diff for: app/elements/components/ListPicker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<ListPicker :items="items"></ListPicker>
55
</StackLayout>
66
`,

Diff for: app/elements/components/ListView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
template: `
33
<ListView for="item in items">
44
<v-template>
5-
<Label :text="item.text"/>
5+
<Label :text="item.text" class="m-15"/>
66
</v-template>
77
</ListView>
88
`,

Diff for: app/elements/components/Progress.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
template: `
33
<StackLayout>
4-
<Progress value="50"/>
4+
<Progress value="20" maxValue="50"/>
55
</StackLayout>
66
`
77
};

Diff for: app/elements/components/SegmentedBar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<SegmentedBar>
55
<SegmentedBarItem title="First" />
66
<SegmentedBarItem title="Second" />

Diff for: app/elements/components/Slider.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
4-
<Slider value="50"/>
3+
<StackLayout class="m-20">
4+
<Slider value="60"/>
55
</StackLayout>
66
`
77
};

Diff for: app/elements/components/Switch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
4-
<Switch />
3+
<StackLayout class="m-20">
4+
<Switch checked="true"/>
55
</StackLayout>
66
`
77
};

Diff for: app/elements/components/TextField.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<TextField text="TextField" />
55
</StackLayout>
66
`

Diff for: app/elements/components/TextView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<TextView text="TextView\nHas\nMultiple\nLines" />
55
</StackLayout>
66
`

Diff for: app/elements/components/TimePicker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
template: `
3-
<StackLayout>
3+
<StackLayout class="m-20">
44
<TimePicker />
55
</StackLayout>
66
`

Diff for: app/elements/dialogs/Action.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const dialogs = require('ui/dialogs');
1+
const dialogs = require('tns-core-modules/ui/dialogs');
22

33
module.exports = {
4-
mounted() {
5-
dialogs.action('Choose one!', 'Or cancel...', ['cheese', 'wine'])
6-
}
4+
mounted() {
5+
setTimeout(() => dialogs.action('Choose one!', 'Or cancel...', ['cheese', 'wine']))
6+
}
77
};

Diff for: app/elements/dialogs/Alert.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const dialogs = require('ui/dialogs');
1+
const dialogs = require('tns-core-modules/ui/dialogs');
22

33
module.exports = {
4-
mounted() {
5-
dialogs.alert('Hello!')
6-
}
4+
mounted() {
5+
setTimeout(() => dialogs.alert('Hello!'))
6+
}
77
};

Diff for: app/elements/dialogs/Confirm.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const dialogs = require('ui/dialogs');
1+
const dialogs = require('tns-core-modules/ui/dialogs');
22

33
module.exports = {
4-
mounted() {
5-
dialogs.confirm('Are you ready?')
6-
}
4+
mounted() {
5+
setTimeout(() => dialogs.confirm('Are you ready?'))
6+
}
77
};

Diff for: app/elements/dialogs/Login.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const dialogs = require('ui/dialogs');
1+
const dialogs = require('tns-core-modules/ui/dialogs');
22

33
module.exports = {
4-
mounted() {
5-
dialogs.login('Please log in', 'Username', 'Password')
6-
}
4+
mounted() {
5+
setTimeout(() => dialogs.login('Please log in', 'Username', 'Password'))
6+
}
77
};

Diff for: app/elements/dialogs/Prompt.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const dialogs = require('ui/dialogs');
1+
const dialogs = require('tns-core-modules/ui/dialogs');
22

33
module.exports = {
4-
mounted() {
5-
dialogs.prompt('How are you?', 'Amazing!')
6-
}
4+
mounted() {
5+
setTimeout(() => dialogs.prompt('How are you?', 'Amazing!'))
6+
}
77
};

Diff for: appium.capabilities.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"android23": {
3-
"browserName": "",
43
"platformName": "Android",
54
"platformVersion": "6.0",
65
"deviceName": "Android Emulator",
76
"noReset": false,
8-
"app": ""
7+
"appPackage": "org.nativescript.nativescriptvueuitests",
8+
"appActivity": "com.tns.NativeScriptActivity"
99
},
1010
"ios-simulator103iPhone6": {
11-
"browserName": "",
1211
"platformName": "iOS",
1312
"platformVersion": "10.3",
14-
"deviceName": "iPhone 6 Simulator",
13+
"deviceName": "iPhone Simulator",
14+
"bundleId": "org.nativescript.nativescriptvueuitests",
1515
"app": ""
1616
}
1717
}

0 commit comments

Comments
 (0)