diff --git a/.env.example b/.env.example index 8f03c8d450e1..816f64da8315 100644 --- a/.env.example +++ b/.env.example @@ -14,3 +14,6 @@ SANITY_E2E_BASE_URL=http://localhost:3339 # Whether or not to run the end to end tests in headless mode. Defaults to true, but sometimes # you might want to see the browser in action, in which case you can set this to `false`. HEADLESS=true +SANITY_E2E_HEADLESS=true +# In CI, we have to provide some signal of how we've build the studio. Set this to `true` if you're testing an auto-updating build. +SANITY_E2E_IS_AUTO_UPDATING=false diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c01d075813c7..ed18cf7dbfd2 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -99,7 +99,7 @@ jobs: # Delete `SANITY_E2E_SESSION_TOKEN_NEW` from github SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} - SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }} + SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }}${{ matrix.config == 'auto-updating' && '-auto-updating' || '' }} SANITY_E2E_IS_AUTO_UPDATING: ${{ matrix.config == 'auto-updating' && 'true' || '' }} run: | if [ "${{ matrix.config }}" == "auto-updating" ]; then @@ -227,7 +227,7 @@ jobs: # Delete `SANITY_E2E_SESSION_TOKEN_NEW` from github SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} - SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }} + SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }}${{ matrix.config == 'auto-updating' && '-auto-updating' || '' }} SANITY_E2E_IS_AUTO_UPDATING: ${{ matrix.config == 'auto-updating' && 'true' || '' }} run: pnpm test:e2e --project ${{ matrix.project }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} diff --git a/dev/test-studio/schema/debug/error.tsx b/dev/test-studio/schema/debug/error.tsx new file mode 100644 index 000000000000..ff92432a09eb --- /dev/null +++ b/dev/test-studio/schema/debug/error.tsx @@ -0,0 +1,28 @@ +import { Button } from '@sanity/ui' +import { defineField, defineType } from 'sanity' + +export default defineType({ + name: 'error', + type: 'document', + title: 'Error', + fields: [ + defineField({ + name: 'title', + title: 'Title', + type: 'string', + components: { + input: () => { + const errorFunc = () => { + throw new Error('This is not a real error: we are just testing') + } + return ( +