Where terminal can wait for the result of the previous command and execute the next query based on the output of the previous result.
Take a look at this amazing blog for expect script examples - http://www.thegeekstuff.com/2010/10/expect-examples/
TiCalabash is a package which can be used to add calabash to Titanium project and execute tests. - https://github.com/appersonlabs/TiCalabash
Below shell script does the following sequence of steps
- Cleans Project
- Builds project
- Adds calabash-ios framework to code and creates -cal scheme
- compile the project with calabash framework added
#!/usr/bin/expect
#!/bin/sh
set arg1 [lindex $argv 0]
set timeout 20
spawn ti clean
expect {
"Project cleaned successfully" { puts "STEP 1 DONE" }
timeout { puts "failed to find text"; exit 1 }
}
if { $arg1 == "phone" } {
spawn ti build -p ios -b;
puts "expect.exp - Phone build"
} elseif { $arg1 == "tablet" } {
spawn ti build -p ios -Y ipad -b --retina;
puts "expect.exp - Tablet build"
}
set timeout 400
expect {
"Initiating Xcode pre-compile" { puts "STEP 2 DONE" }
timeout { puts "*** FAILED TO FIND - Initiating Xcode pre-compile "; exit 1 }
}
expect {
"Project built successfully" { puts "STEP 3 DONE" }
timeout { puts "*** FAILED TO FIND - Project built successfully "; exit 1 }
}
set timeout 20
spawn ti calabash —platform=iphone
expect "Please answer yes (y) or no (n)" { send "n\r" }
set timeout 200
expect {
"Default target:" { send "\r" }
timeout { puts "failed to find text"; exit 1 }
}
expect {
"Setup done" { puts "STEP 4 DONE" }
timeout { puts "failed to find text: Setup done"; exit 1}
}
expect {
"** BUILD SUCCEEDED **" {}
timeout { puts "failed to find text"; exit 1 }
}
ReplyDeleteI’ve been browsing on-line greater than three hours today, but I never discovered any attention-grabbing article like yours. It is beautiful worth sufficient for me. Personally, if all webmasters and bloggers made good content material as you did, the net will be a lot more helpful than ever before.
iOS Training in Chennai
Android Training in Chennai
php Training in Chennai
I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
ReplyDeleteMobile App Development Company
Great Article
ReplyDeleteAndroid Final Year Project Ideas for Computer Science
FInal Year Project Centers in Chennai
JavaScript Training in Chennai
Java Training in Chennai
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
ReplyDeleteSoftware Testing Training in Chennai
Software Testing Course in Chennai
Hadoop Training in Chennai
Python Training in Chennai
Software Testing Training in Porur
Software Testing Training in Adyar
Software Testing Training in Tnagar
Apart from its use as a structural metal it is also added in small quantities to steels and other alloys to increase hardness and strength by the formation of carbides and oxides.link
ReplyDeletePretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
ReplyDeleteDigital Marketing Course in Chennai
Digital Marketing Courses in Bangalore
digital marketing training in marathahalli
Digital Marketing Course in Coimbatore
Digital Marketing Course in Madurai
digital marketing training in btm
You have made some good points there. I looked on the net for additional information about the issue and found most individuals will go along with your views on this site.
ReplyDeleteTech geek
Thanks for sharing this with us it is a worth read.
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery