Skip to content

Commit

Permalink
tests: fix cypress tests on dev (#3374)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca authored Mar 1, 2024
1 parent 65a946a commit a5cfae4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cypress/e2e/pages/create_wallet.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const networkFeeSection = '[data-tetid="network-fee-section"]'
const nextBtn = '[data-testid="next-btn"]'
const backBtn = '[data-testid="back-btn"]'
const cancelBtn = '[data-testid="cancel-btn"]'
const loginBtn = '[data-testid="login-btn"]'

const sponsorStr = 'Your account is sponsored by Goerli'
const safeCreationProcessing = 'Transaction is being executed'
Expand All @@ -34,9 +35,13 @@ export const walletName = 'test1-sepolia-safe'
export const defaultSepoliaPlaceholder = 'Sepolia Safe'
const welcomeToSafeStr = 'Welcome to Safe'

export function clickOnLoginBtn() {
cy.get(loginBtn).click()
}

export function cancelWalletCreation() {
cy.get(cancelBtn).click()
cy.get(createNewSafeBtn).should('be.visible')
cy.get('button').contains(continueWithWalletBtn).should('be.visible')
}

export function clickOnBackBtn() {
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/pages/sidebar.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export function verifySafeCount(count) {

export function openSidebar() {
cy.get(openSafesIcon).click()
cy.wait(500)
showAllSafes()
main.verifyElementsExist([sidebarSafeContainer])
}
Expand Down
10 changes: 10 additions & 0 deletions cypress/e2e/regression/create_safe_simple_2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('Safe creation tests 2', () => {

it('Cancel button cancels safe creation', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
createwallet.clickOnBackBtn()
Expand All @@ -27,6 +28,7 @@ describe('Safe creation tests 2', () => {
// Owners and confirmation step
it('Verify Next button is disabled when address is empty', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.clearOwnerAddress(0)
Expand All @@ -39,6 +41,7 @@ describe('Safe creation tests 2', () => {
.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName)
.then(() => {
cy.visit(constants.welcomeUrl + '?chain=sep')
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.verifyOwnerNamesInConfirmationStep(ownerSepolia)
Expand All @@ -51,6 +54,7 @@ describe('Safe creation tests 2', () => {
.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.sameOwnerName[1])
.then(() => {
cy.visit(constants.welcomeUrl + '?chain=sep')
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.verifyDataDoesNotExist(ownerSepolia)
Expand All @@ -59,6 +63,7 @@ describe('Safe creation tests 2', () => {

it('Verify an valid name for owner can be inputed', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.inputOwnerName(0, ownerName)
Expand All @@ -67,6 +72,7 @@ describe('Safe creation tests 2', () => {

it('Verify Threshold matching required confirmations max with amount of owners', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.clickOnAddNewOwnerBtn()
Expand All @@ -75,6 +81,7 @@ describe('Safe creation tests 2', () => {

it('Verify deleting owner rows updates the currenlty set policies value', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.clickOnAddNewOwnerBtn()
Expand All @@ -85,6 +92,7 @@ describe('Safe creation tests 2', () => {

it('Verify ENS name in the address and name fields is resolved', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.inputOwnerAddress(0, constants.ENS_TEST_SEPOLIA_VALID)
Expand All @@ -94,6 +102,7 @@ describe('Safe creation tests 2', () => {

it('Verify deleting owner rows is possible', () => {
owner.waitForConnectionStatus()
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.clickOnAddNewOwnerBtn()
Expand All @@ -108,6 +117,7 @@ describe('Safe creation tests 2', () => {
.then(() => {
owner.waitForConnectionStatus()
cy.visit(constants.welcomeUrl + '?chain=sep')
createwallet.clickOnContinueWithWalletBtn()
createwallet.clickOnCreateNewSafeBtn()
safe.clickOnNextBtn()
safe.inputOwnerAddress(0, constants.RECIPIENT_ADDRESS)
Expand Down

0 comments on commit a5cfae4

Please sign in to comment.