Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce test cases for PUC #1077

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions InternalTestApp/InternalTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
53514CEC2D08416B00A480C0 /* SampleInterstitialController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53514CDA2D08416B00A480C0 /* SampleInterstitialController.swift */; };
53514CED2D08416B00A480C0 /* SampleAdView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53514CD82D08416B00A480C0 /* SampleAdView.swift */; };
53514CEE2D08416B00A480C0 /* CustomRendererBannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53514CDE2D08416B00A480C0 /* CustomRendererBannerController.swift */; };
535ADDFB2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */; };
535ADDFC2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */; };
535ADDFE2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */; };
535ADDFF2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */; };
5397BD142936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD132936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift */; };
5397BD26293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD25293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift */; };
5397BD2A29376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */; };
Expand Down Expand Up @@ -393,6 +397,8 @@
53514CDC2D08416B00A480C0 /* SampleModalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleModalViewController.swift; sourceTree = "<group>"; };
53514CDE2D08416B00A480C0 /* CustomRendererBannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRendererBannerController.swift; sourceTree = "<group>"; };
53514CDF2D08416B00A480C0 /* CustomRendererInterstitialController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRendererInterstitialController.swift; sourceTree = "<group>"; };
535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidUniversalCreativeTestingGAMController.swift; sourceTree = "<group>"; };
535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidUniversalCreativeTestingWebViewController.swift; sourceTree = "<group>"; };
5397BD132936185400ABDA22 /* PrebidOriginalAPIDisplayBannerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIDisplayBannerController.swift; sourceTree = "<group>"; };
5397BD25293760F500ABDA22 /* PrebidOriginalAPIDisplayInterstitialController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIDisplayInterstitialController.swift; sourceTree = "<group>"; };
5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrebidOriginalAPIVideoRewardedController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -746,6 +752,8 @@
5397BD312937895700ABDA22 /* PrebidOriginalAPIVideoInstreamViewController.swift */,
539F961329DEF2670061E7A5 /* PrebidOriginalAPIVideoInterstitialController.swift */,
5397BD2929376C9700ABDA22 /* PrebidOriginalAPIVideoRewardedController.swift */,
535ADDFA2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift */,
535ADDFD2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift */,
);
path = OriginalAPI;
sourceTree = "<group>";
Expand Down Expand Up @@ -1610,6 +1618,7 @@
53ED2FF629798104007D13EE /* BaseConfigurationController.swift in Sources */,
53ED2FF729798104007D13EE /* NativeAsset+Extensions.swift in Sources */,
53ED2FF829798104007D13EE /* PrebidGAMNativeAdController.swift in Sources */,
535ADDFE2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */,
53ED2FF929798104007D13EE /* PrebidOriginalAPIVideoInstreamViewController.swift in Sources */,
53ED2FFA29798104007D13EE /* PrebidAdMobBannerViewController.swift in Sources */,
53ED2FFB29798104007D13EE /* ConfigurableViewController.swift in Sources */,
Expand Down Expand Up @@ -1639,6 +1648,7 @@
53514CE52D08416B00A480C0 /* SampleInterstitialController.swift in Sources */,
53514CE62D08416B00A480C0 /* SampleAdView.swift in Sources */,
53514CE72D08416B00A480C0 /* CustomRendererBannerController.swift in Sources */,
535ADDFC2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */,
53ED300E29798104007D13EE /* NativeAdViewBoxProtocol.swift in Sources */,
53ED300F29798104007D13EE /* FormViewController+RowBuildHelpers.swift in Sources */,
53ED301029798104007D13EE /* PrebidGAMBannerController.swift in Sources */,
Expand Down Expand Up @@ -1710,6 +1720,7 @@
5B209B4A21075E0A00C0F5CE /* BaseConfigurationController.swift in Sources */,
92C4E60B27A2F5D900738370 /* NativeAsset+Extensions.swift in Sources */,
92102C6127B0F2FE003F12B2 /* PrebidGAMNativeAdController.swift in Sources */,
535ADDFF2D19A62C00DB888F /* PrebidUniversalCreativeTestingWebViewController.swift in Sources */,
5397BD322937895700ABDA22 /* PrebidOriginalAPIVideoInstreamViewController.swift in Sources */,
92E92502276B299F002B57F3 /* PrebidAdMobBannerViewController.swift in Sources */,
5BCCA3D62136D2E800DA3B5A /* ConfigurableViewController.swift in Sources */,
Expand Down Expand Up @@ -1739,6 +1750,7 @@
53514CEC2D08416B00A480C0 /* SampleInterstitialController.swift in Sources */,
53514CED2D08416B00A480C0 /* SampleAdView.swift in Sources */,
53514CEE2D08416B00A480C0 /* CustomRendererBannerController.swift in Sources */,
535ADDFB2D19731000DB888F /* PrebidUniversalCreativeTestingGAMController.swift in Sources */,
92F9A5D127A15BD1007B0B17 /* NativeAdViewBoxProtocol.swift in Sources */,
341CC3142562C9D000186F29 /* FormViewController+RowBuildHelpers.swift in Sources */,
3493021C2473F408004A6086 /* PrebidGAMBannerController.swift in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions InternalTestApp/PrebidMobileDemoRendering/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,30 @@ struct TestCaseManager {
setupCustomParams(for: interstitialController.prebidConfigId)
}),


// MARK: ---- Prebid Universal Creative Tests

TestCase(title: "Prebid Universal Creative (GAM)",
tags: [.banner, .originalAPI, .server],
exampleVCStoryboardID: "AdapterViewController",
configurationClosure: { vc in
guard let adapterVC = vc as? AdapterViewController else {
return
}

let bannerController = PrebidUniversalCreativeTestingGAMController(rootController: adapterVC)
bannerController.adSize = CGSize(width: 300, height: 250)
bannerController.gamAdUnitID = "/21808260008/puc-testing-secure-banner-300x250"

adapterVC.setup(adapter: bannerController)
setupCustomParams(for: bannerController.prebidConfigId)
}),

TestCase(title: "Prebid Universal Creative (WebView)",
tags: [.banner, .originalAPI, .server],
exampleVCStoryboardID: "PrebidUniversalCreativeTestingWebViewController",
configurationClosure: { vc in }),

// MARK: ---- Native (Original API)

TestCase(title: "Native Banner (GAM Original) [OK, PUC]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6M7-3O-9SJ">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6M7-3O-9SJ">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -376,6 +376,68 @@
</objects>
<point key="canvasLocation" x="-180" y="1926"/>
</scene>
<!--Prebid Universal Creative Testing Web View Controller-->
<scene sceneID="1bh-3o-3hr">
<objects>
<viewController storyboardIdentifier="PrebidUniversalCreativeTestingWebViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="6C0-Uv-o8K" customClass="PrebidUniversalCreativeTestingWebViewController" customModule="InternalTestApp" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="f5y-Bu-uF0">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="gEx-oc-f1D">
<rect key="frame" x="94" y="63" width="187.5" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WuP-WD-y5P">
<rect key="frame" x="136.5" y="107" width="102" height="35"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Open URL"/>
<connections>
<action selector="onOpenURLPressed:" destination="6C0-Uv-o8K" eventType="touchUpInside" id="APu-tj-xWt"/>
</connections>
</button>
<wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M13-Dr-swd">
<rect key="frame" x="37.5" y="152" width="300" height="250"/>
<constraints>
<constraint firstAttribute="width" constant="300" id="Yx3-0i-S0n"/>
<constraint firstAttribute="height" constant="250" id="jn4-oq-cg6"/>
</constraints>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Scheme, IP, port(f.e. http://192.168.0.108:9876)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zgi-DY-0kd">
<rect key="frame" x="20.5" y="35" width="334" height="18"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="6xz-81-es3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="WuP-WD-y5P" firstAttribute="centerX" secondItem="f5y-Bu-uF0" secondAttribute="centerX" id="3MP-so-oYh"/>
<constraint firstItem="Zgi-DY-0kd" firstAttribute="centerX" secondItem="f5y-Bu-uF0" secondAttribute="centerX" id="3yK-uW-tei"/>
<constraint firstItem="Zgi-DY-0kd" firstAttribute="top" secondItem="6xz-81-es3" secondAttribute="top" constant="15" id="MiX-3g-VhY"/>
<constraint firstItem="gEx-oc-f1D" firstAttribute="centerX" secondItem="f5y-Bu-uF0" secondAttribute="centerX" id="R0m-Oy-yjw"/>
<constraint firstItem="M13-Dr-swd" firstAttribute="top" secondItem="WuP-WD-y5P" secondAttribute="bottom" constant="10" id="U8i-28-Imo"/>
<constraint firstItem="gEx-oc-f1D" firstAttribute="top" secondItem="Zgi-DY-0kd" secondAttribute="bottom" constant="10" id="ZUA-zC-sqp"/>
<constraint firstItem="M13-Dr-swd" firstAttribute="centerX" secondItem="f5y-Bu-uF0" secondAttribute="centerX" id="c5e-jc-sxK"/>
<constraint firstItem="gEx-oc-f1D" firstAttribute="width" secondItem="f5y-Bu-uF0" secondAttribute="width" multiplier="0.5" id="cwk-oO-d6t"/>
<constraint firstItem="WuP-WD-y5P" firstAttribute="top" secondItem="gEx-oc-f1D" secondAttribute="bottom" constant="10" id="eo7-c4-dHB"/>
</constraints>
</view>
<connections>
<outlet property="textField" destination="gEx-oc-f1D" id="DEy-7S-P3k"/>
<outlet property="webView" destination="M13-Dr-swd" id="bbx-Nr-eXo"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="bHa-QV-5Dm" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-186" y="2603"/>
</scene>
<!--Prebid Presentation View Controller-->
<scene sceneID="tdw-Us-BGz">
<objects>
Expand Down
Loading