SPB Git

Repository Public

AllSectionsUITests.swift 5.9 KB 131 lines swift

1// =============================================================================2//                  SP BOUCHER | SOFTWARE & RESEARCH3//             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// PROJECT METADATA7// -----------------------------------------------------------------------------8// Project          : SP Wallet9// File             : UITests/AllSectionsUITests.swift10// Description      : Smoke test of the whole app on the throwaway stack: every11//                    section opens (tab bar and Explore on iPhone, sidebar on12//                    iPad), shows its own title and survives a scroll, without13//                    a crash. Run on both idioms after every merge.14// Module           : UITests15// Repository       : https://git.spboucher.ai/sp-wallet-ios16// Created          : 2026-11-1817// Last Modified    : 2026-11-1818//19// =============================================================================20// AUTHOR & PROFESSIONAL AFFILIATION21// =============================================================================22//23// Author           : Simon-Pierre Boucher24// Position         : Professor of Finance25// Institution      : Université du Québec en Outaouais (UQO)26// Department       : Département des sciences administratives27// Organization     : SP Boucher28//29// Website          : https://spboucher.ai30// Git              : https://git.spboucher.ai31//32// =============================================================================33// OFFICIAL CONTACT DIRECTORY34// =============================================================================35//36// General          : info@spboucher.ai37// Professional     : contact@spboucher.ai38// Direct           : simon@spboucher.ai39// Research         : research@spboucher.ai40// Development      : dev@spboucher.ai41// Support          : support@spboucher.ai42// Security/Admin   : admin@spboucher.ai43// Notifications    : notifications@spboucher.ai44//45// Preferred Contact: support@spboucher.ai46//47// =============================================================================48// COPYRIGHT & INTELLECTUAL PROPERTY49// =============================================================================50//51// Copyright (c) 202652// Simon-Pierre Boucher53//54// All rights reserved where applicable.55//56// This file is governed by the applicable project license,57// copyright notices, institutional agreements and relevant law.58//59// Unless expressly authorized by the applicable license or60// rights holder, copying, redistribution, sublicensing,61// publication and commercial exploitation are not permitted.62//63// Existing third-party rights and notices remain unaffected.64//65// =============================================================================66// CONFIDENTIALITY & SECURITY67// =============================================================================68//69// Classification   : Public70// Distribution     : Public repository; use is governed by the project license71// Security Contact : admin@spboucher.ai72//73// Access to this source does not independently grant permission74// to redistribute or disclose confidential materials.75//76// Do not embed credentials, private keys, access tokens,77// certificates or confidential personal information.78//79// =============================================================================80// LICENSE & MAINTENANCE81// =============================================================================82//83// License          : None specified (no license file in this repository)84// Maintainer       : Simon-Pierre Boucher85// Technical Contact: dev@spboucher.ai86//87// =============================================================================88// END OF SP BOUCHER SOURCE HEADER89// =============================================================================9091import XCTest9293final class AllSectionsUITests: XCTestCase {94    override func setUpWithError() throws {95        continueAfterFailure = true96        try XCTSkipUnless(Stack.isUp, "throwaway stack not running")97    }9899    @MainActor func testEverySectionOpensAndScrollsWithoutCrashing() {100        let app = signIn(Stack.app())101        let sections: [(id: String, title: String)] = [102            ("swap", "Échanger"), ("bridge", "Transférer entre réseaux"), ("nfts", "NFT"), ("markets", "Marchés"), ("futures", "Contrats à terme"),103            ("agents", "Agents de trading"), ("research", "Recherche"), ("alerts", "Alertes"), ("risk", "Risque et limites"), ("security", "Sécurité"),104        ]105        for s in sections {106            if isPad {107                go(app, s.id)108            } else {109                go(app, "explore")110                // back to the Explore list if a previous section is still pushed111                var guardCount = 0112                while !app.descendants(matching: .any)["explore.\(s.id)"].firstMatch.exists, app.navigationBars.buttons.firstMatch.exists, guardCount < 4 { app.navigationBars.buttons.firstMatch.tap(); guardCount += 1 }113                let row = app.descendants(matching: .any)["explore.\(s.id)"].firstMatch114                if !row.isHittable { app.swipeUp() }115                XCTAssertTrue(row.waitForExistence(timeout: 8), "Explore row \(s.id)")116                row.tap()117            }118            XCTAssertTrue(app.wait(for: .runningForeground, timeout: 10), "the app is still running in \(s.id)")119            XCTAssertTrue(app.navigationBars[s.title].waitForExistence(timeout: 20) || app.staticTexts[s.title].waitForExistence(timeout: 2), "title of \(s.id)")120            sleep(2) // let the first server answers land121            app.swipeUp(); app.swipeDown()122            XCTAssertEqual(app.state, .runningForeground, "no crash after loading \(s.id)")123            shot("section-\(s.id)")124        }125        for base in ["home", "portfolio", "activity", "settings"] {126            go(app, base)127            XCTAssertEqual(app.state, .runningForeground)128        }129    }130}131
Files main
Menu

Theme