summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPNUITests/Pages/WelcomePage.swift
blob: 30e5e56612536db36ab4c083b76f30ac7882092f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
//  WelcomePage.swift
//  MullvadVPNUITests
//
//  Created by Niklas Berglund on 2024-01-30.
//  Copyright © 2025 Mullvad VPN AB. All rights reserved.
//

import Foundation
import XCTest

class WelcomePage: Page {
    @discardableResult override init(_ app: XCUIApplication) {
        super.init(app)

        self.pageElement = app.otherElements[.welcomeView]
        waitForPageToBeShown()
    }

    @discardableResult func tapAddTimeButton() -> Self {
        app.buttons[AccessibilityIdentifier.purchaseButton].tap()
        return self
    }

    @discardableResult func tapRedeemButton() -> Self {
        app.buttons[AccessibilityIdentifier.redeemVoucherButton].tap()
        return self
    }

    func getAccountNumber() -> String {
        let labelValue = app.staticTexts[AccessibilityIdentifier.welcomeAccountNumberLabel].label
        return labelValue.replacingOccurrences(of: " ", with: "")
    }
}