Skip to content

Commit

Permalink
Merge pull request #544 from soroswap/feature/ImproveWorkflow
Browse files Browse the repository at this point in the history
Improve github workflow
  • Loading branch information
chopan123 authored Sep 13, 2024
2 parents a65ff77 + 561c355 commit 4ffda99
Show file tree
Hide file tree
Showing 3 changed files with 8,919 additions and 21 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,30 @@ permissions:
packages: none

jobs:
run-tests:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/cache@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: '20.10.0'

- name: Install dependencies
run: yarn install

- name: Build app
run: yarn build

test-app:
env:
NEXT_PUBLIC_BACKEND_URL: ${{vars.NEXT_PUBLIC_BACKEND_URL}}
NEXT_PUBLIC_SOROSWAP_BACKEND_API_KEY: ${{secrets.NEXT_PUBLIC_SOROSWAP_BACKEND_API_KEY}}
Expand All @@ -18,25 +41,27 @@ jobs:
NEXT_PUBLIC_TRUSTLINE_WALLET_PUBLIC_KEY: ${{vars.NEXT_PUBLIC_TRUSTLINE_WALLET_PUBLIC_KEY}}
NEXT_PUBLIC_TEST_TOKENS_ADMIN_SECRET_KEY: ${{secrets.NEXT_PUBLIC_TEST_TOKENS_ADMIN_SECRET_KEY}}
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/[email protected]
- uses: actions/cache@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: '20.10.0'

- name: Install dependencies
run: yarn install


- name: Install cypress
run: yarn cypress install

- name: Build app
run: yarn build
run: yarn cypress install --force

- name: Run app
run: yarn pm2 start next
run: yarn pm2 start next

- name: Run test
run: yarn cy:run
run: yarn cy:run
20 changes: 10 additions & 10 deletions cypress/e2e/flows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,41 +236,41 @@ describe('Navigation flow', () => {
it('should navigate to balances', () => {
cy.visit('/');
cy.get('[data-testid="navbar__container"]').click();
cy.wait(500);
cy.contains('Balance').click();
cy.wait(1500);
cy.contains('Balance').click();
cy.wait(3000);
cy.contains("Your token's balance:");
});
it('should navigate to swap', () => {
cy.visit('/bridge');
cy.get('[data-testid="navbar__container"]').click();
cy.wait(500);
cy.contains('Swap').click();
cy.wait(1500);
cy.contains('Swap').click();
cy.wait(3000);
cy.contains('You sell');
});
it('should navigate to liquidity', () => {
cy.visit('/');
cy.get('[data-testid="navbar__container"]').click();
cy.wait(500);
cy.contains('Liquidity').click();
cy.wait(1500);
cy.contains('Liquidity').click();
cy.wait(3000);
cy.contains('List of your liquidity positions');
});
it('should navigate to bridge', () => {
cy.visit('/');
cy.get('[data-testid="navbar__container"]').click();
cy.wait(500);
cy.contains('Bridge').click();
cy.wait(1500);
cy.contains('Bridge').click();
cy.wait(3000);
cy.contains('Disclaimer');
});
it('should navigate to info', () => {
cy.visit('/');
cy.get('[data-testid="navbar__container"]').click();
cy.wait(500);
cy.contains('Info').click();
cy.wait(1500);
cy.contains('Info').click();
cy.wait(3000);
cy.url().should('match', /https:\/\/info\.soroswap\.finance\//);
});
});
Loading

0 comments on commit 4ffda99

Please sign in to comment.