From d99ed4a0937e88d7edeb2874e7711eda123a60f3 Mon Sep 17 00:00:00 2001 From: Michael <30682308+mike10ca@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:19:57 +0100 Subject: [PATCH] Tests: Fix owner tests (#2999) --- cypress/e2e/pages/address_book.page.js | 1 + cypress/e2e/pages/owners.pages.js | 12 +++++++++--- cypress/e2e/regression/add_owner.cy.js | 1 - cypress/e2e/regression/replace_owner.cy.js | 1 - 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/pages/address_book.page.js b/cypress/e2e/pages/address_book.page.js index 1bc54e3ae9..abe9536846 100644 --- a/cypress/e2e/pages/address_book.page.js +++ b/cypress/e2e/pages/address_book.page.js @@ -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"]' diff --git a/cypress/e2e/pages/owners.pages.js b/cypress/e2e/pages/owners.pages.js index 0ed01d629a..355810f5aa 100644 --- a/cypress/e2e/pages/owners.pages.js +++ b/cypress/e2e/pages/owners.pages.js @@ -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' @@ -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) } @@ -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() { diff --git a/cypress/e2e/regression/add_owner.cy.js b/cypress/e2e/regression/add_owner.cy.js index 2bb15fc757..8f8b925087 100644 --- a/cypress/e2e/regression/add_owner.cy.js +++ b/cypress/e2e/regression/add_owner.cy.js @@ -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) }) diff --git a/cypress/e2e/regression/replace_owner.cy.js b/cypress/e2e/regression/replace_owner.cy.js index 4d3465983c..ad78ba8241 100644 --- a/cypress/e2e/regression/replace_owner.cy.js +++ b/cypress/e2e/regression/replace_owner.cy.js @@ -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) })