Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add mobile endpoints to run XCTest #1205

Merged
merged 14 commits into from
Jun 24, 2020
Merged

feat: Add mobile endpoints to run XCTest #1205

merged 14 commits into from
Jun 24, 2020

Conversation

dpgraham
Copy link
Contributor

@dpgraham dpgraham commented May 8, 2020

Add a feature that allows users to run XCTests (requires IDB installed an launchWithIdb capability to be set).

Justification

This is useful primarily for cloud users of Appium, as it will allow iOS testers to run their XCTests against a grid of iOS devices (simulators/real). The only requirement for the cloud provider will be that they need to have IDB installed on their machines.

@dpgraham dpgraham changed the title WIP: Add mobile endpoints to run XCTest feat: Add mobile endpoints to run XCTest May 10, 2020
Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add commands in https://github.com/appium/appium/blob/master/commands-yml/commands/mobile-command.yml after this merge :)

lib/commands/xctest.js Outdated Show resolved Hide resolved
lib/commands/xctest.js Outdated Show resolved Hide resolved
test/functional/device/xctest-e2e-specs.js Show resolved Hide resolved
@dpgraham
Copy link
Contributor Author

Changes pushed.

@dpgraham
Copy link
Contributor Author

More changes pushed.

* @property {string} testName Name of the test (e.g.: 'XCTesterAppUITests - XCTesterAppUITests.XCTesterAppUITests/testExample')
* @property {boolean} passed Did the tests pass?
* @property {boolean} crashed Did the tests crash?
* @property {number} duration How long did the tests take (in seconds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these float seconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, but a JS number can be an integer or a float.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's more about the downstream API. Usually Apple stuff uses NSTimeInterval type to describe duration and this is represented in float seconds, which means that the precision is fine for milliseconds as well and digits after the decimal point are not ignored.

* @property {boolean} crashed Did the tests crash?
* @property {number} duration How long did the tests take (in seconds)
* @property {string} failureMessage Failure message (if applicable)
* @property {number} location
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is location?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no documentation on it, so not sure.

/**
* @typedef {Object} RunXCUITestOptions
*
* @property {string!} testRunnerBundleId Test app bundle (e.g.: 'io.appium.XCTesterAppUITests.xctrunner')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exclamation mark should be the prefix: {!string}

/**
* List XCTests in a test bundle
*
* @param {string!} bundle Bundle ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should also accept opts

/**
* @typedef {Object} InstallXCTestBundleOpts
*
* @property {xctestApp} xctestBundle Path of the XCTest app (URL or .app)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@property {!string} xctestApp ...

@dpgraham
Copy link
Contributor Author

Another push. The IDB failure is unrelated to this PR, I'll need to make a separate PR to fix it.


/**
* Run an XCTest. Launches a subprocess that runs the XC Test and blocks
* until it is complete. Throws an exception if the subprocess fails.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather move these descriptions into @throws and @returns tags

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some minor comments to the docstrings

@dpgraham dpgraham merged commit f02343e into master Jun 24, 2020
@dpgraham dpgraham deleted the dpgraham-xctest branch June 24, 2020 18:38
khanayan123 pushed a commit to khanayan123/appium-xcuitest-driver that referenced this pull request May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants