@@ -12,36 +12,42 @@ import XCTest
12
12
class NAOUITests : XCTestCase {
13
13
14
14
/// Testing simple Onboarding UI
15
- func test1Onboarding( ) throws {
16
- let useCase = " eyJub3RpZmljYXRpb24iOnsidG9waWNJRCI6InVudHJhY2tlZCIsIm1haW5CdXR0b24iOnsibGFiZWwiOiJPSyIsImNhbGxUb0FjdGlvblR5cGUiOiJub25lIiwiY2FsbFRvQWN0aW9uUGF5bG9hZCI6IiJ9LCJub3RpZmljYXRpb25JRCI6InVudHJhY2tlZCIsInJldGFpblZhbHVlcyI6ZmFsc2UsImFjY2Vzc29yeVZpZXdzIjpbXSwicGF5bG9hZCI6eyJwYWdlcyI6W3siYm9keSI6IkZpcnN0IHBhZ2UncyBib2R5IiwidG9wSWNvbiI6InNxdWFyZS5hbmQuYXJyb3cudXAiLCJ0aXRsZSI6IkZpcnN0IHBhZ2UncyB0aXRsZSIsInN1YnRpdGxlIjoiRmlyc3QgcGFnZSdzIHN1YnRpdGxlIiwiaW5mb1NlY3Rpb24iOnsiZmllbGRzIjpbeyJpZCI6IlNvbWUgRGVzY3JpcHRpb24gU29tZSIsImxhYmVsIjoiU29tZSBEZXNjcmlwdGlvbiBTb21lIn0seyJpZCI6IlNvbWUgRGVzY3JpcHRpb24gU29tZSIsImxhYmVsIjoiU29tZSBEZXNjcmlwdGlvbiBTb21lIn0seyJpZCI6IlNvbWUgRGVzY3JpcHRpb24gU29tZSIsImxhYmVsIjoiU29tZSBEZXNjcmlwdGlvbiBTb21lIn1dfX0seyJzdWJ0aXRsZSI6IlNlY29uZCBwYWdlJ3Mgc3VidGl0bGUiLCJzaW5nbGVDaGFuZ2UiOnRydWUsInByaW1hcnlCdXR0b25MYWJlbCI6IlNvbWUiLCJ0aXRsZSI6IlNlY29uZCBwYWdlJ3MgdGl0bGUiLCJ0ZXJ0aWFyeUJ1dHRvbiI6eyJsYWJlbCI6IlRlcnRpYXJ5IiwiY2FsbFRvQWN0aW9uVHlwZSI6ImxpbmsiLCJjYWx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: allowlist-secret
17
- let app = XCUIApplication ( )
18
- app. launchArguments = [ useCase]
19
- app. launch ( )
20
- XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
21
- XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
22
- XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
23
- XCTAssert ( app. buttons [ " main_button " ] . exists)
24
- XCTAssert ( !app. buttons [ " secondary_button " ] . exists)
25
- XCTAssert ( app. buttons [ " help_button " ] . exists)
26
- app. buttons [ " main_button " ] . tap ( )
27
- XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
28
- XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
29
- XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
30
- XCTAssert ( app. buttons [ " main_button " ] . exists)
31
- XCTAssert ( app. buttons [ " secondary_button " ] . exists)
32
- XCTAssert ( app. buttons [ " tertiary_button " ] . exists)
33
- XCTAssert ( app. buttons [ " help_button " ] . exists)
34
- app. buttons [ " main_button " ] . tap ( )
35
- XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
36
- XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
37
- XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
38
- XCTAssert ( app. buttons [ " main_button " ] . exists)
39
- XCTAssert ( !app. buttons [ " secondary_button " ] . exists)
40
- app. buttons [ " main_button " ] . tap ( )
41
- XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
42
- XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
43
- XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
44
- XCTAssert ( app. buttons [ " main_button " ] . exists)
45
- XCTAssert ( !app. buttons [ " secondary_button " ] . exists)
15
+ func testA1Onboarding( ) throws {
16
+ let useCase = """
17
+ { " notification " :{ " retainValues " :false, " isMovable " :true, " type " : " onboarding " , " mainButton " :{ " label " : " OK " , " callToActionType " : " none " , " callToActionPayload " : " " }, " barTitle " : " IBM Notifier " , " alwaysOnTop " :false, " showSuppressionButton " :false, " hideTitleBarButtons " :false, " accessoryViews " :[], " payload " :{ " pages " :[{ " infoSection " :{ " fields " :[{ " id " : " BE8ACDC6-1159-421E-8ECA-F84B6B6785ED " , " label " : " Some Description Some " },{ " id " : " 4C045585-72C2-428B-B574-F55CF86E5DCA " , " label " : " Some Description Some " },{ " id " : " EF546A45-64CA-473D-8BEA-4BF18C3D624F " , " label " : " Some Description Some " }]}, " topIcon " : " square.and.arrow.up " , " subtitle " : " First page's subtitle " , " title " : " First page's title " , " body " : " First page's body " },{ " singleChange " :true, " infoSection " :{ " fields " :[{ " label " : " First label only " , " id " : " 031F8516-F122-4A7D-A53C-4F41C9A6C86A " },{ " id " : " 9A2DE192-E512-484E-B42B-2215C84A0B97 " , " label " : " Second label only " },{ " label " : " Third label only " , " id " : " B9F441F5-E55D-4C71-B0BC-53347A4CE6A4 " }]}, " tertiaryButton " :{ " callToActionPayload " : " https: \\ / \\ /www.google.com " , " label " : " Tertiary " , " callToActionType " : " link " }, " title " : " Second page's title " , " body " : " Second page's body " , " primaryButtonLabel " : " Some " , " subtitle " : " Second page's subtitle " },{ " title " : " Third page's title " , " body " : " Third page's body " , " singleChange " :true, " subtitle " : " Third page's subtitle " },{ " body " : " Fourth page's body " , " subtitle " : " Fourth page's subtitle " , " title " : " Fourth page's title " }], " progressBarPayload " : " automatic " }, " silent " :false, " forceLightMode " :false, " disableQuit " :false, " miniaturizable " :false, " topicID " : " untracked " , " notificationID " : " untracked " }, " settings " :{ " isVerboseModeEnabled " :false, " environment " : " prod " }}
18
+ """ // pragma: allowlist-secret
19
+ if let useCaseData = useCase. data ( using: . utf8) {
20
+ let app = XCUIApplication ( )
21
+ app. launchArguments = [ useCaseData. base64EncodedString ( ) ]
22
+ app. launch ( )
23
+ XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
24
+ XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
25
+ XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
26
+ XCTAssert ( app. buttons [ " main_button " ] . exists)
27
+ XCTAssert ( !app. buttons [ " secondary_button " ] . exists)
28
+ XCTAssert ( app. buttons [ " help_button " ] . exists)
29
+ app. buttons [ " main_button " ] . tap ( )
30
+ XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
31
+ XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
32
+ XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
33
+ XCTAssert ( app. buttons [ " main_button " ] . exists)
34
+ XCTAssert ( app. buttons [ " secondary_button " ] . exists)
35
+ XCTAssert ( app. buttons [ " tertiary_button " ] . exists)
36
+ XCTAssert ( app. buttons [ " help_button " ] . exists)
37
+ app. buttons [ " main_button " ] . tap ( )
38
+ XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
39
+ XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
40
+ XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
41
+ XCTAssert ( app. buttons [ " main_button " ] . exists)
42
+ XCTAssert ( !app. buttons [ " secondary_button " ] . exists)
43
+ app. buttons [ " main_button " ] . tap ( )
44
+ XCTAssert ( app. staticTexts [ " onboarding_title " ] . exists)
45
+ XCTAssert ( app. staticTexts [ " onboarding_subtitle " ] . exists)
46
+ XCTAssert ( app. staticTexts [ " onboarding_body " ] . exists)
47
+ XCTAssert ( app. buttons [ " main_button " ] . exists)
48
+ XCTAssert ( !app. buttons [ " secondary_button " ] . exists)
49
+ } else {
50
+ XCTAssert ( false , " Failed to encode the usecase. " )
51
+ }
46
52
}
47
53
}
0 commit comments