Skip to content

Commit

Permalink
Spelling
Browse files Browse the repository at this point in the history
Co-authored-by: Thiago Veronese <[email protected]>
  • Loading branch information
si-net and thiagosaucelabs authored Jan 22, 2025
1 parent a5ed157 commit 18748af
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Flutter compiles iOS [integration tests](https://docs.flutter.dev/cookbook/testing/integration/introduction) into [XCTests](https://developer.apple.com/documentation/xctest) so that they can be executed on apple devices. In the following we will explain how to run your XCTests on Sauce Labs infrastructure.
Flutter compiles iOS [integration tests](https://docs.flutter.dev/cookbook/testing/integration/introduction) into [XCTests](https://developer.apple.com/documentation/xctest) so that they can be executed on Apple devices. The following will explain how to run your XCTests on Sauce Labs infrastructure.

**To run a XCTest (or 'flutter test') on Sauce Labs we need two test artifacts from you:**
**To run an XCTest (or 'Flutter test') on Sauce Labs, you need to provide two test artifacts:**
1. Your flutter-iOS app compiled as an `.app` or `.ipa` file.
2. The `.xctestrun` file for that app. The [.xctestrun file](https://keith.github.io/xcode-man-pages/xcodebuild.xctestrun.5.html) is the config for your test, this is the same config that xcode uses when it runs your tests on your development machine.
2. The `.xctestrun` file for that app. The [.xctestrun file](https://keith.github.io/xcode-man-pages/xcodebuild.xctestrun.5.html) is the config for your test, this is the same config that Xcode uses when it runs your tests on your development machine.


## Contents
Expand All @@ -37,14 +37,14 @@ Flutter compiles iOS [integration tests](https://docs.flutter.dev/cookbook/testi

## 1. How to build the '.app' and '.xctestrun' files for your Flutter app.

Check warning on line 38 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L38

[sauce.HeadingPunctuation] Don't use periods or exclamation marks in headings.
Raw output
{"message": "[sauce.HeadingPunctuation] Don't use periods or exclamation marks in headings.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 38, "column": 73}}}, "severity": "WARNING"}

:::note You need to setup your flutter app for integration tests.
:::note You need to setup your Flutter app for integration tests.

Before you build your app, you need to ensure that you have setup the `integration_tests` for your flutter-ios app correctly. You can follow the [flutter documentation](https://github.com/flutter/flutter/tree/main/packages/integration_test#integration_test) to do so, the most relevant section is the part on [iOS Device Testing](https://github.com/flutter/flutter/tree/main/packages/integration_test#ios-device-testing). You can stop following flutters guide after you have executed the `xcodebuild build-for-testing` command. This command will generate the `.app` and `.xctestrun` file.
Before you build your app, you must ensure that you correctly set up the `integration_tests` for your flutter-ios app. You can follow the [flutter documentation](https://github.com/flutter/flutter/tree/main/packages/integration_test#integration_test) to do so. The most relevant section is the part on [iOS Device Testing](https://github.com/flutter/flutter/tree/main/packages/integration_test#ios-device-testing). You can stop following Flutter's guide after you have executed the `xcodebuild build-for-testing` command. This command will generate the `.app` and `.xctestrun` files.

Check warning on line 42 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L42

[sauce.WordList] Use 'iOS' instead of 'ios'.
Raw output
{"message": "[sauce.WordList] Use 'iOS' instead of 'ios'.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 42, "column": 395}}}, "severity": "WARNING"}
:::

To execute your xctest, we require your app (which must be packaged together with your XCTests) in '.app' or '.ipa' format. Additionally we need your your `.xctestrun` file, which is the config for your test.

Check warning on line 45 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L45

[sauce.Inclusivity] Avoid problematic language. Use 'run' instead of 'execute'.
Raw output
{"message": "[sauce.Inclusivity] Avoid problematic language. Use 'run' instead of 'execute'.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 45, "column": 4}}}, "severity": "WARNING"}

Check warning on line 45 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L45

[sauce.Repetition] Remove this duplicate word: 'your'.
Raw output
{"message": "[sauce.Repetition] Remove this duplicate word: 'your'.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 45, "column": 146}}}, "severity": "WARNING"}

By default xcode will not persist the `.xctestrun` file if you kick off a XCTest on your development machine. To persist the `.xctestrun` file we need to use the `xcodebuild build-for-testing` command. Make sure you are using the correct `scheme` so it includes your integration tests.
By default, Xcode will not persist the `.xctestrun` file if you kick off an XCTest on your development machine. To persist the `.xctestrun` file we need to use the `xcodebuild build-for-testing` command. Make sure you are using the correct `scheme` so it includes your integration tests.

```shell
# Example of the xcodebuild command to build the application.
Expand All @@ -64,36 +64,36 @@ xcodebuild build-for-testing \

## 2. How to run flutter-iOS integration tests on Sauce Labs infrastructure

Check warning on line 65 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L65

[sauce.Headings] '2. How to run flutter-iOS integration tests on Sauce Labs infrastructure' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] '2. How to run flutter-iOS integration tests on Sauce Labs infrastructure' should use title case capitalization.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 65, "column": 4}}}, "severity": "WARNING"}

To run your flutter XCTest on sauce you have two options: use `saucectl` or integrate with our APIs yourself. If you are unfamiliar with our APIs we recommed using `saucectl` for ease of use and getting you started quickly.
To run your Flutter XCTest on Sauce Labs, you have two options: use `saucectl` or integrate with our APIs yourself. If you are unfamiliar with our APIs, we recommend using `saucectl` for ease of use and getting you started quickly.

### Run XCTests via saucectl

Check warning on line 69 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L69

[sauce.Headings] 'Run XCTests via saucectl' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] 'Run XCTests via saucectl' should use title case capitalization.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 69, "column": 5}}}, "severity": "WARNING"}

First install [saucectl](/docs/dev/cli/saucectl.md#installing-saucectl). Then you can use `saucectl` command to configure and run your test on Sauce Labs infrastructure.

```shell
# if you did not setup saucectl yet, run:
# If it's the first time you're using saucectl, run:
saucectl configure

# follow the steps to configure your xctest, with your `.app`/`.ipa` file and the `.xctestrun` test config. Use `Real Device` not `Virtual Device`
# follow the steps to configure your XCTest, with your `.app`/`.ipa` file and the `.xctestrun` test config. Use `Real Device` not `Virtual Device`
saucectl init xctest

# run the newly created xctest config.
# run the newly created XCTest config.
saucectl run
```

For further configuration options and info on how to use `saucectl` visit [/docs/mobile-apps/automated-testing/espresso-xcuitest/xcuitest.md](/docs/mobile-apps/automated-testing/espresso-xcuitest/xcuitest.md)

Check warning on line 84 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L84

[sauce.WordList] Use 'Espresso' instead of 'espresso'.
Raw output
{"message": "[sauce.WordList] Use 'Espresso' instead of 'espresso'.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 84, "column": 112}}}, "severity": "WARNING"}

### Run XCTests without saucectl

Check warning on line 86 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L86

[sauce.Headings] 'Run XCTests without saucectl' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] 'Run XCTests without saucectl' should use title case capitalization.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 86, "column": 5}}}, "severity": "WARNING"}

If you prefer not to use saucectl, you can also directly integrate with our APIs.
If you prefer not to use saucectl, you can directly integrate with our APIs.

**First**, you will need to compile your `.app` as an `.ipa` file as described [above](/docs/mobile-apps/automated-testing/ipa-files.md#building-an-ipa-from-an-app-bundle).
**First**, compile your `.app` as an `.ipa` file as described [above](/docs/mobile-apps/automated-testing/ipa-files.md#building-an-ipa-from-an-app-bundle).

Check warning on line 90 in docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md#L90

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/flutter/flutter-integration-testing-ios.md", "range": {"start": {"line": 90, "column": 156}}}, "severity": "WARNING"}

**Second**, you will need to upload your `.ipa` and `.xctestrun` file to our Storage backend, see [AppStorage APIs](/docs/mobile-apps/app-storage.md#upload-apps-via-rest-api).
**Second**, upload your `.ipa` and `.xctestrun` files to our AppStorage backend, see [AppStorage APIs](/docs/mobile-apps/app-storage.md#upload-apps-via-rest-api).

**Third**, you will need to call our native testing API with the AppStorage ids of the two files you just uploaded, see [RDC native /test API](/docs/dev/api/rdc.md#start-a-xctest-xcuitest-or-espresso-job).
**Third**, call our native testing API with the AppStorage IDs of the two files you just uploaded. See [RDC native /test API](/docs/dev/api/rdc.md#start-a-xctest-xcuitest-or-espresso-job).

**Fourth**, you will need to poll the state of the job and wait until the `status` is `passed|failed|error|complete`. You can do this through the [Jobs API](/docs/dev/api/rdc.md#get-a-specific-real-device-job).
**Fourth**, poll the state of the job and wait until the `status` is `passed|failed|error|complete`. You can do this through the [Jobs API](/docs/dev/api/rdc.md#get-a-specific-real-device-job).


## Example Implementation
Expand Down

0 comments on commit 18748af

Please sign in to comment.