Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shamanec committed Aug 6, 2023
1 parent f7d5434 commit b6be9a1
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 88 deletions.
36 changes: 20 additions & 16 deletions xcuitest-sample-proj.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@
FF79C2862A66F72200BBC60A /* TestConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF79C2852A66F72200BBC60A /* TestConstants.swift */; };
FF79C2892A66F9F500BBC60A /* Interactions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF79C2882A66F9F500BBC60A /* Interactions.swift */; };
FF7C55402A6EF2DA00102A71 /* LaunchArgumentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF7C553F2A6EF2DA00102A71 /* LaunchArgumentTests.swift */; };
FF844DB82A7C027C002A79EA /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF844DB72A7C027C002A79EA /* App.swift */; };
FF86799B2A69699D00C4A1A7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF86799A2A69699D00C4A1A7 /* AppDelegate.swift */; };
FF86799E2A696BDC00C4A1A7 /* CarouselItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF86799D2A696BDC00C4A1A7 /* CarouselItemView.swift */; };
FFED40FE2A714284005B0940 /* Sliders in Frameworks */ = {isa = PBXBuildFile; productRef = FFED40FD2A714284005B0940 /* Sliders */; };
FFEDF6402A7A7E1A0065A5E4 /* Alerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFEDF63F2A7A7E1A0065A5E4 /* Alerts.swift */; };
FFEDF6422A7A965C0065A5E4 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFEDF6412A7A965C0065A5E4 /* Logger.swift */; };
FFF0348F2A6CFA6500A33E97 /* FirstPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF0348E2A6CFA6500A33E97 /* FirstPage.swift */; };
FFF034912A6CFA8B00A33E97 /* BasePage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034902A6CFA8B00A33E97 /* BasePage.swift */; };
FFF034932A6CFEA200A33E97 /* SecondPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034922A6CFEA200A33E97 /* SecondPage.swift */; };
FFF0348F2A6CFA6500A33E97 /* FirstScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF0348E2A6CFA6500A33E97 /* FirstScreen.swift */; };
FFF034912A6CFA8B00A33E97 /* BaseScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034902A6CFA8B00A33E97 /* BaseScreen.swift */; };
FFF034932A6CFEA200A33E97 /* SecondScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034922A6CFEA200A33E97 /* SecondScreen.swift */; };
FFF034952A6D027B00A33E97 /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034942A6D027B00A33E97 /* TabBar.swift */; };
FFF034992A6D219000A33E97 /* TextFieldWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034982A6D219000A33E97 /* TextFieldWrapper.swift */; };
FFF0349B2A6D227100A33E97 /* XCUIApplication+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF0349A2A6D227100A33E97 /* XCUIApplication+Extensions.swift */; };
FFF0349D2A6D4F6C00A33E97 /* CameraPermissionsRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF0349C2A6D4F6C00A33E97 /* CameraPermissionsRequestView.swift */; };
FFF034A12A6D56DF00A33E97 /* ThirdPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034A02A6D56DF00A33E97 /* ThirdPage.swift */; };
FFF034A12A6D56DF00A33E97 /* ThirdScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFF034A02A6D56DF00A33E97 /* ThirdScreen.swift */; };
FFF034A32A6D687400A33E97 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = FFF034A22A6D687400A33E97 /* README.md */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -64,18 +65,19 @@
FF79C2852A66F72200BBC60A /* TestConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestConstants.swift; sourceTree = "<group>"; };
FF79C2882A66F9F500BBC60A /* Interactions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Interactions.swift; sourceTree = "<group>"; };
FF7C553F2A6EF2DA00102A71 /* LaunchArgumentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchArgumentTests.swift; sourceTree = "<group>"; };
FF844DB72A7C027C002A79EA /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = "<group>"; };
FF86799A2A69699D00C4A1A7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
FF86799D2A696BDC00C4A1A7 /* CarouselItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemView.swift; sourceTree = "<group>"; };
FFEDF63F2A7A7E1A0065A5E4 /* Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alerts.swift; sourceTree = "<group>"; };
FFEDF6412A7A965C0065A5E4 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
FFF0348E2A6CFA6500A33E97 /* FirstPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstPage.swift; sourceTree = "<group>"; };
FFF034902A6CFA8B00A33E97 /* BasePage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BasePage.swift; sourceTree = "<group>"; };
FFF034922A6CFEA200A33E97 /* SecondPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondPage.swift; sourceTree = "<group>"; };
FFF0348E2A6CFA6500A33E97 /* FirstScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstScreen.swift; sourceTree = "<group>"; };
FFF034902A6CFA8B00A33E97 /* BaseScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseScreen.swift; sourceTree = "<group>"; };
FFF034922A6CFEA200A33E97 /* SecondScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondScreen.swift; sourceTree = "<group>"; };
FFF034942A6D027B00A33E97 /* TabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; };
FFF034982A6D219000A33E97 /* TextFieldWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldWrapper.swift; sourceTree = "<group>"; };
FFF0349A2A6D227100A33E97 /* XCUIApplication+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCUIApplication+Extensions.swift"; sourceTree = "<group>"; };
FFF0349C2A6D4F6C00A33E97 /* CameraPermissionsRequestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraPermissionsRequestView.swift; sourceTree = "<group>"; };
FFF034A02A6D56DF00A33E97 /* ThirdPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdPage.swift; sourceTree = "<group>"; };
FFF034A02A6D56DF00A33E97 /* ThirdScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdScreen.swift; sourceTree = "<group>"; };
FFF034A22A6D687400A33E97 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -108,10 +110,10 @@
FF4D5CAB2A67FDA300B52624 /* Pages */ = {
isa = PBXGroup;
children = (
FFF0348E2A6CFA6500A33E97 /* FirstPage.swift */,
FFF034922A6CFEA200A33E97 /* SecondPage.swift */,
FFF0348E2A6CFA6500A33E97 /* FirstScreen.swift */,
FFF034922A6CFEA200A33E97 /* SecondScreen.swift */,
FFF034942A6D027B00A33E97 /* TabBar.swift */,
FFF034A02A6D56DF00A33E97 /* ThirdPage.swift */,
FFF034A02A6D56DF00A33E97 /* ThirdScreen.swift */,
);
path = Pages;
sourceTree = "<group>";
Expand Down Expand Up @@ -194,6 +196,7 @@
FF4D5CAF2A68033C00B52624 /* Elements.swift */,
FFEDF63F2A7A7E1A0065A5E4 /* Alerts.swift */,
FFEDF6412A7A965C0065A5E4 /* Logger.swift */,
FF844DB72A7C027C002A79EA /* App.swift */,
);
path = Helpers;
sourceTree = "<group>";
Expand All @@ -212,7 +215,7 @@
isa = PBXGroup;
children = (
FF79C2822A66F54E00BBC60A /* BaseTest.swift */,
FFF034902A6CFA8B00A33E97 /* BasePage.swift */,
FFF034902A6CFA8B00A33E97 /* BaseScreen.swift */,
);
path = Foundations;
sourceTree = "<group>";
Expand Down Expand Up @@ -374,20 +377,21 @@
files = (
FF79C2832A66F54E00BBC60A /* BaseTest.swift in Sources */,
FFEDF6402A7A7E1A0065A5E4 /* Alerts.swift in Sources */,
FFF034932A6CFEA200A33E97 /* SecondPage.swift in Sources */,
FFF034932A6CFEA200A33E97 /* SecondScreen.swift in Sources */,
FF79C2032A66F1B700BBC60A /* SampleAppUITests.swift in Sources */,
FFF034952A6D027B00A33E97 /* TabBar.swift in Sources */,
FF79C2892A66F9F500BBC60A /* Interactions.swift in Sources */,
FF4D5CB02A68033C00B52624 /* Elements.swift in Sources */,
FF844DB82A7C027C002A79EA /* App.swift in Sources */,
FFEDF6422A7A965C0065A5E4 /* Logger.swift in Sources */,
FFF0349B2A6D227100A33E97 /* XCUIApplication+Extensions.swift in Sources */,
FFF0348F2A6CFA6500A33E97 /* FirstPage.swift in Sources */,
FFF0348F2A6CFA6500A33E97 /* FirstScreen.swift in Sources */,
FF79C2862A66F72200BBC60A /* TestConstants.swift in Sources */,
FF7C55402A6EF2DA00102A71 /* LaunchArgumentTests.swift in Sources */,
FF79C27F2A66F3A000BBC60A /* XCUIElement+Extensions.swift in Sources */,
FFF034A12A6D56DF00A33E97 /* ThirdPage.swift in Sources */,
FFF034A12A6D56DF00A33E97 /* ThirdScreen.swift in Sources */,
FF79C2812A66F45200BBC60A /* XCUIElementQuery+Extensions.swift in Sources */,
FFF034912A6CFA8B00A33E97 /* BasePage.swift in Sources */,
FFF034912A6CFA8B00A33E97 /* BaseScreen.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import XCTest

class BasePage {
class BaseScreen {
var app: XCUIApplication
private static var isReflectionIdleEnabled = false

init(app: XCUIApplication) {
self.app = app
init() {
self.app = BaseTest().getApp()
}

// MARK: - Reflection idle hack code
Expand All @@ -27,10 +27,10 @@ class BasePage {
return
}

if state != BasePage.isReflectionIdleEnabled {
if state != BaseScreen.isReflectionIdleEnabled {
method_exchangeImplementations(current, replaced)
print("[UITest] reflection idle hack " + (state ? "set" : "unset"))
BasePage.isReflectionIdleEnabled = state
BaseScreen.isReflectionIdleEnabled = state
}
}

Expand Down
2 changes: 1 addition & 1 deletion xcuitest-sample-projUITests/LaunchArgumentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LaunchArgumentTests: BaseTest {
}

func testLaunchArgument() {
let firstPage = FirstPage(app: getApp())
let firstPage = FirstScreen()
XCTAssertEqual(firstPage.argumentText.label, "Argument:Custom")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest

class FirstPage: BasePage {
class FirstScreen: BaseScreen {

var carousel: XCUIElement { app.scrollViews.matching(identifier: "carousel-view").firstMatch }
var carouselItems: XCUIElementQuery { carousel.staticTexts }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

import XCTest

class SecondPage: BasePage {
class SecondScreen: BaseScreen {
var loadingElements: XCUIElementQuery { app.staticTexts.matching(identifier: "loaded-el") }
}
2 changes: 1 addition & 1 deletion xcuitest-sample-projUITests/Pages/TabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest

class TabBar: BasePage {
class TabBar: BaseScreen {
private var defaultTabBar: XCUIElement { app }
private var firstPageButton: XCUIElement { defaultTabBar.buttons["Carousel"] }
private var secondPageButton: XCUIElement { defaultTabBar.buttons["Loading"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import XCTest

class ThirdPage: BasePage {
class ThirdScreen: BaseScreen {
var permissionState: XCUIElement { app.staticTexts["permission-state"] }

func getPermissionState() -> String {
Expand Down
Loading

0 comments on commit b6be9a1

Please sign in to comment.