Questions tagged [xcuitest]

Apple's XCUITest framework for UI Testing on iOS and Mac OS.

638 questions
1
vote
0 answers

ios deep link testing

I'm trying to test deep linking of my app using iOS XCTests. To do so I've used the code detailed in several webs: let safari = XCUIApplication(bundleIdentifier: "com.apple.mobilesafari") safari.launch() …
Wonton
  • 1,033
  • 16
  • 33
1
vote
1 answer

XCTest VC Hierarchy without XCUITest?

I want to test a ViewController hierarchy without using XCUITests, because they take a huge ton longer than plain old XCTests. I've had some success but I can't seem to create a ViewController hierarchy more than one level deep. Here's a test case…
Le Mot Juiced
  • 3,761
  • 1
  • 26
  • 46
1
vote
1 answer

SwiftUI: Why does @AppStorage work differently to my custom binding?

I have a modal presented Sheet which should display based on a UserDefault bool. I wrote a UI-Test which dismisses the sheet and I use launch arguments to control the defaults value. However, when I tried using @AppStorage initially it didn't seem…
lacking-cypher
  • 483
  • 4
  • 16
1
vote
3 answers

XCTest fails to compare two strings

I am looking for a text given in parameter in my textviews. I am sure that it exists because I see it on the screen, but somehow comparing them fails. Here is a method: func checkText(_ text: String) { for tv in…
stackich
  • 3,607
  • 3
  • 17
  • 41
1
vote
1 answer

XCode 13.1. Is it possible to take a screenshot of an XCUIElement that doesn't fit in screen?

I have a long table with multiple elements within. Is is possible to take a "long" screenshot that will include all elements, not only current screen state?
1
vote
1 answer

Does XCUITest type text function send a keyboard input?

Does the XCUITest typetext function actually send a keyboard event through the iOS keyboard or does it simple copy the value provided to it directly into the text box? I tried to send in Chinese through the typeText Function while the keyboard was…
jainil
  • 41
  • 10
1
vote
2 answers

How to clear iPhone simulator Safari history and data in XCUITest?

How can I clear my Safari history and data for the iPhone simulator in an XCUITest before running the test? I am trying to test the login features of an app and would like the login credentials not to be saved i.e. google sign in. For this I need to…
Yucel
  • 11
  • 1
1
vote
1 answer

How to Get the ID for the Simulator that is generated in XCTestDevices

Is there a way to get the ID of the Simulator that is generated in the Library/Developer/XCTestDevices folder? When I do: UIDevice.current.identifierForVendor This gives me an ID but not the one I need: ▿ Optional some :…
reutsey
  • 1,743
  • 1
  • 17
  • 36
1
vote
2 answers

Unable to access TextEditor from XCUIApplication in XCTest

I am trying to write a UI test for our app that uses the new TextEditor view. let app = XCUIApplication() app.launch() let textEditor = app.["Editor"] textEditor.typeText("Hello, world") I cannot find anywhere what this accessor should…
1
vote
0 answers

XCUItest. When you try to tap on the enter button on the system keyboard, the test breaks and the main.m file opens

I am writing UI tests for a ready-made ios application. I have a window in which you need to enter a valid link and tap on the Enter key to go to the next window. But the test stops after the command app.keyboards.buttons ["continue"].tap() and the…
Anton
  • 11
  • 3
1
vote
3 answers

How to read a value from MenuItem in XCUITest?

I have a menu item that looks like a checkbox: I would like to click/not-click on it depending on the current value. How do I get the current value? My code for accessing and clicking it looks like this: let menuBars = application.menuBars let…
Paulius Liekis
  • 1,676
  • 3
  • 18
  • 26
1
vote
1 answer

How does one query SwiftUI table cells using XCUITest

I am starting to include some SwiftUI code in my UIKit project. The UIKit project had UI Tests using XCUITest which, as you may know, can query elements down the UI tree and can even have an identifier to narrow do your elements found. I have moved…
Mario A Guzman
  • 3,483
  • 4
  • 27
  • 36
1
vote
1 answer

How to install iOS app on a real device for iOS Test Automation?

I am writing XCUITests for an app without source code. I have .app file of the app. I am using XCUIApplications init(bundleIdentifier:) method to launch the application. This works fine if I have the app pre installed on the device. If I don't have…
Mohamed Wasiq
  • 490
  • 4
  • 17
1
vote
1 answer

How to assert the contents of a copied and pasted row using XCTAssert

What I'm doing. I am creating a paragraph block/row Filling that row with random text Copying and pasting that row using the built-in copy and paste block feature Then trying to assert the newly pasted row to check it matches the text in the first…
1
vote
0 answers

How to wait in XCUITests for copy/paste prompt to disappear?

In my UI tests, I need to wait for the copy/paste notification to disappear. In most tests cases notification looks: I tried to wait this way: func waitForPasteboardInfoDissappear(file: StaticString = #file, line: UInt = #line) { let…
Wez Sie Tato
  • 1,186
  • 12
  • 33