-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows-simple.js
98 lines (77 loc) · 3.03 KB
/
windows-simple.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
"use strict";
require("./helpers/setup");
var wd = require("wd"),
_ = require('underscore'),
serverConfigs = require('./helpers/appium-servers');
describe("windows simple", function () {
this.timeout(300000);
var driver;
var allPassed = true;
before(function () {
var serverConfig = process.env.npm_package_config_sauce ?
serverConfigs.sauce : serverConfigs.local;
driver = wd.promiseChainRemote(serverConfig);
require("./helpers/logging").configure(driver);
var desired = _.clone(require("./helpers/caps").windows02);
//desired.app = require("./helpers/apps").windowsTestApp;
console.log(desired);
if (process.env.npm_package_config_sauce) {
desired.name = 'windows - simple';
desired.tags = ['sample'];
}
//
return driver
.init(desired)
.setImplicitWaitTimeout(3000);// wait so the application is opened
});
after(function () {
return driver
.quit();
});
afterEach(function () {
allPassed = allPassed && this.currentTest.state === 'passed';
});
//when bundled installer is used
it("intall the application", function () {
return driver.element('name', 'Continue').doubleclick();
});
it("open the application", function () {
return driver.element('name', 'Penneo')
.doubleclick();
});
//try to login in the penneo application
//send keys to user name and password and then click log in
//access by name: username, password, Log in to Penneo
it("login into the Penneo application", function () {
return driver
.sleep(6000)
.element('name', 'Enter your username') //try to identify by classname/id
//.clear()
.click()
.sendKeys('tc@penneo.com')
.sleep(500)
.element('name', 'Password')
//.clearElement('Enter your username')
.click()
.sendKeys('test')//change the password to a valid one to see the test working
.element('name', 'Log in to Penneo')
.click()
.element('name', 'Add Documents')//this does not work properly
.isEnabled();
// this fully works, might have problems because the machine is slow :)
});
//this file only tests the login
/*//prerequisites: you have to be logged in and the app running in the background
it("print a test document using the penneo printer", function () {
return driver
.elementByName("Edit").click()
.elementByXPath("//MenuItem[starts-with(@Name, \"Select All\")]").click()
.elementByName("Edit").click()
.elementByXPath("//MenuItem[starts-with(@Name, \"Del\")]").click()
.sleep(3000)
.elementByName("Text Editor")
.sendKeys('Hello from Appium with JS')
.elementByName("Text Editor").text()
.should.become('Penneo printer test document');
});*/
});