-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
787 additions
and
1,017 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import * as constants from '../../support/constants' | ||
import * as main from '../../e2e/pages/main.page' | ||
import * as owner from '../pages/owners.pages' | ||
import * as addressBook from '../pages/address_book.page' | ||
|
||
describe('Add Owners tests', () => { | ||
beforeEach(() => { | ||
cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) | ||
cy.clearLocalStorage() | ||
main.acceptCookies() | ||
cy.contains(owner.safeAccountNonceStr, { timeout: 10000 }) | ||
}) | ||
|
||
it('Verify Tooltip displays correct message for disconnected user', () => { | ||
owner.waitForConnectionStatus() | ||
owner.clickOnWalletExpandMoreIcon() | ||
owner.clickOnDisconnectBtn() | ||
owner.verifyAddOwnerBtnIsDisabled() | ||
}) | ||
|
||
it('Verify the Add New Owner Form can be opened', () => { | ||
owner.waitForConnectionStatus() | ||
owner.openAddOwnerWindow() | ||
}) | ||
|
||
it('Verify error message displayed if character limit is exceeded in Name input', () => { | ||
owner.waitForConnectionStatus() | ||
owner.openAddOwnerWindow() | ||
owner.typeOwnerName(main.generateRandomString(51)) | ||
owner.verifyErrorMsgInvalidAddress(constants.addressBookErrrMsg.exceedChars) | ||
}) | ||
|
||
it('Verify that the "Name" field is auto-filled with the relevant name from Address Book', () => { | ||
cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) | ||
addressBook.clickOnCreateEntryBtn() | ||
addressBook.typeInName(constants.addresBookContacts.user1.name) | ||
addressBook.typeInAddress(constants.addresBookContacts.user1.address) | ||
addressBook.clickOnSaveEntryBtn() | ||
addressBook.verifyNewEntryAdded(constants.addresBookContacts.user1.name, constants.addresBookContacts.user1.address) | ||
cy.visit(constants.setupUrl + constants.SEPOLIA_TEST_SAFE_1) | ||
owner.waitForConnectionStatus() | ||
owner.openAddOwnerWindow() | ||
owner.typeOwnerAddress(constants.addresBookContacts.user1.address) | ||
owner.selectNewOwner(constants.addresBookContacts.user1.name) | ||
owner.verifyNewOwnerName(constants.addresBookContacts.user1.name) | ||
}) | ||
|
||
it('Verify that Name field not mandatory', () => { | ||
owner.waitForConnectionStatus() | ||
owner.openAddOwnerWindow() | ||
owner.typeOwnerAddress(constants.SEPOLIA_OWNER_2) | ||
owner.clickOnNextBtn() | ||
owner.verifyConfirmTransactionWindowDisplayed() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import 'cypress-file-upload' | ||
const path = require('path') | ||
import { format } from 'date-fns' | ||
import * as constants from '../../support/constants' | ||
import * as addressBook from '../../e2e/pages/address_book.page' | ||
import * as main from '../../e2e/pages/main.page' | ||
|
||
const NAME = 'Owner1' | ||
const EDITED_NAME = 'Edited Owner1' | ||
|
||
describe('Address book tests', () => { | ||
beforeEach(() => { | ||
cy.clearLocalStorage() | ||
cy.visit(constants.addressBookUrl + constants.SEPOLIA_TEST_SAFE_1) | ||
main.acceptCookies() | ||
}) | ||
|
||
//TODO: Use localstorage for setting up/deleting entries | ||
it('Verify entered entry in Name input can be saved', () => { | ||
addressBook.clickOnCreateEntryBtn() | ||
addressBook.addEntry(NAME, constants.RECIPIENT_ADDRESS) | ||
addressBook.clickOnEditEntryBtn() | ||
addressBook.typeInNameInput(EDITED_NAME) | ||
addressBook.clickOnSaveButton() | ||
addressBook.verifyNameWasChanged(NAME, EDITED_NAME) | ||
}) | ||
|
||
//TODO: Rework to use Polygon. Replace Verify csv file can be imported (Goerli) with this test | ||
it.skip('Verify that Sepolia and Polygon addresses can be imported', () => { | ||
// Go to a Safe on Gnosis Chain | ||
cy.get('header') | ||
.contains(/^G(ö|oe)rli$/) | ||
.click() | ||
cy.contains('Gnosis Chain').click() | ||
|
||
// Navigate to the Address Book page | ||
cy.visit(`/address-book?safe=${constants.GNO_TEST_SAFE}`) | ||
|
||
// Waits for the Address Book table to be in the page | ||
cy.contains('p', 'Address book').should('be.visible') | ||
|
||
// Finds the imported Gnosis Chain address | ||
cy.contains(constants.GNO_CSV_ENTRY.name).should('exist') | ||
cy.contains(constants.GNO_CSV_ENTRY.address).should('exist') | ||
}) | ||
|
||
// TODO: Rework with localstorage. Change title in Testrail. New title "...exported" | ||
it('Verify the address book file can be downloaded', () => { | ||
addressBook.clickOnImportFileBtn() | ||
addressBook.importFile() | ||
// Download the export file | ||
const date = format(new Date(), 'yyyy-MM-dd', { timeZone: 'UTC' }) | ||
const fileName = `safe-address-book-${date}.csv` //name that is given to the file automatically | ||
|
||
addressBook.clickOnExportFileBtn() | ||
//This is the submit button for the Export modal. It requires an actuall class or testId to differentiate | ||
//from the Export button at the top of the AB table | ||
addressBook.confirmExport() | ||
|
||
const downloadsFolder = Cypress.config('downloadsFolder') | ||
//File reading is failing in the CI. Can be tested locally | ||
cy.readFile(path.join(downloadsFolder, fileName)).should('exist') | ||
// TODO: Add verifications on address and chain from file, import and export files should be equal including all chains from origin | ||
}) | ||
}) |
Oops, something went wrong.