able-guitar-55705
12/02/2022, 4:33 AMyaml
name: Cypress Tests
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v4.1.0
with:
build: npm run build
start: npm start
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
I have tried the following and all have failed:
1. putting the environment variables in cypress.config.ts
2. putting the environment variables in github secrets
My test:
ts
describe('Plan', () => {
it('Displays login required and redirects user to login page when clicked on', () => {
cy.visit('http://localhost:3000/plan')
cy.findByRole('link', { name: /login required/i }).click()
cy.url().should('include', '/login')
})
})
I'm new to cypress testing and testing in general so any help is much appreciated. Thank you!