Skip to content

Commit 95b02a4

Browse files
committed
structure to generate SideDrawer screenshots
1 parent c4c461d commit 95b02a4

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

app/app.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ const Vue = require('nativescript-vue');
22

33
new Vue({
44
data: {
5-
elements: [
6-
{
5+
elements: [{
76
name: 'ActivityIndicator',
87
component: () => require('./elements/components/ActivityIndicator')
98
},
@@ -99,6 +98,10 @@ new Vue({
9998
name: 'PromptDialog',
10099
component: () => require('./elements/dialogs/Prompt')
101100
},
101+
{
102+
name: 'SideDrawer',
103+
component: () => require('./elements/components/SideDrawer')
104+
}
102105
]
103106
},
104107

app/elements/components/SideDrawer.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
template: `
3+
<RadSideDrawer ref="drawer">
4+
<StackLayout ~drawerContent>
5+
<StackLayout height="56" style="text-align: center; vertical-align: center;">
6+
<label text="Navigation Menu" />
7+
</StackLayout>
8+
<StackLayout>
9+
<button text="Friends" /> <button text="Posts"/>
10+
</StackLayout>
11+
</StackLayout>
12+
<StackLayout ~mainContent>
13+
<label text="This is the main content for the current Page!" textWrap="true" fontSize="13" padding="10" />
14+
</StackLayout>
15+
</RadSideDrawer>
16+
`,
17+
mounted() {
18+
this.$refs.drawer.showDrawer()
19+
}
20+
}

generate-screenshots.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const components = [
2727
'ConfirmDialog',
2828
'LoginDialog',
2929
'PromptDialog',
30+
'SideDrawer',
3031
];
3132

3233
const makeDir = (path) => {
@@ -40,12 +41,12 @@ const makeDir = (path) => {
4041
makeDir(`screenshots/${argv.runType}`);
4142

4243
AppiumDriver.createAppiumDriver(4723, {
43-
isSauceLab: argv.sauceLab || false,
44-
runType: argv.runType,
45-
appPath: argv.appPath, //'nativescriptvueuitests-debug.apk',
46-
appiumCaps: require('./appium.capabilities.json')[argv.runType],
47-
verbose: argv.verbose || false,
48-
})
44+
isSauceLab: argv.sauceLab || false,
45+
runType: argv.runType,
46+
appPath: argv.appPath, //'nativescriptvueuitests-debug.apk',
47+
appiumCaps: require('./appium.capabilities.json')[argv.runType],
48+
verbose: argv.verbose || false,
49+
})
4950
.then(driver => run(driver))
5051
.then(() => console.log('Buh-Bye...'))
5152
.catch((err) => console.log(err));

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"appium": "^1.7.1",
1717
"nativescript-dev-appium": "^3.1.0-2017-10-6-1",
18+
"nativescript-ui-sidedrawer": "^5.1.0",
1819
"nativescript-vue": "^1.0.0",
1920
"tns-core-modules": "~3.4.0",
2021
"yargs": "^9.0.1"

0 commit comments

Comments
 (0)