Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hjetpoluru committed Oct 23, 2024
1 parent 2caa271 commit 88d5179
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Driver } from '../../../webdriver/driver';

class Notification {
class networkSwitchModalConfirmation {
private driver: Driver;

private submitButton: string;
Expand All @@ -12,8 +12,8 @@ class Notification {

async clickApproveButton(): Promise<void> {
console.log('Click Approve Button');
await this.driver.clickElement(this.submitButton);
await this.driver.clickElementAndWaitToDisappear(this.submitButton);
}
}

export default Notification;
export default networkSwitchModalConfirmation;
4 changes: 2 additions & 2 deletions test/e2e/page-objects/pages/dialog/select-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SelectNetwork {

async clickCloseButton(): Promise<void> {
console.log('Click Close Button');
await this.driver.clickElement(this.closeButton);
await this.driver.clickElementAndWaitToDisappear(this.closeButton);
}

async clickToggleButton(): Promise<void> {
Expand All @@ -52,7 +52,7 @@ class SelectNetwork {

async clickAddButton(): Promise<void> {
console.log('Click Add Button');
await this.driver.clickElement('[data-testid="test-add-button"]');
await this.driver.clickElementAndWaitToDisappear('[data-testid="test-add-button"]');
}
}

Expand Down
10 changes: 5 additions & 5 deletions test/e2e/tests/network/switch-network.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import FixtureBuilder from '../../fixture-builder';
import { Ganache } from '../../seeder/ganache';
import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow';
import HomePage from '../../page-objects/pages/homepage';
import Notification from '../../page-objects/pages/dialog/notification';
import ModalConfirmation from '../../page-objects/pages/dialog/network-switch-modal-confirmation';
import HeaderNavbar from '../../page-objects/pages/header-navbar';
import SelectNetwork from '../../page-objects/pages/dialog/select-network';

describe('Switch network - ', function (this: Suite) {
it('Ethereum Mainnet and Sepolia', async function () {
it('multiple networks', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
Expand All @@ -28,7 +28,7 @@ describe('Switch network - ', function (this: Suite) {
const homePage = new HomePage(driver);
const headerNavbar = new HeaderNavbar(driver);
const selectNetwork = new SelectNetwork(driver);
const notification = new Notification(driver);
const networkSwitchConfirmation = new ModalConfirmation(driver);

// Validate the default network is Localhost 8545
await headerNavbar.check_currentSelectedNetwork('Localhost 8545');
Expand All @@ -45,11 +45,11 @@ describe('Switch network - ', function (this: Suite) {
await homePage.check_expectedBalanceIsDisplayed('25');
await headerNavbar.check_currentSelectedNetwork('Localhost 8545');

// Add Aribtrum network and perform the switch network functionality
// Add Arbitrum network and perform the switch network functionality
await headerNavbar.clickSwitchNetworkDropDown();
await selectNetwork.fillNetworkSearchInput('Arbitrum One');
await selectNetwork.clickAddButton();
await notification.clickApproveButton();
await networkSwitchConfirmation.clickApproveButton();
await headerNavbar.clickSwitchNetworkDropDown();
await selectNetwork.clickNetworkName('Arbitrum One');
await homePage.check_expectedBalanceIsDisplayed('25');
Expand Down

0 comments on commit 88d5179

Please sign in to comment.