-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Xamarin tests and run them through Travis CI (#2)
* Xamarin calabash tests * Update backdoor for DFP banner tests * Update gitignore and testprebid script * Use Ruby 2.0, comment out interstitial tests, and make directory for apk
- Loading branch information
Showing
12 changed files
with
206 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Calabash Test | ||
.irb-history | ||
screenshot_* | ||
|
||
# System | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,7 @@ android: | |
jdk: | ||
- oraclejdk8 | ||
|
||
before_install: | ||
- rvm install 2.0.0 | ||
script: | ||
- ./testprebid.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "xamarin-test-cloud" | ||
gem "calabash-android" | ||
gem "calabash-cucumber" | ||
gem "rspec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (2.3.5) | ||
awesome_print (1.8.0) | ||
builder (3.2.3) | ||
calabash-android (0.9.0) | ||
awesome_print (~> 1.2) | ||
cucumber | ||
escape (~> 0.0.4) | ||
httpclient (>= 2.7.1, < 3.0) | ||
json (~> 1.8) | ||
luffa | ||
rubyzip (~> 1.1) | ||
slowhandcuke (~> 0.0.3) | ||
calabash-cucumber (0.20.5) | ||
awesome_print | ||
bundler (~> 1.3) | ||
clipboard (~> 1.0) | ||
cucumber | ||
edn (>= 1.0.6, < 2.0) | ||
geocoder (>= 1.1.8, < 2.0) | ||
httpclient (>= 2.7.1, < 3.0) | ||
json | ||
run_loop (>= 2.4.1, < 3.0) | ||
slowhandcuke (~> 0.0.3) | ||
clipboard (1.1.1) | ||
command_runner_ng (0.1.3) | ||
cucumber (2.4.0) | ||
builder (>= 2.1.2) | ||
cucumber-core (~> 1.5.0) | ||
cucumber-wire (~> 0.0.1) | ||
diff-lcs (>= 1.1.3) | ||
gherkin (~> 4.0) | ||
multi_json (>= 1.7.5, < 2.0) | ||
multi_test (>= 0.1.2) | ||
cucumber-core (1.5.0) | ||
gherkin (~> 4.0) | ||
cucumber-wire (0.0.1) | ||
diff-lcs (1.3) | ||
edn (1.1.1) | ||
escape (0.0.4) | ||
geocoder (1.4.4) | ||
gherkin (4.1.3) | ||
httpclient (2.8.3) | ||
i18n (0.8.6) | ||
json (1.8.6) | ||
luffa (2.0.0) | ||
awesome_print (~> 1.2) | ||
json (~> 1.8) | ||
retriable (>= 1.3.3.1, < 2.1) | ||
thor (~> 0.19) | ||
mime-types (2.99.3) | ||
multi_json (1.12.1) | ||
multi_test (0.1.2) | ||
retriable (2.0.2) | ||
rspec (3.6.0) | ||
rspec-core (~> 3.6.0) | ||
rspec-expectations (~> 3.6.0) | ||
rspec-mocks (~> 3.6.0) | ||
rspec-core (3.6.0) | ||
rspec-support (~> 3.6.0) | ||
rspec-expectations (3.6.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.6.0) | ||
rspec-mocks (3.6.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.6.0) | ||
rspec-support (3.6.0) | ||
rubyzip (1.2.1) | ||
run_loop (2.4.1) | ||
CFPropertyList (~> 2.2) | ||
awesome_print (~> 1.2) | ||
command_runner_ng (>= 0.0.2) | ||
httpclient (>= 2.7.1, < 3.0) | ||
i18n (>= 0.7.0, < 1.0) | ||
json (~> 1.8) | ||
thor (>= 0.18.1, < 1.0) | ||
slowhandcuke (0.0.3) | ||
cucumber | ||
thor (0.19.4) | ||
xamarin-test-cloud (2.1.2) | ||
bundler (>= 1.3.0, < 2.0) | ||
httpclient (>= 2.7.1, < 3.0) | ||
json (~> 1.8) | ||
mime-types (~> 2.99) | ||
retriable (>= 1.3.3.1, < 2.1) | ||
rubyzip (~> 1.1) | ||
thor (>= 0.18.1, < 1.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
calabash-android | ||
calabash-cucumber | ||
rspec | ||
xamarin-test-cloud | ||
|
||
BUNDLED WITH | ||
1.14.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
Feature: Base test | ||
|
||
Scenario: Load DFP Interstitial Ad | ||
Scenario: Load DFP Banner Ad | ||
Given I wait for the "MainActivity" screen to appear | ||
Then I press "DFP" | ||
Then I press "Show Interstitial Example" | ||
Then I press "loadInterstitial" | ||
Then I wait for 5 seconds | ||
Then I press "Show Banner Example" | ||
Then I press "Refresh Banner" | ||
Then I wait for 10 seconds | ||
Then I should see AppNexus creative | ||
Then I press "Interstitial close button" | ||
|
||
Scenario: Load DFP Banner Ad | ||
#Scenario: Load DFP Interstitial Ad | ||
#Given I wait for the "MainActivity" screen to appear | ||
#Then I press "DFP" | ||
#Then I press "Show Interstitial Example" | ||
#Then I press "loadInterstitial" | ||
#Then I wait for 5 seconds | ||
#Then I should see AppNexus creative | ||
#Then I press "Interstitial close button" | ||
|
||
Scenario: Load MoPub Banner Ad | ||
Given I wait for the "MainActivity" screen to appear | ||
Then I press "DFP" | ||
Then I press "MoPub" | ||
Then I press "Show Banner Example" | ||
Then I press "Refresh Banner" | ||
Then I wait for 5 seconds | ||
Then I should see AppNexus creative in PublisherAdView number 0 | ||
Then I should see AppNexus creative in PublisherAdView number 1 | ||
Then I wait for 10 seconds | ||
Then I should see AppNexus creative in HTMLBannerWebView | ||
|
||
#Scenario: Load MoPub Interstitial Ad | ||
#Given I wait for the "MainActivity" screen to appear | ||
#Then I press "MoPub" | ||
#Then I press "Show Interstitial Example" | ||
#Then I press "loadInterstitial" | ||
#Then I press "loadInterstitial" | ||
#Then I wait for 5 seconds | ||
#Then I should see AppNexus creative in MraidBridgeMraidWebView | ||
#Then I press "Interstitial close button" |
33 changes: 26 additions & 7 deletions
33
PrebidMobile/IntegrationTests/features/step_definitions/calabash_steps.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,35 @@ | ||
require 'calabash-android/calabash_steps' | ||
|
||
Then(/^I should see AppNexus creative$/) do | ||
@query_results = query("o css:'*'") | ||
unless @query_results[0]['html'].include?('mbpb.js') | ||
raise "Mbpb.js not found, prebid creative was not served" | ||
webview_class = backdoor "getDFPWebViewName" | ||
names = webview_class.split('.') | ||
len = names.length | ||
short_name = names[len-1] | ||
@query_results = query(short_name + " css:'body'") | ||
unless @query_results[1]['html'].include?('pbm.js') | ||
raise "Pbm.js not found, prebid creative was not served" | ||
end | ||
end | ||
|
||
Then(/^I should see AppNexus creative in PublisherAdView number (\d+)$/) do |arg1| | ||
@query_results = query("o index:#{arg1} css:'*'") | ||
unless @query_results[0]['html'].include?('mbpb.js') | ||
raise "Mbpb.js not found, prebid creative was not served in number #{arg1} PublisherAdView" | ||
end | ||
webview_class = backdoor "getDFPWebViewName" | ||
@query_results = query(webview_class + " index:#{arg1} css:'*'") | ||
unless @query_results[0]['html'].include?('pbm.js') | ||
raise "Pbm.js not found, prebid creative was not served in number #{arg1} PublisherAdView" | ||
end | ||
end | ||
|
||
Then(/^I should see AppNexus creative in HTMLBannerWebView$/) do | ||
@query_results = query("HTMLBannerWebView css:'body'") | ||
unless @query_results[1]['html'].include?('pbm.js') | ||
raise "Pbm.js not found, prebid creative was not served" | ||
end | ||
end | ||
|
||
Then(/^I should see AppNexus creative in MraidBridgeMraidWebView$/) do | ||
@query_results = query("MraidWebView css:'*'") | ||
unless @query_results[0]['html'].include?('pbm.js') | ||
raise "Pbm.js not found, prebid creative was not served" | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
#! /bin/bash | ||
|
||
cd PrebidMobile | ||
./gradlew clean test | ||
|
||
./gradlew clean assembleDebug | ||
mkdir -p IntegrationTests/apk && cp DemoApp/build/outputs/apk/DemoApp-debug.apk IntegrationTests/apk/DemoApp.apk | ||
|
||
cd IntegrationTests | ||
bundle install | ||
|
||
bundle exec calabash-android resign apk/DemoApp.apk | ||
bundle exec calabash-android build apk/DemoApp.apk | ||
bundle exec test-cloud submit apk/DemoApp.apk 435c130f3f6ff5256d19a790c21dd653 --devices 2ae0b5a0 --series "master" --locale "en_US" --app-name "DemoApp" --user [email protected] |