diff --git a/test/e2e/tests/address-book.spec.js b/test/e2e/tests/address-book.spec.js index 6444b3526333..326cd65f0a34 100644 --- a/test/e2e/tests/address-book.spec.js +++ b/test/e2e/tests/address-book.spec.js @@ -140,11 +140,9 @@ describe('Address Book', function () { await driver.clickElement({ text: 'Edit', tag: 'button' }); const inputUsername = await driver.findElement('#nickname'); - await inputUsername.clear(); await inputUsername.fill('Test Name Edit'); const inputAddress = await driver.findElement('#address'); - await inputAddress.clear(); await inputAddress.fill('0x74cE91B75935D6Bedc27eE002DeFa566c5946f74'); await driver.clickElement('[data-testid="page-container-footer-next"]'); @@ -170,7 +168,7 @@ describe('Address Book', function () { }, ); }); - it('Adds an entry to address book and deletes it from address book', async function () { + it('Deletes existing entry from address book', async function () { await withFixtures( { fixtures: 'address-entry', @@ -186,30 +184,15 @@ describe('Address Book', function () { await driver.clickElement({ text: 'Settings', tag: 'div' }); await driver.clickElement({ text: 'Contacts', tag: 'div' }); - const contacts = await driver.findElements( - '.send__select-recipient-wrapper__group-item', - ); - assert.equal(contacts.length, 1); - // adding new account - await driver.clickElement({ text: 'Add contact', tag: 'button' }); - const inputUsername = await driver.findElement('#nickname'); - await inputUsername.clear(); - await inputUsername.fill('Test Name 2'); - - const inputAddress = await driver.findElement( - '[data-testid="ens-input"]', - ); - await inputAddress.clear(); - await inputAddress.fill('0x74cE91B75935D6Bedc27eE002DeFa566c5946f74'); - // had to put delay since Save button is always enabled and it need some delay to write in address in input field - await driver.delay(500); - await driver.clickElement('[data-testid="page-container-footer-next"]'); - - await driver.clickElement({ text: 'Test Name 2', tag: 'div' }); + await driver.clickElement({ text: 'Test Name 1', tag: 'div' }); await driver.clickElement({ text: 'Edit', tag: 'button' }); await driver.clickElement({ text: 'Delete account', tag: 'a' }); // it checks if account is deleted - assert.equal(contacts.length, 1); + const contact = await driver.findElement( + '.send__select-recipient-wrapper__group-item', + ); + const exists = await driver.isElementPresent(contact); + assert.equal(exists, false, 'Contact is not deleted'); }, ); });