diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8768e0a..1ea789f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,3 +46,20 @@ jobs: - name: Run Backend unit tests run: npm run backend:test + + e2e: + name: Test/E2E + runs-on: ubuntu-latest + # needs: + # - unit-frontend + # - unit-backend + steps: + - uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: topos-protocol + repo: e2e-tests + github_token: ${{ secrets.ROBOT_PAT_TRIGGER_E2E_WORKFLOWS }} + workflow_file_name: frontend:faucet.yml + ref: seb/too-343 + wait_interval: 60 + client_payload: '{ "faucet-ref": "${{ github.head_ref }}" }' diff --git a/.gitignore b/.gitignore index 0c116b9..9f73b16 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* -node_modules -.env -dist dist-ssr *.local @@ -24,5 +21,10 @@ dist-ssr *.sln *.sw? -# Test coverage +**/node_modules +**/.env +**/dist +**/cypress/screenshots +# **/cypress/videos **/coverage + diff --git a/package.json b/package.json index 9e08e6c..22cc676 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "frontend:test": "npm run test --workspace=frontend", "frontend:test:coverage": "npm run test:coverage --workspace=frontend", "frontend:test:e2e": "npm run test:e2e --workspace=frontend", - "test:e2e": "start-server-and-test 'npm run backend:start' http-get://localhost:3001 'npm run frontend:test:e2e'" + "test:e2e": "start-server-and-test 'npm run backend:start' http-get://localhost:3002 'npm run frontend:test:e2e'" }, "workspaces": [ "packages/*" diff --git a/packages/frontend/cypress.config.ts b/packages/frontend/cypress.config.ts index e8d7a16..91ef4ee 100644 --- a/packages/frontend/cypress.config.ts +++ b/packages/frontend/cypress.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress' export default defineConfig({ e2e: { - baseUrl: 'http://localhost:4173', + baseUrl: 'http://localhost:3002', setupNodeEvents(on, config) { // implement node event listeners here }, diff --git a/packages/frontend/cypress/e2e/home.cy.ts b/packages/frontend/cypress/e2e/home.cy.ts index c6c4209..c08dec4 100644 --- a/packages/frontend/cypress/e2e/home.cy.ts +++ b/packages/frontend/cypress/e2e/home.cy.ts @@ -1,30 +1,11 @@ -import { INFO } from '../../src/constants/wordings' - describe('Home', () => { beforeEach(() => { cy.visit('/') }) - it('should have Builders Program banner', () => { - cy.get('.ant-alert-banner') - .as('banner') - .find('span') - .contains(INFO.JOIN_BUILDERS_PROGRAM) - .should('exist') - .and('be.visible') - cy.get('@banner') - .find('a') - .as('banner-link') - .should('have.text', INFO.BUILDERS_PROGRAM) - .and( - 'have.attr', - 'href', - 'https://builders.toposware.com/topos-builders-program-v1-0' - ) - .and('not.be.disabled') + it('should have visible and enabled address input', () => { + cy.get('#faucet_address').should('be.visible').and('be.enabled') }) - it('should have disabled address input', () => { - cy.get('#faucet_address').should('be.visible').and('be.disabled') - }) + // 0x4aab25b4fad0beaac466050f3a7142a502f4cf0a }) diff --git a/packages/frontend/cypress/videos/home.cy.ts.mp4 b/packages/frontend/cypress/videos/home.cy.ts.mp4 deleted file mode 100644 index 266681c..0000000 Binary files a/packages/frontend/cypress/videos/home.cy.ts.mp4 and /dev/null differ diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 6f9b015..37b85e9 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -11,7 +11,7 @@ "start": "tsc && vite build --mode development --watch --sourcemap true", "test": "vitest", "test:coverage": "vitest run --coverage", - "test:e2e": "start-server-and-test 'npm run preview' http-get://localhost:4173 'cypress run'" + "test:e2e": "env-cmd --silent cypress run" }, "dependencies": { "@ant-design/icons": "^5.0.1", diff --git a/packages/frontend/src/constants/wordings.ts b/packages/frontend/src/constants/wordings.ts index 23e0f25..6dd01e9 100644 --- a/packages/frontend/src/constants/wordings.ts +++ b/packages/frontend/src/constants/wordings.ts @@ -1,8 +1,3 @@ -export enum INFO { - BUILDERS_PROGRAM = 'Builders Program', - JOIN_BUILDERS_PROGRAM = 'Building with Topos? Apply for a grant!', -} - export enum SUCCESS { GET_SUBNET_ASSET = 'Coins were successfully sent to your address on the selected subnets 🎉', }