- 
                Notifications
    
You must be signed in to change notification settings  - Fork 83
 
SDK-15 🧪 Embedded Messaging integration tests #965
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
          
     Merged
      
      
    
  
     Merged
                    Changes from 8 commits
      Commits
    
    
            Show all changes
          
          
            12 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      0cb7211
              
                🧪 Embedded Messaging integration tests
              
              
                joaodordio 37e9392
              
                🧪 BCIT workflow for EM
              
              
                joaodordio 9c98163
              
                🚧 Silent Push Sync flow test
              
              
                joaodordio fc81d37
              
                🚧 Silent Push Sync flow test
              
              
                joaodordio 7114d2e
              
                🚧 Silent Push Sync flow test
              
              
                joaodordio 7c53e99
              
                🚧 Revert changes
              
              
                joaodordio 007967d
              
                🚧 Revert changes
              
              
                joaodordio 822de29
              
                🧪 Fix for silent push flow
              
              
                joaodordio f0632fb
              
                Potential fix for code scanning alert no. 27: Workflow does not conta…
              
              
                joaodordio 454b951
              
                🧪 Fix for silent push flow
              
              
                joaodordio a91e481
              
                Merge branch 'feature/SDK-15-BCIT-Embedded-Messages' of github.com:It…
              
              
                joaodordio 99ee30e
              
                🗑️ Removed unnecessary code
              
              
                joaodordio File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
          
            105 changes: 105 additions & 0 deletions
          
          105 
        
  .github/workflows/bcit-integration-test-embedded-messages.yml
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,105 @@ | ||
| name: BCIT Embedded Messages Integration Test | ||
| 
     | 
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, labeled] | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: 'Branch or commit to test (leave empty for current branch)' | ||
| required: false | ||
| type: string | ||
| 
     | 
||
| jobs: | ||
| embedded-messages-test: | ||
| name: BCIT Embedded Messages Integration Test | ||
| runs-on: macos-latest | ||
| timeout-minutes: 30 | ||
| env: | ||
| XCODE_VERSION: '16.4' | ||
| if: > | ||
| github.event_name == 'workflow_dispatch' || | ||
| ( | ||
| github.event_name == 'pull_request' && ( | ||
| contains(github.event.pull_request.labels.*.name, 'bcit') || | ||
| contains(github.event.pull_request.labels.*.name, 'BCIT') || | ||
| contains(github.event.pull_request.labels.*.name, 'bcit-embedded') || | ||
| contains(github.event.pull_request.labels.*.name, 'BCIT-EMBEDDED') || | ||
| contains(github.event.pull_request.labels.*.name, 'bcit-embedded-messages') || | ||
| contains(github.event.pull_request.labels.*.name, 'BCIT-EMBEDDED-MESSAGES') || | ||
| contains(github.event.pull_request.labels.*.name, 'Bcit') || | ||
| contains(github.event.pull_request.labels.*.name, 'Bcit-Embedded') || | ||
| startsWith(github.event.pull_request.head.ref, 'release/') | ||
| ) | ||
| ) | ||
| 
     | 
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.inputs.ref || github.ref }} | ||
| 
     | 
||
| - name: Setup Xcode | ||
| uses: maxim-lobanov/setup-xcode@v1 | ||
| with: | ||
| xcode-version: ${{ env.XCODE_VERSION }} | ||
| 
     | 
||
| - name: Validate Xcode Version | ||
| run: | | ||
| echo "🔍 Validating Xcode version and environment..." | ||
| echo "DEVELOPER_DIR: $DEVELOPER_DIR" | ||
| 
     | 
||
| # Check xcodebuild version | ||
| echo "🔍 Checking xcodebuild version..." | ||
| ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | awk '{print $2}') | ||
| echo "Xcode version: $ACTUAL_XCODE_VERSION" | ||
| echo "Expected version: $XCODE_VERSION" | ||
| 
     | 
||
| # Check xcodebuild path | ||
| XCODEBUILD_PATH=$(which xcodebuild) | ||
| echo "xcodebuild path: $XCODEBUILD_PATH" | ||
| 
     | 
||
| # Verify we're using the correct Xcode version | ||
| if echo "$ACTUAL_XCODE_VERSION" | grep -q "$XCODE_VERSION"; then | ||
| echo "✅ Using correct Xcode version: $ACTUAL_XCODE_VERSION" | ||
| else | ||
| echo "❌ Incorrect Xcode version!" | ||
| echo "Current: $ACTUAL_XCODE_VERSION" | ||
| echo "Expected: $XCODE_VERSION" | ||
| exit 1 | ||
| fi | ||
| 
     | 
||
| - name: Setup Local Environment | ||
| working-directory: tests/business-critical-integration | ||
| run: | | ||
| echo "🚀 Setting up local environment for integration tests..." | ||
| 
     | 
||
| # Run setup script with parameters from repository secrets | ||
| ./scripts/setup-local-environment.sh \ | ||
| "${{ secrets.BCIT_TEST_PROJECT_ID }}" \ | ||
| "${{ secrets.BCIT_ITERABLE_SERVER_KEY }}" \ | ||
| "${{ secrets.BCIT_ITERABLE_API_KEY }}" | ||
| 
     | 
||
| - name: Validate Setup | ||
| working-directory: tests/business-critical-integration | ||
| run: | | ||
| echo "🔍 Validating environment setup..." | ||
| ./scripts/validate-setup.sh | ||
| 
     | 
||
| - name: Run Embedded Messages Tests | ||
| working-directory: tests/business-critical-integration | ||
| run: | | ||
| echo "🧪 Running embedded messages integration tests..." | ||
| CI=true ./scripts/run-tests.sh embedded | ||
| 
     | 
||
| - name: Upload Test Results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: embedded-messages-test-results | ||
| path: | | ||
| tests/business-critical-integration/reports/ | ||
| tests/business-critical-integration/screenshots/ | ||
| tests/business-critical-integration/logs/ | ||
| retention-days: 7 | ||
                
       | 
||
| 
     | 
||
  
    
      This file contains hidden or 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 hidden or 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
    
  
  
    
              
        
          
          
            34 changes: 34 additions & 0 deletions
          
          34 
        
  ...ableSDK-Integration-Tester/App/EmbeddedMessage/EmbeddedMessageTestHostingController.swift
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or 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,34 @@ | ||
| // | ||
| // EmbeddedMessageTestHostingController.swift | ||
| // IterableSDK-Integration-Tester | ||
| // | ||
| 
     | 
||
| import UIKit | ||
| import SwiftUI | ||
| 
     | 
||
| final class EmbeddedMessageTestHostingController: UIViewController { | ||
                
      
                  joaodordio marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| override func viewDidLoad() { | ||
| super.viewDidLoad() | ||
| 
     | 
||
| // Create SwiftUI view | ||
| let embeddedTestView = EmbeddedMessageTestView() | ||
| let hostingController = UIHostingController(rootView: embeddedTestView) | ||
                
      
                  joaodordio marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| // Add hosting controller as child | ||
| addChild(hostingController) | ||
| view.addSubview(hostingController.view) | ||
| 
     | 
||
| // Setup constraints | ||
| hostingController.view.translatesAutoresizingMaskIntoConstraints = false | ||
| NSLayoutConstraint.activate([ | ||
| hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), | ||
| hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), | ||
| hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), | ||
| hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor) | ||
| ]) | ||
| 
     | 
||
| hostingController.didMove(toParent: self) | ||
| } | ||
| } | ||
| 
     | 
||
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.