Skip to content

Commit 48f8c6a

Browse files
authored
test: update cypress (Uniswap#3908)
* test: update cypress * chore: comment on infura origin * test: split build and serve * chore: rm setupNodeEvents
1 parent 091876a commit 48f8c6a

16 files changed

+204
-56
lines changed

.github/workflows/integration-tests.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ jobs:
3737
- name: Install dependencies
3838
run: yarn install --frozen-lockfile
3939

40-
- run: yarn build:e2e
40+
- run: yarn build
4141
env:
4242
CI: false # disables lint checks when building
4343

44-
- run: yarn test:e2e:ci
44+
- run: yarn serve &
45+
env:
46+
CI: false # disables lint checks when building
47+
48+
- run: yarn cypress run --record
4549
env:
4650
CYPRESS_INTEGRATION_TEST_PRIVATE_KEY: ${{ secrets.CYPRESS_INTEGRATION_TEST_PRIVATE_KEY }}
4751
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

CONTRIBUTING.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,59 @@ Thank you for your interest in contributing to the Uniswap interface! 🦄
44

55
# Development
66

7+
Before running anything, you'll need to install the dependencies:
8+
9+
```
10+
yarn install
11+
```
12+
713
## Running the interface locally
814

9-
1. `yarn install`
10-
1. `yarn start`
15+
```
16+
yarn start
17+
```
18+
19+
The interface should automatically open. If it does not, navigate to [http://localhost:3000].
1120

1221
## Creating a production build
1322

14-
1. `yarn install`
15-
1. `yarn build`
23+
```
24+
yarn build
25+
```
26+
27+
To serve the production build:
28+
29+
```
30+
yarn serve
31+
```
32+
33+
Then, navigate to [http://localhost:3000] to see it.
1634

1735
## Running unit tests
1836

19-
- Run unit tests: `yarn test`
20-
- Run unit tests and show test coverage info for all tests: `yarn test --watchAll`
37+
```
38+
yarn test
39+
```
40+
41+
By default, this runs only unit tests that have been affected since the last commit. To run _all_ unit tests:
42+
43+
```
44+
yarn test --watchAll
45+
```
2146

2247
## Running cypress integration tests
2348

24-
1. `yarn build:e2e`
25-
2. `yarn test:e2e`
49+
Integration tests require a server to be running. In order to see your changes quickly, run `start` in its own tab/window:
50+
51+
```
52+
yarn start
53+
```
54+
55+
Integration tests are run using `cypress`. When developing locally, use `cypress open` for an interactive UI, and to inspect the rendered page:
56+
57+
```
58+
yarn cypress open
59+
```
2660

2761
## Engineering standards
2862

cypress.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
projectId: 'yp82ef',
5+
video: false,
6+
defaultCommandTimeout: 10000,
7+
chromeWebSecurity: false,
8+
e2e: {
9+
baseUrl: 'http://localhost:3000',
10+
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
11+
},
12+
})

cypress.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

cypress/integration/pool.test.ts renamed to cypress/e2e/pool.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
describe('Pool', () => {
22
beforeEach(() => cy.visit('/pool'))
3+
34
it('add liquidity links to /add/ETH', () => {
45
cy.get('#join-pool-button').click()
56
cy.url().should('contain', '/add/ETH')
File renamed without changes.

0 commit comments

Comments
 (0)