---
version: 0.1
globalTimeout: 90
testSuiteTimeout: 90
testSuiteStep: 90

#runson can be linux, mac, win
runson: mac

autosplit: true
retryOnFailure: true

maxRetries: 1
concurrency: 4

env:
  # PAT: ${{ .secrets.testKey }}
  CACHE_DIR: m2_cache_dir

# Dependency caching for Windows
cacheKey: '{{ checksum "pom.xml" }}'
cacheDirectories:
  - ${CACHE_DIR}

shell: bash

pre:
  # Download and install packages in the CACHE_DIR.
  # Skip execution of the tests in the pre step
  # make sure to skip tests. use gradle if the project is using gradle
  - mvn -Dmaven.repo.local=${CACHE_DIR} -Dmaven.test.skip=true clean install

post:
  - cat yaml/mac/cucumber_hyperexecute_autosplit_sample.yaml

mergeArtifacts: true

uploadArtefacts:
  - name: XmlReports
    path:
      - target/surefire-reports/testng-results.xml
  - name: JsonReports
    path:
      - target/cucumber-reports/CucumberTestReport.json

report: true
partialReports:
  location: target/cucumber-reports/
  frameworkName: cucumber
  type: json

testDiscovery:
  type: raw
  mode: dynamic
  #Parallel execution at feature level
  #command: grep -rni 'Features' -e 'Feature:' | sed 's/.*://'
  command: grep -nri '@' src/main/java/Features --include=\*.feature | sed 's/^.*://'

testRunnerCommand: mvn test -Dplatname=mac -Dmaven.repo.local=m2_cache_dir -Dcucumber.options="--tags $test"

jobLabel: [selenium-cucumber-java, mac, autosplit]
