trigger: none
schedules:
- cron: 0 9 * * MON-FRI
  always: true
  displayName: Daily Test Automation Run for ISS-NextGen
  branches:
    include:
    - develop
pool: 'Default'

resources:
  repositories:
      - repository: AzureDevOps
        type: github
        name: Safelite/AzureDevOps
        endpoint: Safelite
        ref: refs/tags/t5.7.53

variables:
  # - group: Digital-Infrastructure
  # - group: ISS-BuildBranches
  - group: SafelitePlaywright
  - name: dockerImageName
    value: 'playwright-tests'
  - name: imageTag
    value: '$(Build.BuildId)'
  - name: totalShards
    value: 4
  - name: IS_REGRESSION
    value: 'true'
  - name: JIRA_BOARD_ID
    value: '853'
  - name: JIRA_EPIC_KEY
    value: 'INSR-414'
  - name: JIRA_PROJECT_KEY
    value: 'INSR'

stages:
  - stage: TestPr
    displayName: Run Playwright Test
    jobs:
    - template: templates/digital/playwright-test.yml@AzureDevOps
      parameters:
        applicationType: 'vue'
        totalShards: ${{ variables.totalShards }}
        targetUrl: $(BASE_URL)
        dockerFileName: 'Dockerfile.playwright'
        isRegression: ${{ variables.IS_REGRESSION }}
        filterTags: '@Advanced'
        playwrightTestsPath: 'playwright-tests'
        npmServePath: '.'
        npmrcPath: 'playwright-tests/.npmrc'
        secrets:
          CCIS_API_AUTH: $(CCIS_API_AUTH)
          JIRA_API_KEY: $(JIRA_API_KEY)