Skip to content

Commit

Permalink
Upgrade synpress (#2176)
Browse files Browse the repository at this point in the history
* Upgrade synpress

* Fix tests

* Update to PR template
  • Loading branch information
sophialittlejohn authored Jul 10, 2024
1 parent 6c4b2a7 commit abd0ac2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
5 changes: 1 addition & 4 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ This pull request...

<!-- This will link the pull request to a Github issue. Remove if there is no corresponding Github issue. -->

Closes #<issue-number>
#<issue-number>

### Approvals

<!-- Depending on the nature of the pull request, remove the roles that are not necessary for this review. Intricate technical changes may require two dev approvals. Reviewers should check the corresponding box after they approve. -->

- [ ] Dev
- [ ] Dev
- [ ] Designer
- [ ] Product

### Screenshots

Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"vitest": "^1.2.1"
},
"devDependencies": {
"@synthetixio/synpress": "^3.7.2-beta.9",
"@synthetixio/synpress": "^3.7.3",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/react-helmet-async": "^1.0.3",
Expand Down
11 changes: 3 additions & 8 deletions centrifuge-app/tests/e2e/specs/invest.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import pool from '../data/pool.json'

describe('Invest flows', () => {
before(() => {
cy.renameMetamaskAccount('Pool Admin') // rename account to Pool Admin
cy.renameMetamaskAccount('Pool Admin')
cy.switchMetamaskAccount('Account 1')
cy.renameMetamaskAccount('Investor') // rename account to Investor
cy.renameMetamaskAccount('Investor')
})
it('Pool Admin: Transfer DEVEL (fund investor)', () => {
cy.visit('/portfolio', { failOnStatusCode: false })
cy.connectWallet({ init: true }) // init true to accept metamask connection, only required in first test case
cy.switchMetamaskAccount('Investor') // switch to investor account to grab address
cy.get('a[href="/portfolio?send=DEVEL"]').click()
cy.getMetamaskWalletAddress().then((address) => {
cy.get('input[name="recipientAddress"]').type(address)
Expand All @@ -34,19 +33,16 @@ describe('Invest flows', () => {
cy.confirmTransaction()
})
it('Pool Admin: Whitelist an investor wallet', () => {
cy.switchMetamaskAccount('Pool Admin')
cy.visit('/pools', { failOnStatusCode: false })
cy.connectWallet()
cy.contains(pool.name).click() // issuer pool link
cy.contains('Investors').click()
cy.switchMetamaskAccount('Investor') // switch to investor account to grab address
cy.getMetamaskWalletAddress().then((address) => {
cy.switchMetamaskAccount('Pool Admin')
cy.get('input[name="investorStatus"]').type(address)
})
cy.switchMetamaskAccount('Pool Admin') // switch back to pool admin account
cy.contains(pool.poolAdmin).should('not.be.true')
cy.switchMetamaskAccount('Pool Admin')
cy.contains(pool.poolAdmin).should('not.be.true')
cy.get(`button[aria-label='Add ${pool.tranches[0].id} to memberlist']`).click()
cy.confirmTransaction()
})
Expand Down Expand Up @@ -88,7 +84,6 @@ describe('Invest flows', () => {
})
it('Investor: Redeem investment', () => {
cy.visit('/pools', { failOnStatusCode: false })
cy.switchMetamaskAccount('Investor')
cy.connectWallet()
cy.get(`a[aria-label="Go to ${pool.name} details"]`).click() // investor pool link
cy.get(`button[aria-label="Invest in ${pool.tranches[0].id}"]`).click()
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ __metadata:
"@styled-system/css": ^5.1.5
"@styled-system/should-forward-prop": ^5.1.5
"@subwallet/wallet-connect": ^0.2.6
"@synthetixio/synpress": ^3.7.2-beta.9
"@synthetixio/synpress": ^3.7.3
"@types/react": ^18.0.27
"@types/react-dom": ^18.0.10
"@types/react-helmet-async": ^1.0.3
Expand Down Expand Up @@ -8768,9 +8768,9 @@ __metadata:
languageName: node
linkType: hard

"@synthetixio/synpress@npm:^3.7.2-beta.9":
version: 3.7.2-beta.10
resolution: "@synthetixio/synpress@npm:3.7.2-beta.10"
"@synthetixio/synpress@npm:^3.7.3":
version: 3.7.3
resolution: "@synthetixio/synpress@npm:3.7.3"
dependencies:
"@cypress/code-coverage": ^3.11.0
"@cypress/webpack-dev-server": ^3.5.2
Expand Down Expand Up @@ -8806,7 +8806,7 @@ __metadata:
wait-on: ^7.0.1
bin:
synpress: synpress.js
checksum: 08c8d1da25b8f6322ff9c8df37aef32c5bf77fb58606418e89de77c6d5a83d5a43e273a664c6a0104789cb2a7f4730f2129e81dba31422cef22b4e654adb7491
checksum: 1915122344c5e3d554510ddb163f9d8a10657a4de102c5380845d033a27ee59794cc845f621aebf900cbb9af967f01570d1e44caad246432f73acde4fc1e7019
languageName: node
linkType: hard

Expand Down

0 comments on commit abd0ac2

Please sign in to comment.