Skip to content

Instantly share code, notes, and snippets.

Manoj Pahuja mpahuja

  • Lyft
  • San Francisco, CA
Block or report user

Report or block mpahuja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Timeouts.swift
import Foundation
/// Common semantic timeout values for UI interactions
public enum UITestTimeout {
/// Time interval for alerts to appear
case alertAppear
/// Time interval for elements to appear
case elementAppear
/// Five second time interval
case fiveSeconds
View UI- LoginTest.swift
import XCTest
final class UserTests: BaseTestCase, AuthenticationUITestable {
func test_accountRecoveryStart () {
XCTContext.runActivity(named: "Start account recovery") { _ in
self.startAccountRecovery(withEmail: UserInfo.LoginSmoke.emailAddress,
serverEnvironment: UserInfo.LoginSmoke.serverEnvironment)
}
}
}
View Common - UserInfo.swift
/// Common user-specific information
public struct UserInfo {
/// Keys and values used for login smoke runs
public struct Login {
/// Email address used to test
public static let emailAddress = "abc@abc.com"
}
public struct AnotherOne {
public static let password = "password"
View Common -
/// Common user-specific information
public struct UserInfo {
/// Keys and values used for login smoke runs
public struct Login {
/// Email address used to test
public static let emailAddress = "abc@abc.com"
}
public struct AnotherOne {
public static let password = "password"
@mpahuja
mpahuja / UITests - TableViewTests.swift
Created Sep 24, 2019
UITests - TableViewTests.swift
View UITests - TableViewTests.swift
import XCTest
class TableViewTests: BaseTest {
func testRowAlert() {
XCTContext.runActivity(named: "Test Correct row alert is being shown on random row") { _ in
XCTAssertTrue(tableViewPage.isRandomTableDisplayed())
let countOfRows = tableViewPage.countTableRows()
XCTAssertGreaterThan(countOfRows, 0)
let randomRowElement = Int.random(in: 1 ... countOfRows)
let currentRowValue = tableViewPage.getValueAtDesiredRow(desiredIndex: randomRowElement)
@mpahuja
mpahuja / UITests - MapViewTests
Created Sep 24, 2019
UITests - MapViewTests
View UITests - MapViewTests
import XCTest
class MapViewTests: BaseTest {
func testMapLocation() {
XCTContext.runActivity(named: "Test Map and pointer are rendered") { _ in
mapViewPage.tapThirdViewTab()
XCTAssertTrue(mapViewPage.isMapDisplayed())
XCTAssertTrue(mapViewPage.isPointerDisplayed())
}
@mpahuja
mpahuja / Utils - BaseTest.swift
Last active Sep 24, 2019
Utils - BaseTest.swift
View Utils - BaseTest.swift
import XCTest
private var globalSampleApp: XCUIApplication!
open class BaseTest: XCTestCase {
private var pages: [String: BasePage] = [:]
lazy var sampleApp = XCUIApplication()
public let globalSampleApp = XCUIApplication()
@mpahuja
mpahuja / Pages - MapView.swift
Created Sep 24, 2019
Pages - MapView.swift
View Pages - MapView.swift
import XCTest
public final class MapViewPage: BasePage {
// Mark: - Page UI elements
private var thirdView: XCUIElement {
return app.tabBars.buttons["Third"]
}
private var mapComponent: XCUIElement {
return app.maps.element
@mpahuja
mpahuja / Pages - TableView.swift
Created Sep 24, 2019
Pages - TableView.swift
View Pages - TableView.swift
import XCTest
public final class TableViewPage: BasePage {
// Mark: - Page UI elements
private var entireTable: XCUIElement {
return app.tables.allElementsBoundByAccessibilityElement[0]
}
private var countTableRow: XCUIElementQuery {
return app.tables.cells
@mpahuja
mpahuja / Pages - BasePage.swift
Created Sep 24, 2019
Pages - BasePage.swift
View Pages - BasePage.swift
import XCTest
open class BasePage {
public let app: XCUIApplication
public required init(testCase: BaseTest) {
self.app = testCase.globalSampleApp
}
}
You can’t perform that action at this time.