diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index b057e6141..7cace626c 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -6,86 +6,53 @@ on: jobs: cypress: if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')" - runs-on: ${{ matrix.os }} + runs-on: "ubuntu-latest" strategy: fail-fast: false matrix: - containers: [1, 2, 3, 4, 5] - os: ["ubuntu-latest"] - browser: [chrome] - name: E2E tests on ${{ matrix.browser }} - ${{ matrix.os }} + module: ["mempool", "liquid", "bisq"] + include: + - module: "mempool" + spec: | + cypress/e2e/mainnet/*.spec.ts + cypress/e2e/signet/*.spec.ts + cypress/e2e/testnet/*.spec.ts + - module: "liquid" + spec: | + cypress/e2e/liquid/liquid.spec.ts + cypress/e2e/liquidtestnet/liquidtestnet.spec.ts + - module: "bisq" + spec: | + cypress/e2e/bisq/bisq.spec.ts + + name: E2E tests for ${{ matrix.module }} steps: - name: Checkout uses: actions/checkout@v2 + with: + path: ${{ matrix.module }} + - name: Setup node uses: actions/setup-node@v2 with: node-version: 16.15.0 cache: 'npm' - cache-dependency-path: frontend/package-lock.json - - name: ${{ matrix.browser }} browser tests (Mempool) - uses: cypress-io/github-action@v4 - with: - tag: ${{ github.event_name }} - working-directory: frontend - build: npm run config:defaults:mempool - start: npm run start:local-staging - wait-on: 'http://localhost:4200' - wait-on-timeout: 120 - record: true - parallel: true - spec: | - cypress/e2e/mainnet/*.spec.ts - cypress/e2e/signet/*.spec.ts - cypress/e2e/testnet/*.spec.ts - group: Tests on ${{ matrix.browser }} (Mempool) - browser: ${{ matrix.browser }} - ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' - env: - COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + cache-dependency-path: ${{ matrix.module }}/frontend/package-lock.json - - name: ${{ matrix.browser }} browser tests (Liquid) + - name: Chrome browser tests (${{ matrix.module }}) uses: cypress-io/github-action@v4 - if: always() with: tag: ${{ github.event_name }} - working-directory: frontend - build: npm run config:defaults:liquid + working-directory: ${{ matrix.module }}/frontend + build: npm run config:defaults:${{ matrix.module }} start: npm run start:local-staging wait-on: 'http://localhost:4200' wait-on-timeout: 120 record: true parallel: true - spec: | - cypress/e2e/liquid/liquid.spec.ts - cypress/e2e/liquidtestnet/liquidtestnet.spec.ts - group: Tests on ${{ matrix.browser }} (Liquid) - browser: ${{ matrix.browser }} - ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' - env: - COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} - - - name: ${{ matrix.browser }} browser tests (Bisq) - uses: cypress-io/github-action@v4 - if: always() - with: - tag: ${{ github.event_name }} - working-directory: frontend - build: npm run config:defaults:bisq - start: npm run start:local-staging - wait-on: 'http://localhost:4200' - wait-on-timeout: 120 - record: true - parallel: true - spec: cypress/e2e/bisq/bisq.spec.ts - group: Tests on ${{ matrix.browser }} (Bisq) - browser: ${{ matrix.browser }} + spec: ${{ matrix.spec }} + group: Tests on Chrome (${{ matrix.module }}) + browser: "chrome" ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' env: COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} diff --git a/frontend/cypress/e2e/mainnet/mainnet.spec.ts b/frontend/cypress/e2e/mainnet/mainnet.spec.ts index 14f2c88de..4cc9a64c9 100644 --- a/frontend/cypress/e2e/mainnet/mainnet.spec.ts +++ b/frontend/cypress/e2e/mainnet/mainnet.spec.ts @@ -35,21 +35,23 @@ const getRectangle = ($el) => $el[0].getBoundingClientRect(); describe('Mainnet', () => { beforeEach(() => { //cy.intercept('/sockjs-node/info*').as('socket'); - cy.intercept('/api/block-height/*').as('block-height'); - cy.intercept('/api/block/*').as('block'); - cy.intercept('/api/block/*/txs/0').as('block-txs'); - cy.intercept('/api/tx/*/outspends').as('tx-outspends'); - cy.intercept('/resources/pools.json').as('pools'); + // cy.intercept('/api/block-height/*').as('block-height'); + // cy.intercept('/api/v1/block/*').as('block'); + // cy.intercept('/api/block/*/txs/0').as('block-txs'); + // cy.intercept('/api/v1/block/*/summary').as('block-summary'); + // cy.intercept('/api/v1/outspends/*').as('outspends'); + // cy.intercept('/api/tx/*/outspends').as('tx-outspends'); + // cy.intercept('/resources/pools.json').as('pools'); // Search Auto Complete cy.intercept('/api/address-prefix/1wiz').as('search-1wiz'); cy.intercept('/api/address-prefix/1wizS').as('search-1wizS'); cy.intercept('/api/address-prefix/1wizSA').as('search-1wizSA'); - Cypress.Commands.add('waitForBlockData', () => { - cy.wait('@tx-outspends'); - cy.wait('@pools'); - }); + // Cypress.Commands.add('waitForBlockData', () => { + // cy.wait('@tx-outspends'); + // cy.wait('@pools'); + // }); }); if (baseModule === 'mempool') { @@ -409,7 +411,7 @@ describe('Mainnet', () => { it('loads the tv screen - desktop', () => { cy.viewport('macbook-16'); - cy.visit('/'); + cy.visit('/graphs/mempool'); cy.waitForSkeletonGone(); cy.get('#btn-tv').click().then(() => { cy.viewport('macbook-16'); diff --git a/frontend/cypress/e2e/signet/signet.spec.ts b/frontend/cypress/e2e/signet/signet.spec.ts index d2bbd1196..2f09bc4b8 100644 --- a/frontend/cypress/e2e/signet/signet.spec.ts +++ b/frontend/cypress/e2e/signet/signet.spec.ts @@ -60,10 +60,10 @@ describe('Signet', () => { }); }); - describe('tv mode', () => { + describe.skip('tv mode', () => { it('loads the tv screen - desktop', () => { cy.viewport('macbook-16'); - cy.visit('/signet'); + cy.visit('/signet/graphs'); cy.waitForSkeletonGone(); cy.get('#btn-tv').click().then(() => { cy.get('.chart-holder').should('be.visible'); @@ -73,19 +73,17 @@ describe('Signet', () => { }); it('loads the tv screen - mobile', () => { - cy.visit('/signet'); + cy.visit('/signet/graphs'); cy.waitForSkeletonGone(); cy.get('#btn-tv').click().then(() => { cy.viewport('iphone-8'); cy.get('.chart-holder').should('be.visible'); cy.get('.tv-only').should('not.exist'); - //TODO: Remove comment when the bug is fixed - //cy.get('#mempool-block-0').should('be.visible'); + cy.get('#mempool-block-0').should('be.visible'); }); }); }); - it('loads the api screen', () => { cy.visit('/signet'); cy.waitForSkeletonGone(); diff --git a/frontend/cypress/e2e/testnet/testnet.spec.ts b/frontend/cypress/e2e/testnet/testnet.spec.ts index c0c07aa74..b05229a28 100644 --- a/frontend/cypress/e2e/testnet/testnet.spec.ts +++ b/frontend/cypress/e2e/testnet/testnet.spec.ts @@ -63,18 +63,17 @@ describe('Testnet', () => { describe('tv mode', () => { it('loads the tv screen - desktop', () => { cy.viewport('macbook-16'); - cy.visit('/testnet'); + cy.visit('/testnet/graphs'); cy.waitForSkeletonGone(); cy.get('#btn-tv').click().then(() => { cy.wait(1000); cy.get('.tv-only').should('not.exist'); - //TODO: Remove comment when the bug is fixed - //cy.get('#mempool-block-0').should('be.visible'); + cy.get('#mempool-block-0').should('be.visible'); }); }); it('loads the tv screen - mobile', () => { - cy.visit('/testnet'); + cy.visit('/testnet/graphs'); cy.waitForSkeletonGone(); cy.get('#btn-tv').click().then(() => { cy.viewport('iphone-6'); diff --git a/frontend/src/app/components/master-page/master-page.component.html b/frontend/src/app/components/master-page/master-page.component.html index 7b742a5ad..7be41f233 100644 --- a/frontend/src/app/components/master-page/master-page.component.html +++ b/frontend/src/app/components/master-page/master-page.component.html @@ -1,12 +1,12 @@