Skip to content

Commit bbe7b39

Browse files
committed
finished first not home test case, updated todo.tx, improved log in step, updated readme
1 parent e13f794 commit bbe7b39

9 files changed

+96
-34
lines changed

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ Execute the following:
1313

1414
Should start another device. You can change the type of the original device back to have two of the same devices running simultaneously.
1515

16+
Appium server with default args:
17+
appium -p 4723 -cp 4723 -bp 2734 --selendroid-port 8080 --chromedriver-port 9515 --webkit-debug-proxy-port 27753 --session-override --log-level 'debug' --debug-log-spacing --log '/Users/mliedtka/appium_logs1/appium.log' --address "localhost" --command-timeout '7200' --launch-timeout '90000' --default-capabilities '{"app":"/Users/mliedtka/Library/Developer/Xcode/DerivedData/i360_Canvass-byzgucvkbseaivggszvazdzohhjo/Build/Products/Debug-iphonesimulator/i360 Canvass.app", "showIOSLog":"false", "nativeInstrumentsLib":"true", "platformName":"iOS", "platformVersion":"10.2", "automationName":"XCUITest", "deviceName":"iPad Air 2", "bundleId":"com.i360.i360Walk", "fullReset":"false", "noReset":"true", "autoAcceptAlerts": true}'
18+
19+
Appium server for inspector with custom ports (hoping to run concurrently with tests one day):
20+
appium -p 4725 -cp 4725 -bp 4726 --selendroid-port 8081 --chromedriver-port 9516 --webkit-debug-proxy-port 27754 --session-override --log-level 'debug' --debug-log-spacing --log '/Users/mliedtka/appium_logs2/appium.log' --address "localhost" --command-timeout '7200' --launch-timeout '90000' --default-capabilities '{"app":"/Users/mliedtka/Library/Developer/Xcode/DerivedData/i360_Canvass-byzgucvkbseaivggszvazdzohhjo/Build/Products/Debug-iphonesimulator/i360 Canvass.app", "showIOSLog":"false", "nativeInstrumentsLib":"true", "platformName":"iOS", "platformVersion":"10.2", "automationName":"XCUITest", "deviceName":"iPad Air", "bundleId":"com.i360.i360Walk", "fullReset":"false", "noReset":"true", "autoAcceptAlerts": true}'

Diff for: ToDo.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
// To do:
22

3-
// make fullLogin method take parameters for username and password
3+
// write a function that finds the first house in a list which is not started. Use in the icon_colors.js test case.
44

5-
// create a credentials file? Test creds shouldn't be sensitive. Place sensitive credentials in file and add to .gitignore.
5+
// determine a way to return element IDs of all people in a house, step through the array, and act accordingly depending on the test case - proceed? Or exit and try another house?
6+
7+
// need to determine how many primary targets there are in the selected household
8+
9+
// make fullLogin method take parameters for username and password - i.e. so you can log in with whoever you want in the test.
610

711
// complete a walkbook and inspect the close/leave open dialogue. Compare Android and iOS & add to elements file.
812

@@ -11,8 +15,9 @@
1115

1216

1317

14-
1518
Later:
19+
// create a credentials file? Test creds shouldn't be sensitive. Place sensitive credentials in file and add to .gitignore.
20+
1621
// if possible figure out a way to access an element by part of its id - see todo comments in code. Figure out promise-utils file.
1722

1823
// elementOrNull command - utilize in fullLogin method:

Diff for: helpers/commons.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ Commons.prototype.fullLogin = function(){
193193
return config.driver
194194
.sleep(2000)
195195
.then(function () {
196-
if (typeof config.driver.elementByClassNameIfExists('XCUIElementTypeAlert')[0] != 'undefined') {
196+
if (config.driver.elementByClassNameIfExists('XCUIElementTypeAlert')) {
197197
config.driver.acceptAlert()
198198
} else {
199199
return config.driver
200200
}
201201
})
202-
.elementById('etLoginUsername') // UserName
202+
.waitForElementById('etLoginUsername') // UserName
203203
.clear()
204204
.sendKeys('test_1654wseward')
205205
.hideKeyboard()

Diff for: helpers/elements.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ let apps = require('./apps.js');
6868
'map' : 'walkbook_map', //in iOS effectively, label "dismiss popup"
6969
'mapSettings' : 'i ipad', // in Android this is in the mnOverflow - text = "Icon Legend"
7070
'list' : 'walkbook_list', // in iOS effectively, label 'menuButton', if on map view
71-
'walkbook1' : "//*[contains(@content-desc,'cellWalkbook_0')]|//*[contains(@label,'cellWalkbook_0')]",
72-
'walkbook2' : '//*[contains(@content-desc,\'cellWalkbook_1\')]|//*[contains(@label,\'cellWalkbook_1\')]',
73-
'walkbook3' : '//*[contains(@content-desc,\'cellWalkbook_2\')]|//*[contains(@label,\'cellWalkbook_2\')]',
74-
'walkbook4' : '//*[contains(@content-desc,\'cellWalkbook_3\')]|//*[contains(@label,\'cellWalkbook_3\')]',
75-
'walkbook5' : '//*[contains(@content-desc,\'cellWalkbook_4\')]|//*[contains(@label,\'cellWalkbook_4\')]',
76-
'walkbook6' : '//*[contains(@content-desc,\'cellWalkbook_5\')]|//*[contains(@label,\'cellWalkbook_5\')]',
77-
'walkbook7' : '//*[contains(@content-desc,\'cellWalkbook_6\')]|//*[contains(@label,\'cellWalkbook_6\')]',
78-
'walkbook8' : '//*[contains(@content-desc,\'cellWalkbook_7\')]|//*[contains(@label,\'cellWalkbook_7\')]',
71+
'walkbook1' : '//*[contains(@label,\'cellWalkbook_0\')]',
72+
'walkbook2' : '//*[contains(@label,\'cellWalkbook_1\')]',
73+
'walkbook3' : '//*[contains(@label,\'cellWalkbook_2\')]',
74+
'walkbook4' : '//*[contains(@label,\'cellWalkbook_3\')]',
75+
'walkbook5' : '//*[contains(@label,\'cellWalkbook_4\')]',
76+
'walkbook6' : '//*[contains(@label,\'cellWalkbook_5\')]',
77+
'walkbook7' : '//*[contains(@label,\'cellWalkbook_6\')]',
78+
'walkbook8' : '//*[contains(@label,\'cellWalkbook_7\')]',
7979
'popoverOpenBook' : 'More Info'
8080
}
8181

8282

8383
//test - especially books off page
8484
exports.walkbook = {
85-
'houseHold1' : "//*[contains(@content-desc,'cellHouse_0')]|//*[contains(@label,'cellHouse_0')]",
85+
'houseHold1' : "//*[contains(@label,'cellHouse_0')]",
8686
'houseHold2' : 'cellHouse_1',
8787
'houseHold3' : 'cellHouse_2',
8888
'houseHold4' : 'cellHouse_3',

Diff for: loadTimeLogs/loadTimesLog_4_12_2017_20_19_37.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Log In: 0 hours, 0 minutes, 1.464 seconds.
2+
Load Survey List: 0 hours, 0 minutes, 0.637 seconds.
3+
Load Survey: 0 hours, 0 minutes, 3.891 seconds.
4+
Home Page to Household: 0 hours, 1 minutes, 9.672 seconds.

Diff for: loadTimeLogs/loadTimesLog_4_7_2017_15_56_13.txt

-1
This file was deleted.

Diff for: run.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,23 @@ for (var i in args ) {
2626
switch ( arg ) {
2727
case '-sim' : {
2828
appium = childProcess.spawn( 'appium', [
29+
'-p','4725', //non-default args
30+
'-cp','4725', //non-default args
31+
'-bp','4726', //non-default args
32+
'--selendroid-port', '8081', //non-default args
33+
'--chromedriver-port', '9516', //non-default args
34+
'--webkit-debug-proxy-port', '27754', //non-default args
2935
'--session-override',
3036
'--log-level', 'debug',
3137
'--debug-log-spacing',
32-
'--log', '/Users/mliedtka/appium_logs/appium.log',
38+
'--log', '/Users/mliedtka/appium_logs2/appium.log',
3339
'--address', "localhost",
3440
'--command-timeout', '7200',
3541
'--launch-timeout', '90000',
3642
'--default-capabilities', '{ \
3743
"app":"/Users/mliedtka/Library/Developer/Xcode/DerivedData/i360_Canvass-byzgucvkbseaivggszvazdzohhjo/Build/Products/Debug-iphonesimulator/i360 Canvass.app", \
3844
"showIOSLog":"false", \
45+
"autoAcceptAlerts":"true", \
3946
"nativeInstrumentsLib":"true", \
4047
"platformName":"iOS", \
4148
"platformVersion":"10.2", \
Binary file not shown.

Diff for: tests/icon_colors.js

+60-18
Original file line numberDiff line numberDiff line change
@@ -35,53 +35,95 @@ module.exports = function () {
3535
.fullLogin()
3636
});
3737

38-
it('Should turn the house blue', function () {
39-
console.log('Should turn the house blue'.green.bold.underline);
38+
it('Should turn the house blue: one primary target not home', function () {
39+
console.log('Should turn the house blue: one primary target not home'.green.bold.underline);
4040

41-
// Not home household
42-
// Not home 1+ primary targets
43-
// use survey DO NOT USE: Mobile Automation Survey 1.0
41+
// Not home 1 primary target turns house blue
42+
// Survey: DO NOT USE: Mobile Automation Survey 1.0
4443

44+
//to do: modify this to select the first house that is "not started", and use that.
45+
//once house is chosen, need to store household element ID for validation of icon later.
4546
return driver
4647
.startTime('Home Page to Household')
4748
.elementById(elements.homeScreen.walkbooks)
4849
.click()
4950
.startTime('Load Survey List')
50-
.waitForElementById(elements.surveys.survey1, 10000).should.eventually.exist
51+
.waitForElementById(elements.surveys.survey1, 10000)
5152
.endTotalAndLogTime('Load Survey List')
5253
.elementById('DO NOT USE: Mobile Automation Survey 1.0')
5354
.click()
54-
.waitForElementById(elements.survey.start, 10000).should.eventually.exist
55+
.waitForElementById(elements.survey.start, 10000)
56+
.elementById(elements.survey.start)
5557
.click()
5658
.startTime('Load Survey')
57-
.waitForElementById('Select Walkbook', 10000) // trying this
59+
.waitForElementById('Select Walkbook', 10000)
5860
.endTotalAndLogTime('Load Survey')
5961
.elementByXPath(elements.survey.walkbook1)
6062
.click()
6163
.waitForElementById(elements.survey.popoverOpenBook, 10000)
6264
.elementById(elements.survey.popoverOpenBook)
6365
.click()
6466
.startTime('Load Walkbook')
65-
.waitForElementByXPath(elements.walkbook.houseHold1)
66-
// .elementById(elements.walkbook.household1)
67+
.waitForElementByXPath(elements.walkbook.houseHold1, 10000)
6768
.click()
68-
.waitForElementById(elements.walkbook.popoverOpenHouse, 10000).should.eventually.exist
69+
.waitForElementById(elements.walkbook.popoverOpenHouse, 10000)
6970
.elementById(elements.walkbook.popoverOpenHouse)
7071
.click()
71-
.waitForElementById(elements.houseHold.notHome, 10000).should.eventually.exist
72+
.waitForElementById(elements.houseHold.notHome, 10000)
7273
.endTotalAndLogTime('Home Page to Household')
7374
.elementById(elements.houseHold.primTarget1)
7475
.click()
75-
.waitForElementById(elements.target.takeSurvey).should.eventually.exist
76-
// ON THE HOUSEHOLD SCREEN - NOW FIGURE OUT HOW TO DO TEST CASE.
77-
78-
79-
80-
76+
.waitForElementById(elements.target.takeSurvey, 10000)
77+
.elementById(elements.target.notHome)
78+
.click()
79+
.waitForElementById(elements.houseHold.finished)
80+
.click()
81+
.waitForElementById('cellHouse_0_sfh_attempted')
8182
});
8283

8384

8485

86+
// it('Should turn the house blue: xxxxxxxxxxx', function () {
87+
// console.log('Should turn the house blue: xxxxxxxxxxx'.green.bold.underline);
88+
//
89+
// // xxxxxxxxx turns house blue
90+
// // Survey: DO NOT USE: Mobile Automation Survey 1.0
91+
//
92+
// return driver
93+
//
94+
//
95+
// });
96+
// it('Should turn the house blue: xxxxxxxxxxx', function () {
97+
// console.log('Should turn the house blue: xxxxxxxxxxx'.green.bold.underline);
98+
//
99+
// // xxxxxxxxx turns house blue
100+
// // Survey: DO NOT USE: Mobile Automation Survey 1.0
101+
//
102+
// return driver
103+
//
104+
//
105+
// });
106+
// it('Should turn the house blue: xxxxxxxxxxx', function () {
107+
// console.log('Should turn the house blue: xxxxxxxxxxx'.green.bold.underline);
108+
//
109+
// // xxxxxxxxx turns house blue
110+
// // Survey: DO NOT USE: Mobile Automation Survey 1.0
111+
//
112+
// return driver
113+
//
114+
//
115+
// });
116+
// it('Should turn the house blue: xxxxxxxxxxx', function () {
117+
// console.log('Should turn the house blue: xxxxxxxxxxx'.green.bold.underline);
118+
//
119+
// // xxxxxxxxx turns house blue
120+
// // Survey: DO NOT USE: Mobile Automation Survey 1.0
121+
//
122+
// return driver
123+
//
124+
//
125+
// });
126+
85127

86128
});
87129
};

0 commit comments

Comments
 (0)