diff --git a/tests/selectors/network.selectors.ts b/tests/selectors/network.selectors.ts index 4908387c28f..fd6dffa1d8a 100644 --- a/tests/selectors/network.selectors.ts +++ b/tests/selectors/network.selectors.ts @@ -5,6 +5,7 @@ export enum NetworkSelectors { NetworkKey = 'network-key', BtnAddNetwork = 'btn-add-network', ErrorText = 'error-text', + EmptyNameError = 'Enter a name', EmptyStacksAddressError = 'Enter a valid Stacks API URL', EmptyBitcoinURLError = 'Enter a valid Bitcoin API URL', EmptyKeyError = 'Enter a unique key', diff --git a/tests/specs/network/add-network.spec.ts b/tests/specs/network/add-network.spec.ts index fbc17ea928f..a1bf3b72d98 100644 --- a/tests/specs/network/add-network.spec.ts +++ b/tests/specs/network/add-network.spec.ts @@ -13,6 +13,7 @@ test.describe('Networks tests', () => { }); test('validation error when stacks api url is empty', async ({ networkPage }) => { + await networkPage.inputNetworkNameField('Test network'); await networkPage.inputNetworkStacksAddressField(''); await networkPage.inputNetworkBitcoinAddressField('https://mempool.space/testnet/api'); await networkPage.inputNetworkKeyField('test-network'); @@ -24,7 +25,16 @@ test.describe('Networks tests', () => { test.expect(errorMessage).toEqual(NetworkSelectors.EmptyStacksAddressError); }); + test('validation error when name is empty', async ({ networkPage }) => { + await networkPage.clickAddNetwork(); + await networkPage.waitForErrorMessage(); + + const errorMsgElement = await networkPage.getErrorMessage(); + const errorMessage = await errorMsgElement.innerText(); + test.expect(errorMessage).toEqual(NetworkSelectors.EmptyNameError); + }); test('validation error when key is empty', async ({ networkPage }) => { + await networkPage.inputNetworkNameField('Test network'); await networkPage.clickAddNetwork(); await networkPage.waitForErrorMessage(); @@ -34,6 +44,7 @@ test.describe('Networks tests', () => { }); test('validation error when bitcoin api url is empty', async ({ networkPage }) => { + await networkPage.inputNetworkNameField('Test network'); await networkPage.inputNetworkBitcoinAddressField(''); await networkPage.inputNetworkKeyField('test-network'); await networkPage.clickAddNetwork(); @@ -45,6 +56,7 @@ test.describe('Networks tests', () => { }); test('unable to fetch info from stacks node', async ({ networkPage }) => { + await networkPage.inputNetworkNameField('Test network'); await networkPage.inputNetworkStacksAddressField('https://www.google.com/'); await networkPage.inputNetworkKeyField('test-network'); await networkPage.clickAddNetwork(); @@ -56,6 +68,7 @@ test.describe('Networks tests', () => { }); test('unable to fetch mempool from bitcoin node', async ({ networkPage }) => { + await networkPage.inputNetworkNameField('Test network'); await networkPage.inputNetworkBitcoinAddressField('https://www.google.com/'); await networkPage.inputNetworkKeyField('test-network'); await networkPage.clickAddNetwork();