Skip to content

Commit

Permalink
Added test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
hjetpoluru committed Sep 20, 2024
1 parent 1e75b28 commit 17de3dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion test/e2e/page-objects/pages/dialog/select-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ class SelectNetwork {

private ethereumMainnet: string;

private sepoliaNetwork: string;

private addNetworkButton: object;

constructor(driver: Driver) {
this.driver = driver;
this.ethereumMainnet = '[data-testid="Ethereum Mainnet"]';
this.sepoliaNetwork = '[data-testid="Sepolia"]';
this.addNetworkButton = {
tag: 'button',
text: 'Add network',
Expand All @@ -21,10 +24,15 @@ class SelectNetwork {
await this.driver.clickElement(this.ethereumMainnet);
}

async clickSepoliaNetwork(): Promise<void> {
console.log(`Click Sepolia network`);
await this.driver.clickElement(this.sepoliaNetwork);
}

async addNewNetwork(): Promise<void> {
console.log(`Click Add network`);
await this.driver.clickElement(this.addNetworkButton);
}
}

export default SelectNetwork;
export default SelectNetwork;
7 changes: 6 additions & 1 deletion test/e2e/tests/network/switch-network.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import AddNetworkPage from '../../page-objects/pages/add-network-page';
import NewNetworkAddedPopover from '../../page-objects/pages/popover-wrap/new-network-added';

describe('Switch network', function (this: Suite) {
it('Ethereum Mainnet', async function () {
it('Ethereum Mainnet and Sepolia', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
Expand All @@ -30,6 +30,11 @@ describe('Switch network', function (this: Suite) {
await headerNavbar.clickSwitchNetworkDropDown();
await selectNetwork.clickEthereumMainnet();
await homePage.check_expectedBalanceIsDisplayed();
await headerNavbar.check_networkNameSwitchDropDown('Ethereum Mainnet');
await headerNavbar.clickSwitchNetworkDropDown();
await selectNetwork.clickSepoliaNetwork();
await homePage.check_expectedBalanceIsDisplayed();
await headerNavbar.check_networkNameSwitchDropDown('Sepolia');
},
);
});
Expand Down

0 comments on commit 17de3dd

Please sign in to comment.