mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-09 01:17:06 +02:00
Move e2e tests from frontend to backend .github (#1975)
* Add e2e tests * Remove cypress key * Add project tag * Add cypress to root * Add cypress working directory and package.json in subfolder * Remove record flag * Add contains to url check * Test segment e2e test * Remove one of contains * Test e2e tests * Fix e2e * Test new yml * New yaml * Test different echo * Update workflows * Fix deployment url * Fix formatting
This commit is contained in:
parent
4a3ec44a1f
commit
d0631f0d74
@ -15,5 +15,5 @@ trim_trailing_whitespace = false
|
|||||||
[*.json]
|
[*.json]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[*.yaml]
|
[*.{yaml,yml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
name: e2e:feature
|
name: e2e:feature
|
||||||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
||||||
on: [deployment_status]
|
on: [ deployment_status ]
|
||||||
jobs:
|
jobs:
|
||||||
e2e:
|
e2e:
|
||||||
# only runs this job on successful deploy
|
# only runs this job on successful deploy
|
||||||
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
|
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'unleash-monorepo-frontend')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@ -14,12 +14,12 @@ jobs:
|
|||||||
echo "$GITHUB_CONTEXT"
|
echo "$GITHUB_CONTEXT"
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Install root dependencies
|
||||||
|
uses: bahmutov/npm-install@v1
|
||||||
- name: Run Cypress
|
- name: Run Cypress
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v2
|
||||||
with:
|
with:
|
||||||
|
working-directory: frontend
|
||||||
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
||||||
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
||||||
record: true
|
|
||||||
spec: cypress/integration/feature/feature.spec.ts
|
spec: cypress/integration/feature/feature.spec.ts
|
||||||
env:
|
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
@ -1,10 +1,10 @@
|
|||||||
name: e2e:groups
|
name: e2e:groups
|
||||||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
||||||
on: [deployment_status]
|
on: [ deployment_status ]
|
||||||
jobs:
|
jobs:
|
||||||
e2e:
|
e2e:
|
||||||
# only runs this job on successful deploy
|
# only runs this job on successful deploy
|
||||||
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
|
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'unleash-monorepo-frontend')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@ -14,12 +14,12 @@ jobs:
|
|||||||
echo "$GITHUB_CONTEXT"
|
echo "$GITHUB_CONTEXT"
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Install root dependencies
|
||||||
|
uses: bahmutov/npm-install@v1
|
||||||
- name: Run Cypress
|
- name: Run Cypress
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v2
|
||||||
with:
|
with:
|
||||||
|
working-directory: frontend
|
||||||
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
||||||
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
||||||
record: true
|
|
||||||
spec: cypress/integration/groups/groups.spec.ts
|
spec: cypress/integration/groups/groups.spec.ts
|
||||||
env:
|
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
@ -1,10 +1,10 @@
|
|||||||
name: e2e:project-access
|
name: e2e:project-access
|
||||||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
||||||
on: [deployment_status]
|
on: [ deployment_status ]
|
||||||
jobs:
|
jobs:
|
||||||
e2e:
|
e2e:
|
||||||
# only runs this job on successful deploy
|
# only runs this job on successful deploy
|
||||||
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
|
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'unleash-monorepo-frontend')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@ -14,12 +14,12 @@ jobs:
|
|||||||
echo "$GITHUB_CONTEXT"
|
echo "$GITHUB_CONTEXT"
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Install root dependencies
|
||||||
|
uses: bahmutov/npm-install@v1
|
||||||
- name: Run Cypress
|
- name: Run Cypress
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v2
|
||||||
with:
|
with:
|
||||||
|
working-directory: frontend
|
||||||
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
||||||
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
||||||
record: true
|
|
||||||
spec: cypress/integration/projects/access/project-access.spec.ts
|
spec: cypress/integration/projects/access/project-access.spec.ts
|
||||||
env:
|
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
@ -1,10 +1,10 @@
|
|||||||
name: e2e:segments
|
name: e2e:segments
|
||||||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows
|
||||||
on: [deployment_status]
|
on: [ deployment_status ]
|
||||||
jobs:
|
jobs:
|
||||||
e2e:
|
e2e:
|
||||||
# only runs this job on successful deploy
|
# only runs this job on successful deploy
|
||||||
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
|
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'unleash-monorepo-frontend')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@ -14,12 +14,12 @@ jobs:
|
|||||||
echo "$GITHUB_CONTEXT"
|
echo "$GITHUB_CONTEXT"
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Install root dependencies
|
||||||
|
uses: bahmutov/npm-install@v1
|
||||||
- name: Run Cypress
|
- name: Run Cypress
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v2
|
||||||
with:
|
with:
|
||||||
|
working-directory: frontend
|
||||||
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
||||||
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
config: baseUrl=${{ github.event.deployment_status.target_url }}
|
||||||
record: true
|
|
||||||
spec: cypress/integration/segments/segments.spec.ts
|
spec: cypress/integration/segments/segments.spec.ts
|
||||||
env:
|
|
||||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
Loading…
Reference in New Issue
Block a user