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

[iOS]Added Support for Cucumberish Tags / Function Annotations #702

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

abhishekbedi1432
Copy link
Contributor

@abhishekbedi1432 abhishekbedi1432 commented Oct 30, 2022

Background

For Android, marathon already supports Cucumber framework for BDD (Behaviour Driven Development) oriented UI Tests but the same is not present for iOS (which uses a similar Cucumberish).

Problem

In order to leverage marathon to support cucumberish (for iOS) we may require a lot of effort.

Solution

In Cucumber/Cucumberish, we annotate the scenarios/features with tags like @SmokeTest @Regression, etc.

Now considering if your project supports Cucumberish or not , there are two approaches:

  1. If your iOS project is NOT using Cucumberish framework for writing tests, you can simply annotate your test functions and same will work with marathon.
  2. However, if you are using Cucumberish, and trying to move out of it for a more robust solution, you can use XCTest-Gherkin framework to convert your Cucumberish Tests to native UI Tests and then tag as described below.

How Test Functions Look Like

image

Please Note

Test Functions can have multiple annotations but marathon will run only those tests which match the xcTestRunnerTag i.e. only one tag at a time

Next Steps

We will add functionality to support multiple tags as well in the future :)

You can now annotate your test functions and can run them from anywhere by passing their tag name. Test Functions can have multiple annotations but marathon will run only match only one tag at the moment.
@Malinskiy
Copy link
Member

With the latest change coming in 0.8.0 marathon doesn't have access to source code of the test anymore to align more with other platforms.
I see 2 solutions here:

  • Implement some way of discovering tags in runtime (not sure how since Apple ecosystem doesn't even have proper test listing ATM)
  • Implement this as a separate tool/command to create a test filtering configuration for Marathonfile. Marathon supports reading test list from a separate file in a format:
com.example.MyTest#method1
com.example.MyTest2#method2
...

Best way forward would be option 1, but it requires Apple's support

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.

None yet

2 participants