Skip to content

Commit

Permalink
fix: merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Oct 6, 2023
2 parents 0a4cfcb + d8f3152 commit 2e6abed
Show file tree
Hide file tree
Showing 126 changed files with 7,482 additions and 1,131 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,12 @@ NEXT_PUBLIC_CYPRESS_MNEMONIC=
NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_PRODUCTION=
NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_STAGING=

# Firebase Cloud Messaging
NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION=
NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION=

NEXT_PUBLIC_FIREBASE_OPTIONS_STAGING=
NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING=

# Redefine
NEXT_PUBLIC_REDEFINE_API=
4 changes: 4 additions & 0 deletions .github/workflows/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ runs:
NEXT_PUBLIC_SAFE_RELAY_SERVICE_URL_STAGING: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_STAGING }}
NEXT_PUBLIC_IS_OFFICIAL_HOST: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_IS_OFFICIAL_HOST }}
NEXT_PUBLIC_REDEFINE_API: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_REDEFINE_API }}
NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION }}
NEXT_PUBLIC_FIREBASE_OPTIONS_STAGING: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_FIREBASE_OPTIONS_STAGING }}
NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION }}
NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING: ${{ fromJSON(inputs.secrets).NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING }}
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
# Extract branch name
- name: Extract branch name
shell: bash
## Cut off "refs/heads/" and only allow alphanumeric characters,
## Cut off "refs/heads/", only allow alphanumeric characters and convert to lower case,
## e.g. "refs/heads/features/hello-1.2.0" -> "features_hello_1_2_0"
run: echo "branch=$(echo $GITHUB_HEAD_REF | sed 's/refs\/heads\///' | sed 's/[^a-z0-9]/_/ig')" >> $GITHUB_OUTPUT
run: echo "branch=$(echo $GITHUB_HEAD_REF | sed 's/refs\/heads\///' | sed 's/[^a-z0-9]/_/ig' | sed 's/[A-Z]/\L&/g')" >> $GITHUB_OUTPUT
id: extract_branch

# Deploy to S3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:

jobs:
e2e:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Smoke E2E tests
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/yarn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ runs:
- name: Yarn install
shell: bash
run: yarn install --frozen-lockfile
- name: Yarn after install
shell: bash
run: yarn after-install
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ yalc.lock

/public/sw.js
/public/sw.js.map
/public/worker-*.js
/public/workbox-*.js
/public/workbox-*.js.map
/public/fallback*
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Here's the list of all the required and optional variables:
| `NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_STAGING` | optional | Relay URL on staging
| `NEXT_PUBLIC_IS_OFFICIAL_HOST` | optional | Whether it's the official distribution of the app, or a fork; has legal implications. Set to true only if you also update the legal pages like Imprint and Terms of use
| `NEXT_PUBLIC_REDEFINE_API` | optional | Redefine API base URL
| `NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION` | optional | Firebase Cloud Messaging (FCM) `initializeApp` options on production
| `NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION` | optional | FCM vapid key on production
| `NEXT_PUBLIC_FIREBASE_OPTIONS_STAGING` | optional | FCM `initializeApp` options on staging
| `NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING` | optional | FCM vapid key on staging

If you don't provide some of the optional vars, the corresponding features will be disabled in the UI.

Expand Down
3 changes: 3 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default defineConfig({

e2e: {
baseUrl: 'http://localhost:3000',
testIsolation: false,
hideXHR: true,
defaultCommandTimeout: 10000,
},

chromeWebSecurity: false,
Expand Down
102 changes: 0 additions & 102 deletions cypress/e2e/add_owner.cy.js

This file was deleted.

23 changes: 22 additions & 1 deletion cypress/e2e/pages/address_book.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export const acceptSelection = 'Accept selection'
export const addressBook = 'Address book'
const createEntryBtn = 'Create entry'

const beameriFrameContainer = '#beamerOverlay .iframeCointaner'
const beamerInput = 'input[id="beamer"]'
const nameInput = 'input[name="name"]'
const addressInput = 'input[name="address"]'
const saveBtn = 'Save'
Expand All @@ -13,6 +15,8 @@ const exportFileModalBtnSection = '.MuiDialogActions-root'
const exportFileModalExportBtn = 'Export'
const importBtn = 'Import'
const exportBtn = 'Export'
const whatsNewBtnStr = "What's new"
const beamrCookiesStr = 'accept the "Beamer" cookies'

export function clickOnImportFileBtn() {
cy.contains(importBtn).click()
Expand Down Expand Up @@ -46,7 +50,7 @@ export function clickOnCreateEntryBtn() {
cy.contains(createEntryBtn).click()
}

export function tyeInName(name) {
export function typeInName(name) {
cy.get(nameInput).type(name)
}

Expand Down Expand Up @@ -91,3 +95,20 @@ export function clickDeleteEntryModalDeleteButton() {
export function verifyEditedNameNotExists(name) {
cy.get(name).should('not.exist')
}

export function clickOnWhatsNewBtn(force = false) {
cy.contains(whatsNewBtnStr).click({ force: force })
}

export function acceptBeamerCookies() {
cy.contains(beamrCookiesStr)
}

export function verifyBeamerIsChecked() {
cy.get(beamerInput).should('be.checked')
}

export function verifyBeameriFrameExists() {
cy.wait(1000)
cy.get(beameriFrameContainer).should('exist')
}
1 change: 1 addition & 0 deletions cypress/e2e/pages/balances.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const hideAssetBtn = 'button[aria-label="Hide asset"]'
const hiddeTokensBtn = '[data-testid="toggle-hidden-assets"]'
const hiddenTokenCheckbox = 'input[type="checkbox"]'
const paginationPageList = 'ul[role="listbox"]'
const currencyDropDown = 'div[id="currency"]'
const hiddenTokenSaveBtn = 'Save'
const hideTokenDefaultString = 'Hide tokens'

Expand Down
9 changes: 7 additions & 2 deletions cypress/e2e/pages/batches.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const tokenAddressInput = 'input[name="tokenAddress"]'
const listBox = 'ul[role="listbox"]'
const amountInput = '[name="amount"]'
const nonceInput = 'input[name="nonce"]'
const executeOptionsContainer = 'div[role="radiogroup"]'

export function addToBatch(EOA, currentNonce, amount, verify = false) {
fillTransactionData(EOA, amount)
Expand All @@ -49,8 +50,12 @@ function setNonceAndProceed(currentNonce) {
}

function executeTransaction() {
cy.contains(yesExecuteString, { timeout: 4000 }).click()
cy.contains(addToBatchBtn).should('not.exist')
cy.waitForSelector(() => {
return cy.get(executeOptionsContainer).then(() => {
cy.contains(yesExecuteString, { timeout: 4000 }).click()
cy.contains(addToBatchBtn).should('not.exist')
})
})
}

function addToBatchButton() {
Expand Down
44 changes: 42 additions & 2 deletions cypress/e2e/pages/create_tx.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const amountInput = 'input[name="amount"]'
const nonceInput = 'input[name="nonce"]'
const gasLimitInput = '[name="gasLimit"]'
const rotateLeftIcon = '[data-testid="RotateLeftIcon"]'
const transactionItemExpandable = 'div[id^="transfer"]'

const viewTransactionBtn = 'View transaction'
const transactionDetailsTitle = 'Transaction details'
Expand All @@ -26,6 +27,8 @@ const editBtnStr = 'Edit'
const executionParamsStr = 'Execution parameters'
const noLaterStr = 'No, later'
const signBtnStr = 'Sign'
const expandAllBtnStr = 'Expand all'
const collapseAllBtnStr = 'Collapse all'

export function clickOnNewtransactionBtn() {
// Assert that "New transaction" button is visible
Expand Down Expand Up @@ -90,7 +93,7 @@ export function changeNonce(value) {
}

export function verifyConfirmTransactionData() {
cy.contains(yesStr).should('exist')
cy.contains(yesStr).should('exist').click()
cy.contains(estimatedFeeStr).should('exist')

// Asserting the sponsored info is present
Expand Down Expand Up @@ -130,7 +133,7 @@ export function clickOnSignTransactionBtn() {
}

export function waitForProposeRequest() {
cy.intercept('POST', constants.proposeEndPoint).as('ProposeTx')
cy.intercept('POST', constants.proposeEndpoint).as('ProposeTx')
cy.wait('@ProposeTx')
}

Expand All @@ -149,3 +152,40 @@ export function verifyQueueLabel() {
export function verifyTransactionSummary(sendValue) {
cy.contains(TransactionSummary + `${sendValue} ${constants.tokenAbbreviation.gor}`).should('exist')
}

export function verifyDateExists(date) {
cy.contains('div', date).should('exist')
}

export function verifyImageAltTxt(index, text) {
cy.get('img').eq(index).should('have.attr', 'alt', text).should('be.visible')
}

export function verifyStatus(status) {
cy.contains('div', status).should('exist')
}

export function verifyTransactionStrExists(str) {
cy.contains(str).should('exist')
}

export function verifyTransactionStrNotVible(str) {
cy.contains(str).should('not.be.visible')
}

export function clickOnTransactionExpandableItem(name, actions) {
cy.contains('div', name)
.next()
.click()
.within(() => {
actions()
})
}

export function clickOnExpandAllBtn() {
cy.contains(expandAllBtnStr).click()
}

export function clickOnCollapseAllBtn() {
cy.contains(collapseAllBtnStr).click()
}
5 changes: 3 additions & 2 deletions cypress/e2e/pages/create_wallet.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export function typeWalletName(name) {
}

export function selectNetwork(network, regex = false) {
cy.get(selectNetworkBtn).click()
cy.contains(network).click()
cy.wait(1000)
cy.get(selectNetworkBtn).should('exist').click()
cy.get('li').contains(network).click()

if (regex) {
regex = constants.networks.goerli
Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/pages/dashboard.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ export function verifyTxQueueWidget() {
cy.contains(noTransactionStr).should('not.exist')

// Queued txns
cy.contains(
`a[href^="/transactions/tx?id=multisig_0x"]`,
'13' + 'Send' + '0.00002 GOR' + 'to' + 'gor:0xE297...9665' + '1/1',
).should('exist')
cy.contains(`a[href^="/transactions/tx?id=multisig_0x"]`, '13' + 'Send' + '-0.00002 GOR' + '1/1').should('exist')

cy.contains(`a[href="${constants.transactionQueueUrl}${encodeURIComponent(constants.TEST_SAFE)}"]`, viewAllStr)
})
}
Expand Down
Loading

0 comments on commit 2e6abed

Please sign in to comment.