From 36c11f0e25219839e3e6145c21c60100a52d471b Mon Sep 17 00:00:00 2001 From: Niraj Date: Tue, 12 Nov 2024 15:08:16 +0545 Subject: [PATCH] test: add test 5A and 5B for connect/disconnect wallet --- integration_test/lib/pages/loginPage.ts | 1 + .../5-wallet-connect/walletConnect.spec.ts | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 integration_test/tests/5-wallet-connect/walletConnect.spec.ts diff --git a/integration_test/lib/pages/loginPage.ts b/integration_test/lib/pages/loginPage.ts index b60eea5..c6b2f20 100644 --- a/integration_test/lib/pages/loginPage.ts +++ b/integration_test/lib/pages/loginPage.ts @@ -19,6 +19,7 @@ export default class LoginPage { } async logout(): Promise { + await this.connectWalletBtn.first().click(); await this.disconnectWalletBtn.click(); } diff --git a/integration_test/tests/5-wallet-connect/walletConnect.spec.ts b/integration_test/tests/5-wallet-connect/walletConnect.spec.ts new file mode 100644 index 0000000..b926712 --- /dev/null +++ b/integration_test/tests/5-wallet-connect/walletConnect.spec.ts @@ -0,0 +1,26 @@ +import { setAllureEpic } from '@helpers/allure'; +import LoginPage from '@pages/loginPage'; +import { test } from '@fixtures/walletExtension'; +import { organizerWallet } from '@constants/staticWallets'; +import { expect } from '@playwright/test'; + +test.beforeEach(async () => { + await setAllureEpic('5. Wallet connect'); +}); +test.use({ wallet: organizerWallet }); + +test('5A. Should connect wallet if stake key is registered', async ({ + page, +}) => { + const loginPage = new LoginPage(page); + await loginPage.login(); + await loginPage.isLoggedIn(); +}); + +test('5B. Should disconnect Wallet When connected', async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.login(); + + await loginPage.logout(); + await expect(page.getByTestId('create-poll-button').first()).toBeVisible(); +});