Skip to content

Commit

Permalink
Tests: Fix owner tests (#2999)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca authored Dec 11, 2023
1 parent 839fd3e commit d99ed4a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/pages/address_book.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const beameriFrameContainer = '#beamerOverlay .iframeCointaner'
const beamerInput = 'input[id="beamer"]'
const nameInput = 'input[name="name"]'
const addressInput = 'input[name="address"]'
export const addressBookRecipient = '[data-testid="address-book-recipient"]'
const saveBtn = 'Save'
export const editEntryBtn = 'button[aria-label="Edit entry"]'
export const deleteEntryBtn = 'button[aria-label="Delete entry"]'
Expand Down
12 changes: 9 additions & 3 deletions cypress/e2e/pages/owners.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as createWallet from '../pages/create_wallet.pages'
import * as navigation from '../pages/navigation.page'
import * as addressBook from '../pages/address_book.page'

const tooltipLabel = (label) => `span[aria-label="${label}"]`
const removeOwnerBtn = 'span[data-track="settings: Remove owner"] > span > button'
Expand Down Expand Up @@ -182,8 +183,13 @@ export function verifyValidWalletName(errorMsg) {
}

export function typeOwnerAddress(address) {
cy.get(newOwnerAddress).clear().type(address)
main.verifyInputValue(newOwnerAddress, address.substring(4))
cy.get(newOwnerAddress)
.clear()
.type(address)
.then(($input) => {
const typedValue = $input.val()
expect(address).to.contain(typedValue)
})
cy.wait(1000)
}

Expand All @@ -197,7 +203,7 @@ export function selectNewOwner(name) {
}

export function verifyNewOwnerName(name) {
cy.get(newOwnerName).should('have.attr', 'placeholder', name)
cy.get(addressBook.addressBookRecipient).should('include.text', name)
}

export function clickOnNextBtn() {
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/regression/add_owner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('Add Owners tests', () => {
owner.waitForConnectionStatus()
owner.openAddOwnerWindow()
owner.typeOwnerAddress(constants.addresBookContacts.user1.address)
owner.selectNewOwner(constants.addresBookContacts.user1.name)
owner.verifyNewOwnerName(constants.addresBookContacts.user1.name)
})

Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/regression/replace_owner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('Replace Owners tests', () => {
owner.waitForConnectionStatus()
owner.openReplaceOwnerWindow()
owner.typeOwnerAddress(constants.addresBookContacts.user1.address)
owner.selectNewOwner(constants.addresBookContacts.user1.name)
owner.verifyNewOwnerName(constants.addresBookContacts.user1.name)
})

Expand Down

0 comments on commit d99ed4a

Please sign in to comment.