Skip to content

Commit

Permalink
Add workflow for e2e tests (saleor#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
szczecha authored Oct 25, 2022
1 parent f3f47af commit ae9c67f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: E2E Tests

on:
workflow_dispatch:
inputs:
environment:
required: true
description: 'Environment to run tests against'
default: 'https://staging-demo.saleor.io'
type: choice
options:
- https://staging-demo.saleor.io/
- https://demo.saleor.io/

jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 7.11.0 # version used by Vercel
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"

- name: Get env
id: get-env-uri
env:
DEFAULT_ENV_URI: 'https://staging-demo.saleor.io'
run: |
echo "ENV_URI=${{ github.event.inputs.environment || env.DEFAULT_ENV_URI }}" >> $GITHUB_OUTPUT
- name: Cypress run on demo
uses: cypress-io/github-action@v4
with:
record: true
config: baseUrl=${{ steps.get-env-uri.outputs.ENV_URI }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SALEOR_API_URL: ${{ steps.get-env-uri.outputs.ENV_URI }}graphql/

3 changes: 1 addition & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from "cypress";

require("dotenv").config();
import "../react-storefront/packages/env-vars";

export default defineConfig({
projectId: "o9u948",
Expand Down

0 comments on commit ae9c67f

Please sign in to comment.